diff --git a/.github/workflows/redhat-certify.yml b/.github/workflows/redhat-certify.yml
index c22136042..2b5b1a09d 100644
--- a/.github/workflows/redhat-certify.yml
+++ b/.github/workflows/redhat-certify.yml
@@ -4,9 +4,9 @@ on:
workflow_dispatch:
inputs:
version:
- description: "EDDI version (e.g. 6.1.0)"
+ description: "EDDI version (e.g. 6.1.1)"
required: true
- default: "6.1.0"
+ default: "6.1.1"
release:
description: "Release number (e.g. 1, 2, 3)"
required: true
diff --git a/docs/changelog.md b/docs/changelog.md
index 7f74da30b..1088b9c08 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -4,6 +4,64 @@
---
+## Swagger UI Overhaul, Manager Update & Version 6.1.1 (2026-06-23)
+
+**Repo:** EDDI (`feat/swagger-ui-overhaul`)
+**What changed:** Complete overhaul of Swagger UI, version bump to 6.1.1, Manager frontend asset update, and Docker base image bump.
+
+### Tag Taxonomy (40 tags, 9 categories)
+
+All `@Tag` annotations updated from flat names to category-based hierarchy (`Category / Subcategory`) for logical grouping in Swagger UI. The `@OpenAPIDefinition` tag array in `OpenApiConfig.java` defines the canonical taxonomy.
+
+- **Agents**: Setup, Agents, Administration, Agent Groups
+- **Configuration**: Workflows, LLM, Behavior Rules, Dictionary, Output, API Calls, MCP Calls, Properties, Prompt Snippets, Global Variables
+- **Conversations**: Conversations, Group Conversations, Conversation Store, Attachments
+- **Integrations**: A2A Protocol, Capability Registry, Channel Integrations, Slack Webhook
+- **Knowledge & Memory**: RAG Knowledge Bases, RAG Ingestion, User Memory
+- **Security**: Authentication, Secrets Vault, Audit Trail, GDPR / Privacy, Tenant Quotas
+- **Administration**: Backup, Schedules, Coordinator Admin, Orphan Admin, Log Admin, Descriptors
+- **Tools**: Tool History, Template Preview, Standalone NLP
+- **UI**: Chat UI
+
+All 49 REST interface `@Tag` annotations now include `description` attributes (SmallRye was silently dropping `@OpenAPIDefinition` descriptions when interface-level `@Tag` lacked one).
+
+4 previously untagged endpoints received new `@Tag` annotations:
+- `ILogoutEndpoint` → `Security / Authentication`
+- `RestSlackWebhook` → `Integrations / Slack Webhook`
+- `RestToolHistory` → `Tools / Tool History` (+ added missing `@ApplicationScoped`)
+- `RestA2AEndpoint` → `Integrations / A2A Protocol` (capability endpoints tagged `Integrations / Capability Registry`)
+
+### OpenApiTagSortFilter (new)
+
+New `OASFilter` implementation (`OpenApiTagSortFilter.java`) sorts tags alphabetically at build time, producing stable ordering. Fixed `UnsupportedOperationException` caused by sorting SmallRye's unmodifiable tag list. Swagger UI config: `quarkus.swagger-ui.tags-sorter=alpha`, `quarkus.swagger-ui.theme=original`.
+
+### Swagger UI Light/Dark Mode
+
+Complete rewrite of `META-INF/branding/style.css` with proper dual-theme support:
+- **Light mode** (default): white backgrounds, dark text, amber-600 (`#d97706`) accents
+- **Dark mode** (lamp toggle → `html.dark-mode`): EDDI Manager palette — zinc-950 bg, zinc-900 surfaces, amber-500 accents
+- Topbar stays dark (`#18181b`) in both modes for brand consistency with logo
+- EDDI amber accents on Authorize, Execute, Explore, and Try-it-out buttons
+- Version badge `6.1.1` with WCAG AAA contrast; OAS 3.1 badge demoted to subtle gray
+- HTTP verb tinted operation blocks (blue GET, green POST, amber PUT, red DELETE, purple PATCH)
+- Logo renamed `eddi-logo.png` → `logo.png` (Quarkus auto-detection convention)
+
+### Version Bump → 6.1.1
+
+Updated across: `pom.xml`, `application.properties` (×3 fields), `OpenApiConfig.java`, `Dockerfile`, `Chart.yaml`, `eddi-deployment.yaml`, `quickstart.yaml`, `redhat-certify.yml`.
+
+### Docker Base Image
+
+Bumped Red Hat UBI9 OpenJDK 25 runtime digest (`sha256:0f4e04...` → `sha256:2aed9f...`).
+
+### Manager Frontend
+
+Updated `manage.html` asset references to latest EDDI-Manager build. Removed old bundle artifacts (~4,000 lines of obsolete JS/CSS).
+
+**Files changed:** 100 files, +1,107 / −4,041 lines
+
+---
+
## 📦 Safe Dependency Bumps (2026-06-19)
**Repo:** EDDI (`chore/bump-safe-deps`)
diff --git a/helm/eddi/Chart.yaml b/helm/eddi/Chart.yaml
index 2f50262cf..182468d83 100644
--- a/helm/eddi/Chart.yaml
+++ b/helm/eddi/Chart.yaml
@@ -6,7 +6,7 @@ description: >-
and integrate with LLM providers via a unified REST API.
type: application
version: 1.0.0
-appVersion: "6.1.0"
+appVersion: "6.1.1"
home: https://eddi.labs.ai
sources:
- https://github.com/labsai/EDDI
diff --git a/k8s/base/eddi-deployment.yaml b/k8s/base/eddi-deployment.yaml
index 5bf674626..b78d94ee2 100644
--- a/k8s/base/eddi-deployment.yaml
+++ b/k8s/base/eddi-deployment.yaml
@@ -5,7 +5,7 @@ metadata:
name: eddi
labels:
app.kubernetes.io/name: eddi
- app.kubernetes.io/version: "6.1.0"
+ app.kubernetes.io/version: "6.1.1"
app.kubernetes.io/component: server
app.kubernetes.io/part-of: eddi
spec:
@@ -23,7 +23,7 @@ spec:
metadata:
labels:
app.kubernetes.io/name: eddi
- app.kubernetes.io/version: "6.1.0"
+ app.kubernetes.io/version: "6.1.1"
app.kubernetes.io/component: server
app.kubernetes.io/part-of: eddi
annotations:
diff --git a/k8s/quickstart.yaml b/k8s/quickstart.yaml
index 4bf5d554d..19e663b86 100644
--- a/k8s/quickstart.yaml
+++ b/k8s/quickstart.yaml
@@ -169,7 +169,7 @@ metadata:
namespace: eddi
labels:
app.kubernetes.io/name: eddi
- app.kubernetes.io/version: "6.1.0"
+ app.kubernetes.io/version: "6.1.1"
app.kubernetes.io/component: server
app.kubernetes.io/part-of: eddi
spec:
@@ -187,7 +187,7 @@ spec:
metadata:
labels:
app.kubernetes.io/name: eddi
- app.kubernetes.io/version: "6.1.0"
+ app.kubernetes.io/version: "6.1.1"
app.kubernetes.io/component: server
app.kubernetes.io/part-of: eddi
annotations:
diff --git a/pom.xml b/pom.xml
index 48354bb06..3bb31d4f7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
4.0.0
ai.labs
eddi
- 6.1.0
+ 6.1.1
3.15.0
25
diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile
index 168d31066..4dd67c4ee 100644
--- a/src/main/docker/Dockerfile
+++ b/src/main/docker/Dockerfile
@@ -78,10 +78,10 @@
# accessed directly. (example: "foo.example.com,bar.example.com")
#
###
-FROM registry.access.redhat.com/ubi9/openjdk-25-runtime:1.24@sha256:0f4e0418d97fdf5d825b26660f6609ca6760f98ba92a5a31f2208c89270a19d5
+FROM registry.access.redhat.com/ubi9/openjdk-25-runtime:1.24@sha256:2aed9f3a5fac4def355ac36d5c59c7a3067857da424adaa9c6929ff71310467e
### Red Hat Container Certification — required labels
-ARG EDDI_VERSION=6.1.0
+ARG EDDI_VERSION=6.1.1
ARG EDDI_RELEASE=1
LABEL name="labsai/eddi" \
diff --git a/src/main/java/ai/labs/eddi/backup/IRestExportService.java b/src/main/java/ai/labs/eddi/backup/IRestExportService.java
index 133334013..23d697573 100644
--- a/src/main/java/ai/labs/eddi/backup/IRestExportService.java
+++ b/src/main/java/ai/labs/eddi/backup/IRestExportService.java
@@ -17,7 +17,7 @@
* @author ginccc
*/
@Path("/backup/export")
-@Tag(name = "Backup")
+@Tag(name = "Operations / Backup", description = "Import and export agents as zip files")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestExportService {
@GET
diff --git a/src/main/java/ai/labs/eddi/backup/IRestImportService.java b/src/main/java/ai/labs/eddi/backup/IRestImportService.java
index 153a44e51..2d0b0dffc 100644
--- a/src/main/java/ai/labs/eddi/backup/IRestImportService.java
+++ b/src/main/java/ai/labs/eddi/backup/IRestImportService.java
@@ -23,7 +23,7 @@
* @author ginccc
*/
@Path("backup/import")
-@Tag(name = "Backup")
+@Tag(name = "Operations / Backup", description = "Import and export agents as zip files")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestImportService {
@POST
diff --git a/src/main/java/ai/labs/eddi/configs/OpenApiConfig.java b/src/main/java/ai/labs/eddi/configs/OpenApiConfig.java
index d4f95e081..295c45782 100644
--- a/src/main/java/ai/labs/eddi/configs/OpenApiConfig.java
+++ b/src/main/java/ai/labs/eddi/configs/OpenApiConfig.java
@@ -19,32 +19,55 @@
*
* @since 6.0.0
*/
-@OpenAPIDefinition(info = @Info(title = "EDDI API", version = "6.0.0"), tags = {
- @Tag(name = "Agent Setup", description = "One-command agent creation and deployment"),
- @Tag(name = "Conversations", description = "Start, talk to, stream, undo/redo, and manage conversations"),
- @Tag(name = "Group Conversations", description = "Multi-agent group discussion orchestration"),
- @Tag(name = "Conversation Store", description = "Query, delete, and manage conversation history"),
+@OpenAPIDefinition(info = @Info(title = "EDDI API", version = "6.1.1"), tags = {
+ // ── Agents ───────────────────────────────────────────────────────
@Tag(name = "Agents", description = "Agent configuration CRUD"),
- @Tag(name = "Agent Administration", description = "Deploy, undeploy, trigger, and monitor agents"),
- @Tag(name = "Workflows", description = "Workflow pipeline configuration and available steps"),
- @Tag(name = "LLM Configuration", description = "LLM provider and model settings"),
- @Tag(name = "Behavior Rules", description = "Behavior rule evaluation configuration"),
- @Tag(name = "Dictionary", description = "Dictionary, expressions, and actions for NLP"),
- @Tag(name = "Output", description = "Output template configuration and action keys"),
- @Tag(name = "API Calls", description = "HTTP API call definitions for tool use"),
- @Tag(name = "Properties", description = "User property storage and setter configuration"),
- @Tag(name = "Agent Groups", description = "Agent group configuration for multi-agent debates"),
- @Tag(name = "Backup", description = "Import and export agents as zip files"),
- @Tag(name = "Schedules", description = "Scheduled agent triggers (heartbeat, cron)"),
- @Tag(name = "Secrets Vault", description = "Encrypted secret storage and management"),
- @Tag(name = "Tenant Quotas", description = "Per-tenant rate limits and usage metering"),
- @Tag(name = "Audit Trail", description = "Immutable audit ledger queries"),
- @Tag(name = "GDPR / Privacy", description = "User data erasure and export for GDPR/CCPA compliance"),
- @Tag(name = "Coordinator Admin", description = "Conversation coordinator monitoring and dead letters"),
- @Tag(name = "Orphan Admin", description = "Detect and clean up orphaned resources"),
- @Tag(name = "Log Admin", description = "Real-time log streaming and historical queries"),
- @Tag(name = "Descriptors", description = "Cross-resource document descriptor management"),
- @Tag(name = "Standalone NLP", description = "Standalone semantic parser"),
- @Tag(name = "Chat UI", description = "Embedded responsive chat window")})
+ @Tag(name = "Agents / Administration", description = "Deploy, undeploy, trigger, and monitor agents"),
+ @Tag(name = "Agents / Groups", description = "Agent group configuration for multi-agent debates"),
+ @Tag(name = "Agents / Setup", description = "One-command agent creation and deployment"),
+ // ── Configuration ───────────────────────────────────────────────
+ @Tag(name = "Configuration / API Calls", description = "HTTP API call definitions for tool use"),
+ @Tag(name = "Configuration / Behavior Rules", description = "Behavior rule evaluation configuration"),
+ @Tag(name = "Configuration / Dictionary", description = "Dictionary, expressions, and actions for NLP"),
+ @Tag(name = "Configuration / Global Variables", description = "Deployment-wide configuration variables"),
+ @Tag(name = "Configuration / LLM", description = "LLM provider and model settings"),
+ @Tag(name = "Configuration / MCP Calls", description = "MCP server call definitions for tool use"),
+ @Tag(name = "Configuration / Output", description = "Output template configuration and action keys"),
+ @Tag(name = "Configuration / Prompt Snippets", description = "Reusable system prompt building blocks"),
+ @Tag(name = "Configuration / Properties", description = "User property storage and setter configuration"),
+ @Tag(name = "Configuration / Workflows", description = "Workflow pipeline configuration and available steps"),
+ // ── Conversations ───────────────────────────────────────────────
+ @Tag(name = "Conversations", description = "Start, talk to, stream, undo/redo, and manage conversations"),
+ @Tag(name = "Conversations / Attachments", description = "Upload and manage binary conversation attachments"),
+ @Tag(name = "Conversations / Groups", description = "Multi-agent group discussion orchestration"),
+ @Tag(name = "Conversations / Store", description = "Query, delete, and manage conversation history"),
+ // ── Integrations ────────────────────────────────────────────────
+ @Tag(name = "Integrations / A2A Protocol", description = "Agent-to-Agent protocol endpoints"),
+ @Tag(name = "Integrations / Capability Registry", description = "A2A agent capability discovery"),
+ @Tag(name = "Integrations / Channels", description = "Channel integration configuration (Slack, Teams, etc.)"),
+ @Tag(name = "Integrations / Slack Webhook", description = "Slack Events API webhook receiver"),
+ // ── Knowledge ───────────────────────────────────────────────────
+ @Tag(name = "Knowledge / RAG Ingestion", description = "RAG document ingestion and indexing"),
+ @Tag(name = "Knowledge / RAG Stores", description = "RAG knowledge base configuration"),
+ @Tag(name = "Knowledge / User Memory", description = "Persistent user memory management"),
+ // ── Operations ──────────────────────────────────────────────────
+ @Tag(name = "Operations / Backup", description = "Import and export agents as zip files"),
+ @Tag(name = "Operations / Coordinator", description = "Conversation coordinator monitoring and dead letters"),
+ @Tag(name = "Operations / Descriptors", description = "Cross-resource document descriptor management"),
+ @Tag(name = "Operations / Logs", description = "Real-time log streaming and historical queries"),
+ @Tag(name = "Operations / Orphans", description = "Detect and clean up orphaned resources"),
+ @Tag(name = "Operations / Schedules", description = "Scheduled agent triggers (heartbeat, cron)"),
+ // ── Security ────────────────────────────────────────────────────
+ @Tag(name = "Security / Audit Trail", description = "Immutable audit ledger queries"),
+ @Tag(name = "Security / Authentication", description = "Authentication status and session management"),
+ @Tag(name = "Security / GDPR / Privacy", description = "User data erasure and export for GDPR/CCPA compliance"),
+ @Tag(name = "Security / Secrets Vault", description = "Encrypted secret storage and management"),
+ @Tag(name = "Security / Tenant Quotas", description = "Per-tenant rate limits and usage metering"),
+ // ── Tools ───────────────────────────────────────────────────────
+ @Tag(name = "Tools / NLP", description = "Standalone semantic parser"),
+ @Tag(name = "Tools / Template Preview", description = "Preview resolved system prompts with sample data"),
+ @Tag(name = "Tools / Tool History", description = "Tool execution history, cache, rate limits, and cost tracking"),
+ // ── UI ──────────────────────────────────────────────────────────
+ @Tag(name = "UI / Chat", description = "Embedded responsive chat window")})
public class OpenApiConfig {
}
diff --git a/src/main/java/ai/labs/eddi/configs/OpenApiTagSortFilter.java b/src/main/java/ai/labs/eddi/configs/OpenApiTagSortFilter.java
new file mode 100644
index 000000000..fe15d9620
--- /dev/null
+++ b/src/main/java/ai/labs/eddi/configs/OpenApiTagSortFilter.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright EDDI contributors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+package ai.labs.eddi.configs;
+
+import io.quarkus.smallrye.openapi.OpenApiFilter;
+import org.eclipse.microprofile.openapi.OASFilter;
+import org.eclipse.microprofile.openapi.models.OpenAPI;
+
+import java.util.Comparator;
+
+/**
+ * Sorts OpenAPI tags alphabetically at build time, producing a stable,
+ * logically grouped order in Swagger UI and all API consumers.
+ *
+ * @since 6.1.1
+ */
+@OpenApiFilter(OpenApiFilter.RunStage.BUILD)
+public class OpenApiTagSortFilter implements OASFilter {
+
+ @Override
+ public void filterOpenAPI(OpenAPI openAPI) {
+ if (openAPI.getTags() != null) {
+ var sorted = new java.util.ArrayList<>(openAPI.getTags());
+ sorted.sort(Comparator.comparing(
+ org.eclipse.microprofile.openapi.models.tags.Tag::getName));
+ openAPI.setTags(sorted);
+ }
+ }
+}
diff --git a/src/main/java/ai/labs/eddi/configs/admin/IRestOrphanAdmin.java b/src/main/java/ai/labs/eddi/configs/admin/IRestOrphanAdmin.java
index 665a5c3c3..b9519e8f0 100644
--- a/src/main/java/ai/labs/eddi/configs/admin/IRestOrphanAdmin.java
+++ b/src/main/java/ai/labs/eddi/configs/admin/IRestOrphanAdmin.java
@@ -26,7 +26,7 @@
* @since 6.0.0
*/
@Path("/administration/orphans")
-@Tag(name = "Orphan Admin")
+@Tag(name = "Operations / Orphans", description = "Detect and clean up orphaned resources")
@RolesAllowed("eddi-admin")
public interface IRestOrphanAdmin {
diff --git a/src/main/java/ai/labs/eddi/configs/agents/IRestAgentStore.java b/src/main/java/ai/labs/eddi/configs/agents/IRestAgentStore.java
index 70db9833d..67d9b9f00 100644
--- a/src/main/java/ai/labs/eddi/configs/agents/IRestAgentStore.java
+++ b/src/main/java/ai/labs/eddi/configs/agents/IRestAgentStore.java
@@ -23,7 +23,7 @@
* @author ginccc
*/
@Path("/agentstore/agents")
-@Tag(name = "Agents")
+@Tag(name = "Agents", description = "Agent configuration CRUD")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestAgentStore extends IRestVersionInfo {
String resourceURI = "eddi://ai.labs.agent/agentstore/agents/";
diff --git a/src/main/java/ai/labs/eddi/configs/agents/IRestCapabilityRegistry.java b/src/main/java/ai/labs/eddi/configs/agents/IRestCapabilityRegistry.java
index 50c5038b7..9cec5238f 100644
--- a/src/main/java/ai/labs/eddi/configs/agents/IRestCapabilityRegistry.java
+++ b/src/main/java/ai/labs/eddi/configs/agents/IRestCapabilityRegistry.java
@@ -21,7 +21,7 @@
* @since 6.0.0
*/
@Path("/capabilities")
-@Tag(name = "06. Capability Registry", description = "A2A agent capability discovery")
+@Tag(name = "Integrations / Capability Registry", description = "A2A agent capability discovery")
public interface IRestCapabilityRegistry {
@GET
diff --git a/src/main/java/ai/labs/eddi/configs/apicalls/IRestApiCallsStore.java b/src/main/java/ai/labs/eddi/configs/apicalls/IRestApiCallsStore.java
index ad6db555d..253217011 100644
--- a/src/main/java/ai/labs/eddi/configs/apicalls/IRestApiCallsStore.java
+++ b/src/main/java/ai/labs/eddi/configs/apicalls/IRestApiCallsStore.java
@@ -22,7 +22,7 @@
* @author ginccc
*/
@Path("/apicallstore/apicalls")
-@Tag(name = "API Calls")
+@Tag(name = "Configuration / API Calls", description = "HTTP API call definitions for tool use")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestApiCallsStore extends IRestVersionInfo {
String resourceBaseType = "eddi://ai.labs.apicalls";
diff --git a/src/main/java/ai/labs/eddi/configs/channels/IRestChannelIntegrationStore.java b/src/main/java/ai/labs/eddi/configs/channels/IRestChannelIntegrationStore.java
index 4d8471f5b..05e8e6fb4 100644
--- a/src/main/java/ai/labs/eddi/configs/channels/IRestChannelIntegrationStore.java
+++ b/src/main/java/ai/labs/eddi/configs/channels/IRestChannelIntegrationStore.java
@@ -26,7 +26,7 @@
* @since 6.1.0
*/
@Path("/channelstore/channels")
-@Tag(name = "Channel Integrations")
+@Tag(name = "Integrations / Channels", description = "Channel integration configuration (Slack, Teams, etc.)")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestChannelIntegrationStore extends IRestVersionInfo {
String resourceBaseType = "eddi://ai.labs.channel";
diff --git a/src/main/java/ai/labs/eddi/configs/deployment/IRestDeploymentStore.java b/src/main/java/ai/labs/eddi/configs/deployment/IRestDeploymentStore.java
index 21d0f18fb..6e196db9e 100644
--- a/src/main/java/ai/labs/eddi/configs/deployment/IRestDeploymentStore.java
+++ b/src/main/java/ai/labs/eddi/configs/deployment/IRestDeploymentStore.java
@@ -19,7 +19,7 @@
* @author ginccc
*/
@Path("/deploymentstore/deployments")
-@Tag(name = "Agent Administration")
+@Tag(name = "Agents / Administration", description = "Deploy, undeploy, trigger, and monitor agents")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestDeploymentStore {
@GET
diff --git a/src/main/java/ai/labs/eddi/configs/descriptors/IRestDocumentDescriptorStore.java b/src/main/java/ai/labs/eddi/configs/descriptors/IRestDocumentDescriptorStore.java
index 69e2debe4..7d3d7c757 100644
--- a/src/main/java/ai/labs/eddi/configs/descriptors/IRestDocumentDescriptorStore.java
+++ b/src/main/java/ai/labs/eddi/configs/descriptors/IRestDocumentDescriptorStore.java
@@ -20,7 +20,7 @@
* @author ginccc
*/
@Path("/descriptorstore/descriptors")
-@Tag(name = "Descriptors")
+@Tag(name = "Operations / Descriptors", description = "Cross-resource document descriptor management")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestDocumentDescriptorStore {
String DESCRIPTOR_STORE_PATH = "/descriptorstore/descriptors/";
diff --git a/src/main/java/ai/labs/eddi/configs/dictionary/IRestAction.java b/src/main/java/ai/labs/eddi/configs/dictionary/IRestAction.java
index 3a5eddd5a..f332eeaa4 100644
--- a/src/main/java/ai/labs/eddi/configs/dictionary/IRestAction.java
+++ b/src/main/java/ai/labs/eddi/configs/dictionary/IRestAction.java
@@ -15,7 +15,7 @@
* @author ginccc
*/
@Path("/actions")
-@Tag(name = "Dictionary")
+@Tag(name = "Configuration / Dictionary", description = "Dictionary, expressions, and actions for NLP")
public interface IRestAction {
@GET
@Produces(MediaType.APPLICATION_JSON)
diff --git a/src/main/java/ai/labs/eddi/configs/dictionary/IRestDictionaryStore.java b/src/main/java/ai/labs/eddi/configs/dictionary/IRestDictionaryStore.java
index 77b64be5c..96827feec 100644
--- a/src/main/java/ai/labs/eddi/configs/dictionary/IRestDictionaryStore.java
+++ b/src/main/java/ai/labs/eddi/configs/dictionary/IRestDictionaryStore.java
@@ -23,7 +23,7 @@
* @author ginccc
*/
@Path("/dictionarystore/dictionaries")
-@Tag(name = "Dictionary")
+@Tag(name = "Configuration / Dictionary", description = "Dictionary, expressions, and actions for NLP")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestDictionaryStore extends IRestVersionInfo {
String resourceURI = "eddi://ai.labs.dictionary/dictionarystore/dictionaries/";
diff --git a/src/main/java/ai/labs/eddi/configs/dictionary/IRestExpression.java b/src/main/java/ai/labs/eddi/configs/dictionary/IRestExpression.java
index 4a8138545..fd4ed5f44 100644
--- a/src/main/java/ai/labs/eddi/configs/dictionary/IRestExpression.java
+++ b/src/main/java/ai/labs/eddi/configs/dictionary/IRestExpression.java
@@ -15,7 +15,7 @@
* @author ginccc
*/
@Path("/expressions")
-@Tag(name = "Dictionary")
+@Tag(name = "Configuration / Dictionary", description = "Dictionary, expressions, and actions for NLP")
public interface IRestExpression {
@GET
@Produces(MediaType.APPLICATION_JSON)
diff --git a/src/main/java/ai/labs/eddi/configs/groups/IRestAgentGroupStore.java b/src/main/java/ai/labs/eddi/configs/groups/IRestAgentGroupStore.java
index aaf605d3d..eeed6a692 100644
--- a/src/main/java/ai/labs/eddi/configs/groups/IRestAgentGroupStore.java
+++ b/src/main/java/ai/labs/eddi/configs/groups/IRestAgentGroupStore.java
@@ -24,7 +24,7 @@
* @author ginccc
*/
@Path("/groupstore/groups")
-@Tag(name = "Agent Groups")
+@Tag(name = "Agents / Groups", description = "Agent group configuration for multi-agent debates")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestAgentGroupStore extends IRestVersionInfo {
String resourceBaseType = "eddi://ai.labs.group";
diff --git a/src/main/java/ai/labs/eddi/configs/llm/IRestLlmStore.java b/src/main/java/ai/labs/eddi/configs/llm/IRestLlmStore.java
index 114a8e8d4..b64308165 100644
--- a/src/main/java/ai/labs/eddi/configs/llm/IRestLlmStore.java
+++ b/src/main/java/ai/labs/eddi/configs/llm/IRestLlmStore.java
@@ -22,7 +22,7 @@
* @author ginccc
*/
@Path("/llmstore/llms")
-@Tag(name = "LLM Configuration")
+@Tag(name = "Configuration / LLM", description = "LLM provider and model settings")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestLlmStore extends IRestVersionInfo {
String resourceBaseType = "eddi://ai.labs.llm";
diff --git a/src/main/java/ai/labs/eddi/configs/mcpcalls/IRestMcpCallsStore.java b/src/main/java/ai/labs/eddi/configs/mcpcalls/IRestMcpCallsStore.java
index baf9a14ce..6d44e95bd 100644
--- a/src/main/java/ai/labs/eddi/configs/mcpcalls/IRestMcpCallsStore.java
+++ b/src/main/java/ai/labs/eddi/configs/mcpcalls/IRestMcpCallsStore.java
@@ -22,7 +22,7 @@
* JAX-RS interface for MCP Calls configuration store.
*/
@Path("/mcpcallsstore/mcpcalls")
-@Tag(name = "MCP Calls")
+@Tag(name = "Configuration / MCP Calls", description = "MCP server call definitions for tool use")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestMcpCallsStore extends IRestVersionInfo {
String resourceBaseType = "eddi://ai.labs.mcpcalls";
diff --git a/src/main/java/ai/labs/eddi/configs/output/IRestOutputStore.java b/src/main/java/ai/labs/eddi/configs/output/IRestOutputStore.java
index 7e7b8d65a..254e1b988 100644
--- a/src/main/java/ai/labs/eddi/configs/output/IRestOutputStore.java
+++ b/src/main/java/ai/labs/eddi/configs/output/IRestOutputStore.java
@@ -23,7 +23,7 @@
* @author ginccc
*/
@Path("/outputstore/outputsets")
-@Tag(name = "Output")
+@Tag(name = "Configuration / Output", description = "Output template configuration and action keys")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestOutputStore extends IRestVersionInfo {
String resourceBaseType = "eddi://ai.labs.output";
diff --git a/src/main/java/ai/labs/eddi/configs/output/keys/IRestOutputActions.java b/src/main/java/ai/labs/eddi/configs/output/keys/IRestOutputActions.java
index f49cb9222..0d4ceed4e 100644
--- a/src/main/java/ai/labs/eddi/configs/output/keys/IRestOutputActions.java
+++ b/src/main/java/ai/labs/eddi/configs/output/keys/IRestOutputActions.java
@@ -14,7 +14,7 @@
* @author ginccc
*/
@Path("/outputstore/actions")
-@Tag(name = "Output")
+@Tag(name = "Configuration / Output", description = "Output template configuration and action keys")
public interface IRestOutputActions {
@GET
@Produces(MediaType.APPLICATION_JSON)
diff --git a/src/main/java/ai/labs/eddi/configs/parser/IRestParserStore.java b/src/main/java/ai/labs/eddi/configs/parser/IRestParserStore.java
index 613c42e59..d3bed3d3f 100644
--- a/src/main/java/ai/labs/eddi/configs/parser/IRestParserStore.java
+++ b/src/main/java/ai/labs/eddi/configs/parser/IRestParserStore.java
@@ -18,7 +18,7 @@
import java.util.List;
@Path("/parserstore/parsers")
-@Tag(name = "Standalone NLP")
+@Tag(name = "Tools / NLP", description = "Standalone semantic parser")
public interface IRestParserStore extends IRestVersionInfo {
String resourceURI = "eddi://ai.labs.parser/parserstore/parsers/";
diff --git a/src/main/java/ai/labs/eddi/configs/properties/IRestPropertiesStore.java b/src/main/java/ai/labs/eddi/configs/properties/IRestPropertiesStore.java
index 4d746a8dc..b05d1a002 100644
--- a/src/main/java/ai/labs/eddi/configs/properties/IRestPropertiesStore.java
+++ b/src/main/java/ai/labs/eddi/configs/properties/IRestPropertiesStore.java
@@ -13,7 +13,7 @@
import jakarta.ws.rs.core.Response;
@Path("/propertiesstore/properties")
-@Tag(name = "Properties")
+@Tag(name = "Configuration / Properties", description = "User property storage and setter configuration")
public interface IRestPropertiesStore {
String resourceURI = "eddi://ai.labs.properties/propertiesstore/properties/";
diff --git a/src/main/java/ai/labs/eddi/configs/properties/IRestUserMemoryStore.java b/src/main/java/ai/labs/eddi/configs/properties/IRestUserMemoryStore.java
index b68217924..cab01cd2c 100644
--- a/src/main/java/ai/labs/eddi/configs/properties/IRestUserMemoryStore.java
+++ b/src/main/java/ai/labs/eddi/configs/properties/IRestUserMemoryStore.java
@@ -22,7 +22,7 @@
* @since 6.0.0
*/
@Path("/usermemorystore/memories")
-@Tag(name = "User Memory", description = "Persistent user memory management")
+@Tag(name = "Knowledge / User Memory", description = "Persistent user memory management")
@RolesAllowed({"eddi-admin", "eddi-user"})
public interface IRestUserMemoryStore {
diff --git a/src/main/java/ai/labs/eddi/configs/propertysetter/IRestPropertySetterStore.java b/src/main/java/ai/labs/eddi/configs/propertysetter/IRestPropertySetterStore.java
index e63954fa1..5a7066195 100644
--- a/src/main/java/ai/labs/eddi/configs/propertysetter/IRestPropertySetterStore.java
+++ b/src/main/java/ai/labs/eddi/configs/propertysetter/IRestPropertySetterStore.java
@@ -22,7 +22,7 @@
* @author ginccc
*/
@Path("/propertysetterstore/propertysetters")
-@Tag(name = "Properties")
+@Tag(name = "Configuration / Properties", description = "User property storage and setter configuration")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestPropertySetterStore extends IRestVersionInfo {
String resourceBaseType = "eddi://ai.labs.property";
diff --git a/src/main/java/ai/labs/eddi/configs/rag/IRestRagIngestion.java b/src/main/java/ai/labs/eddi/configs/rag/IRestRagIngestion.java
index 82c6e1b8d..3e21cc7fa 100644
--- a/src/main/java/ai/labs/eddi/configs/rag/IRestRagIngestion.java
+++ b/src/main/java/ai/labs/eddi/configs/rag/IRestRagIngestion.java
@@ -18,7 +18,7 @@
* JAX-RS interface for RAG document ingestion.
*/
@Path("/ragstore/rags")
-@Tag(name = "RAG Ingestion")
+@Tag(name = "Knowledge / RAG Ingestion", description = "RAG document ingestion and indexing")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestRagIngestion {
diff --git a/src/main/java/ai/labs/eddi/configs/rag/IRestRagStore.java b/src/main/java/ai/labs/eddi/configs/rag/IRestRagStore.java
index 32f511558..205602ca5 100644
--- a/src/main/java/ai/labs/eddi/configs/rag/IRestRagStore.java
+++ b/src/main/java/ai/labs/eddi/configs/rag/IRestRagStore.java
@@ -22,7 +22,7 @@
* JAX-RS interface for RAG (Knowledge Base) configuration store.
*/
@Path("/ragstore/rags")
-@Tag(name = "RAG Knowledge Bases")
+@Tag(name = "Knowledge / RAG Stores", description = "RAG knowledge base configuration")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestRagStore extends IRestVersionInfo {
String resourceBaseType = "eddi://ai.labs.rag";
diff --git a/src/main/java/ai/labs/eddi/configs/rules/IRestRuleSetStore.java b/src/main/java/ai/labs/eddi/configs/rules/IRestRuleSetStore.java
index b08280164..e22dd439b 100644
--- a/src/main/java/ai/labs/eddi/configs/rules/IRestRuleSetStore.java
+++ b/src/main/java/ai/labs/eddi/configs/rules/IRestRuleSetStore.java
@@ -22,7 +22,7 @@
* @author ginccc
*/
@Path("/rulestore/rulesets")
-@Tag(name = "Behavior Rules")
+@Tag(name = "Configuration / Behavior Rules", description = "Behavior rule evaluation configuration")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestRuleSetStore extends IRestVersionInfo {
String resourceBaseType = "eddi://ai.labs.rules";
diff --git a/src/main/java/ai/labs/eddi/configs/snippets/IRestPromptSnippetStore.java b/src/main/java/ai/labs/eddi/configs/snippets/IRestPromptSnippetStore.java
index a0babdbd7..898e19261 100644
--- a/src/main/java/ai/labs/eddi/configs/snippets/IRestPromptSnippetStore.java
+++ b/src/main/java/ai/labs/eddi/configs/snippets/IRestPromptSnippetStore.java
@@ -28,7 +28,7 @@
* @since 6.0.0
*/
@Path("/snippetstore/snippets")
-@Tag(name = "Prompt Snippets")
+@Tag(name = "Configuration / Prompt Snippets", description = "Reusable system prompt building blocks")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestPromptSnippetStore extends IRestVersionInfo {
String resourceBaseType = "eddi://ai.labs.snippet";
diff --git a/src/main/java/ai/labs/eddi/configs/variables/rest/IRestGlobalVariableStore.java b/src/main/java/ai/labs/eddi/configs/variables/rest/IRestGlobalVariableStore.java
index b175fc425..9ab33ba61 100644
--- a/src/main/java/ai/labs/eddi/configs/variables/rest/IRestGlobalVariableStore.java
+++ b/src/main/java/ai/labs/eddi/configs/variables/rest/IRestGlobalVariableStore.java
@@ -29,7 +29,7 @@
* @since 6.0.0
*/
@Path("/variablestore/variables")
-@Tag(name = "Global Variables")
+@Tag(name = "Configuration / Global Variables", description = "Deployment-wide configuration variables")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestGlobalVariableStore {
diff --git a/src/main/java/ai/labs/eddi/configs/workflows/IRestWorkflowStepStore.java b/src/main/java/ai/labs/eddi/configs/workflows/IRestWorkflowStepStore.java
index e593cdb26..5685275db 100644
--- a/src/main/java/ai/labs/eddi/configs/workflows/IRestWorkflowStepStore.java
+++ b/src/main/java/ai/labs/eddi/configs/workflows/IRestWorkflowStepStore.java
@@ -15,7 +15,7 @@
* @author ginccc
*/
@Path("/extensionstore/extensions")
-@Tag(name = "Workflows")
+@Tag(name = "Configuration / Workflows", description = "Workflow pipeline configuration and available steps")
public interface IRestWorkflowStepStore {
@GET
@Produces(MediaType.APPLICATION_JSON)
diff --git a/src/main/java/ai/labs/eddi/configs/workflows/IRestWorkflowStore.java b/src/main/java/ai/labs/eddi/configs/workflows/IRestWorkflowStore.java
index cbf375b82..7b37e0349 100644
--- a/src/main/java/ai/labs/eddi/configs/workflows/IRestWorkflowStore.java
+++ b/src/main/java/ai/labs/eddi/configs/workflows/IRestWorkflowStore.java
@@ -23,7 +23,7 @@
* @author ginccc
*/
@Path("/workflowstore/workflows")
-@Tag(name = "Workflows")
+@Tag(name = "Configuration / Workflows", description = "Workflow pipeline configuration and available steps")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestWorkflowStore extends IRestVersionInfo {
String resourceURI = "eddi://ai.labs.workflow/workflowstore/workflows/";
diff --git a/src/main/java/ai/labs/eddi/engine/a2a/RestA2AEndpoint.java b/src/main/java/ai/labs/eddi/engine/a2a/RestA2AEndpoint.java
index e5c5d0dcb..aa002a166 100644
--- a/src/main/java/ai/labs/eddi/engine/a2a/RestA2AEndpoint.java
+++ b/src/main/java/ai/labs/eddi/engine/a2a/RestA2AEndpoint.java
@@ -38,6 +38,7 @@
@Path("/")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
+@Tag(name = "Integrations / A2A Protocol", description = "Agent-to-Agent protocol endpoints")
@jakarta.enterprise.context.ApplicationScoped
public class RestA2AEndpoint {
@@ -124,7 +125,7 @@ public Response listA2AAgents() {
@PermitAll
@GET
@Path(".well-known/capabilities")
- @Tag(name = "06. Capability Registry", description = "A2A agent capability discovery")
+ @Tag(name = "Integrations / Capability Registry", description = "A2A agent capability discovery")
@Operation(operationId = "publicSearchCapabilities",
description = "Public endpoint: find agents matching a skill. Requires eddi.a2a.capabilities.public=true.")
public Response searchCapabilities(@QueryParam("skill") String skill,
@@ -153,7 +154,7 @@ public Response searchCapabilities(@QueryParam("skill") String skill,
@PermitAll
@GET
@Path(".well-known/capabilities/skills")
- @Tag(name = "06. Capability Registry", description = "A2A agent capability discovery")
+ @Tag(name = "Integrations / Capability Registry", description = "A2A agent capability discovery")
@Operation(operationId = "publicListSkills",
description = "Public endpoint: list all registered skill names. Requires eddi.a2a.capabilities.public=true.")
public Response listCapabilitySkills() {
diff --git a/src/main/java/ai/labs/eddi/engine/api/ILogoutEndpoint.java b/src/main/java/ai/labs/eddi/engine/api/ILogoutEndpoint.java
index 9d83b86e0..7738166f4 100644
--- a/src/main/java/ai/labs/eddi/engine/api/ILogoutEndpoint.java
+++ b/src/main/java/ai/labs/eddi/engine/api/ILogoutEndpoint.java
@@ -5,6 +5,7 @@
package ai.labs.eddi.engine.api;
import org.eclipse.microprofile.openapi.annotations.Operation;
+import org.eclipse.microprofile.openapi.annotations.tags.Tag;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
@@ -15,6 +16,7 @@
@Path("/user")
@Produces(MediaType.TEXT_PLAIN)
+@Tag(name = "Security / Authentication", description = "Authentication status and session management")
public interface ILogoutEndpoint {
@GET
@Path("/isAuthenticated")
diff --git a/src/main/java/ai/labs/eddi/engine/api/IRestAgentAdministration.java b/src/main/java/ai/labs/eddi/engine/api/IRestAgentAdministration.java
index eee82c702..845b16d9c 100644
--- a/src/main/java/ai/labs/eddi/engine/api/IRestAgentAdministration.java
+++ b/src/main/java/ai/labs/eddi/engine/api/IRestAgentAdministration.java
@@ -23,7 +23,7 @@
* REST API for agent deployment lifecycle management.
*/
@Path("/administration")
-@Tag(name = "Agent Administration")
+@Tag(name = "Agents / Administration", description = "Deploy, undeploy, trigger, and monitor agents")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestAgentAdministration {
@POST
diff --git a/src/main/java/ai/labs/eddi/engine/api/IRestAgentEngine.java b/src/main/java/ai/labs/eddi/engine/api/IRestAgentEngine.java
index 75955b527..0900bd54a 100644
--- a/src/main/java/ai/labs/eddi/engine/api/IRestAgentEngine.java
+++ b/src/main/java/ai/labs/eddi/engine/api/IRestAgentEngine.java
@@ -29,7 +29,7 @@
* only conversationId.
*/
@Path("/agents")
-@Tag(name = "Conversations")
+@Tag(name = "Conversations", description = "Start, talk to, stream, undo/redo, and manage conversations")
@RolesAllowed({"eddi-admin", "eddi-editor", "eddi-user"})
public interface IRestAgentEngine {
diff --git a/src/main/java/ai/labs/eddi/engine/api/IRestAgentEngineStreaming.java b/src/main/java/ai/labs/eddi/engine/api/IRestAgentEngineStreaming.java
index ac34ee0db..43fb40f5b 100644
--- a/src/main/java/ai/labs/eddi/engine/api/IRestAgentEngineStreaming.java
+++ b/src/main/java/ai/labs/eddi/engine/api/IRestAgentEngineStreaming.java
@@ -29,7 +29,7 @@
*
*/
@Path("/agents")
-@Tag(name = "Conversations")
+@Tag(name = "Conversations", description = "Start, talk to, stream, undo/redo, and manage conversations")
@RolesAllowed({"eddi-admin", "eddi-editor", "eddi-user"})
public interface IRestAgentEngineStreaming {
diff --git a/src/main/java/ai/labs/eddi/engine/api/IRestAgentManagement.java b/src/main/java/ai/labs/eddi/engine/api/IRestAgentManagement.java
index ce01750c0..c17704fb6 100644
--- a/src/main/java/ai/labs/eddi/engine/api/IRestAgentManagement.java
+++ b/src/main/java/ai/labs/eddi/engine/api/IRestAgentManagement.java
@@ -23,7 +23,7 @@
* given intent/userId pair.
*/
@Path("/agents/managed")
-@Tag(name = "Conversations")
+@Tag(name = "Conversations", description = "Start, talk to, stream, undo/redo, and manage conversations")
@RolesAllowed({"eddi-admin", "eddi-editor", "eddi-user"})
public interface IRestAgentManagement {
diff --git a/src/main/java/ai/labs/eddi/engine/api/IRestAgentSetup.java b/src/main/java/ai/labs/eddi/engine/api/IRestAgentSetup.java
index 9c3f3ae3f..360be1b02 100644
--- a/src/main/java/ai/labs/eddi/engine/api/IRestAgentSetup.java
+++ b/src/main/java/ai/labs/eddi/engine/api/IRestAgentSetup.java
@@ -19,7 +19,7 @@
* {@link ai.labs.eddi.engine.setup.AgentSetupService}.
*/
@Path("/administration/agents")
-@Tag(name = "Agent Setup")
+@Tag(name = "Agents / Setup", description = "One-command agent creation and deployment")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed("eddi-admin")
diff --git a/src/main/java/ai/labs/eddi/engine/api/IRestCoordinatorAdmin.java b/src/main/java/ai/labs/eddi/engine/api/IRestCoordinatorAdmin.java
index b5d9324f7..71deb6393 100644
--- a/src/main/java/ai/labs/eddi/engine/api/IRestCoordinatorAdmin.java
+++ b/src/main/java/ai/labs/eddi/engine/api/IRestCoordinatorAdmin.java
@@ -25,7 +25,7 @@
* @since 6.0.0
*/
@Path("/administration/coordinator")
-@Tag(name = "Coordinator Admin")
+@Tag(name = "Operations / Coordinator", description = "Conversation coordinator monitoring and dead letters")
@RolesAllowed("eddi-admin")
public interface IRestCoordinatorAdmin {
diff --git a/src/main/java/ai/labs/eddi/engine/api/IRestGroupConversation.java b/src/main/java/ai/labs/eddi/engine/api/IRestGroupConversation.java
index 76246b33c..045cb5f79 100644
--- a/src/main/java/ai/labs/eddi/engine/api/IRestGroupConversation.java
+++ b/src/main/java/ai/labs/eddi/engine/api/IRestGroupConversation.java
@@ -24,7 +24,7 @@
* production environment.
*/
@Path("/groups/{groupId}/conversations")
-@Tag(name = "Group Conversations")
+@Tag(name = "Conversations / Groups", description = "Multi-agent group discussion orchestration")
@RolesAllowed({"eddi-admin", "eddi-editor", "eddi-user"})
public interface IRestGroupConversation {
diff --git a/src/main/java/ai/labs/eddi/engine/api/IRestLogAdmin.java b/src/main/java/ai/labs/eddi/engine/api/IRestLogAdmin.java
index f1b40c2f7..bbdac59c5 100644
--- a/src/main/java/ai/labs/eddi/engine/api/IRestLogAdmin.java
+++ b/src/main/java/ai/labs/eddi/engine/api/IRestLogAdmin.java
@@ -27,7 +27,7 @@
* @since 6.0.0
*/
@Path("/administration/logs")
-@Tag(name = "Log Admin")
+@Tag(name = "Operations / Logs", description = "Real-time log streaming and historical queries")
@RolesAllowed("eddi-admin")
public interface IRestLogAdmin {
diff --git a/src/main/java/ai/labs/eddi/engine/audit/rest/IRestAuditStore.java b/src/main/java/ai/labs/eddi/engine/audit/rest/IRestAuditStore.java
index 2c3faeec1..f43064212 100644
--- a/src/main/java/ai/labs/eddi/engine/audit/rest/IRestAuditStore.java
+++ b/src/main/java/ai/labs/eddi/engine/audit/rest/IRestAuditStore.java
@@ -19,7 +19,7 @@
*/
@Path("/auditstore")
@Produces(MediaType.APPLICATION_JSON)
-@Tag(name = "Audit Trail")
+@Tag(name = "Security / Audit Trail", description = "Immutable audit ledger queries")
@RolesAllowed("eddi-admin")
public interface IRestAuditStore {
diff --git a/src/main/java/ai/labs/eddi/engine/gdpr/IRestGdprAdmin.java b/src/main/java/ai/labs/eddi/engine/gdpr/IRestGdprAdmin.java
index 6a1fa395a..c98ae517d 100644
--- a/src/main/java/ai/labs/eddi/engine/gdpr/IRestGdprAdmin.java
+++ b/src/main/java/ai/labs/eddi/engine/gdpr/IRestGdprAdmin.java
@@ -22,7 +22,7 @@
* @since 6.0.0
*/
@Path("/admin/gdpr")
-@Tag(name = "GDPR / Privacy")
+@Tag(name = "Security / GDPR / Privacy", description = "User data erasure and export for GDPR/CCPA compliance")
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed("eddi-admin")
public interface IRestGdprAdmin {
diff --git a/src/main/java/ai/labs/eddi/engine/memory/rest/IRestConversationStore.java b/src/main/java/ai/labs/eddi/engine/memory/rest/IRestConversationStore.java
index 4fdedc3cd..db223f9dd 100644
--- a/src/main/java/ai/labs/eddi/engine/memory/rest/IRestConversationStore.java
+++ b/src/main/java/ai/labs/eddi/engine/memory/rest/IRestConversationStore.java
@@ -23,7 +23,7 @@
* @author ginccc
*/
@Path("/conversationstore/conversations")
-@Tag(name = "Conversation Store")
+@Tag(name = "Conversations / Store", description = "Query, delete, and manage conversation history")
public interface IRestConversationStore {
@GET
@Produces(MediaType.APPLICATION_JSON)
diff --git a/src/main/java/ai/labs/eddi/engine/memory/rest/RestAttachmentUpload.java b/src/main/java/ai/labs/eddi/engine/memory/rest/RestAttachmentUpload.java
index 3d269f47b..d89a05e91 100644
--- a/src/main/java/ai/labs/eddi/engine/memory/rest/RestAttachmentUpload.java
+++ b/src/main/java/ai/labs/eddi/engine/memory/rest/RestAttachmentUpload.java
@@ -42,7 +42,7 @@
* @since 6.0.0
*/
@Path("/conversations")
-@Tag(name = "Attachments")
+@Tag(name = "Conversations / Attachments", description = "Upload and manage binary conversation attachments")
public class RestAttachmentUpload {
private static final Logger LOGGER = Logger.getLogger(RestAttachmentUpload.class);
diff --git a/src/main/java/ai/labs/eddi/engine/schedule/IRestScheduleStore.java b/src/main/java/ai/labs/eddi/engine/schedule/IRestScheduleStore.java
index dd81d8037..86e66eafb 100644
--- a/src/main/java/ai/labs/eddi/engine/schedule/IRestScheduleStore.java
+++ b/src/main/java/ai/labs/eddi/engine/schedule/IRestScheduleStore.java
@@ -26,7 +26,7 @@
* @since 6.0.0
*/
@Path("/schedulestore/schedules")
-@Tag(name = "Schedules")
+@Tag(name = "Operations / Schedules", description = "Scheduled agent triggers (heartbeat, cron)")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestScheduleStore {
diff --git a/src/main/java/ai/labs/eddi/engine/tenancy/rest/IRestTenantQuota.java b/src/main/java/ai/labs/eddi/engine/tenancy/rest/IRestTenantQuota.java
index 1c0d9a46f..513b770d1 100644
--- a/src/main/java/ai/labs/eddi/engine/tenancy/rest/IRestTenantQuota.java
+++ b/src/main/java/ai/labs/eddi/engine/tenancy/rest/IRestTenantQuota.java
@@ -20,7 +20,7 @@
@Path("/administration/quotas")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
-@Tag(name = "Tenant Quotas")
+@Tag(name = "Security / Tenant Quotas", description = "Per-tenant rate limits and usage metering")
@RolesAllowed("eddi-admin")
public interface IRestTenantQuota {
diff --git a/src/main/java/ai/labs/eddi/engine/triggermanagement/IRestAgentTriggerStore.java b/src/main/java/ai/labs/eddi/engine/triggermanagement/IRestAgentTriggerStore.java
index 5ef986521..e473a691a 100644
--- a/src/main/java/ai/labs/eddi/engine/triggermanagement/IRestAgentTriggerStore.java
+++ b/src/main/java/ai/labs/eddi/engine/triggermanagement/IRestAgentTriggerStore.java
@@ -15,7 +15,7 @@
import java.util.List;
@Path("/AgentTriggerStore/agenttriggers")
-@Tag(name = "Agent Administration")
+@Tag(name = "Agents / Administration", description = "Deploy, undeploy, trigger, and monitor agents")
@RolesAllowed({"eddi-admin", "eddi-editor"})
public interface IRestAgentTriggerStore {
String resourceURI = "eddi://ai.labs.agentTrigger/AgentTriggerStore/agenttriggers/";
diff --git a/src/main/java/ai/labs/eddi/engine/triggermanagement/IRestUserConversationStore.java b/src/main/java/ai/labs/eddi/engine/triggermanagement/IRestUserConversationStore.java
index 3fb16b5b6..13d08546f 100644
--- a/src/main/java/ai/labs/eddi/engine/triggermanagement/IRestUserConversationStore.java
+++ b/src/main/java/ai/labs/eddi/engine/triggermanagement/IRestUserConversationStore.java
@@ -12,7 +12,7 @@
import jakarta.ws.rs.core.Response;
@Path("/userconversationstore/userconversations")
-@Tag(name = "Conversation Store")
+@Tag(name = "Conversations / Store", description = "Query, delete, and manage conversation history")
public interface IRestUserConversationStore {
String resourceURI = "eddi://ai.labs.userconversation/userconversationstore/userconversations/";
diff --git a/src/main/java/ai/labs/eddi/integrations/slack/rest/RestSlackWebhook.java b/src/main/java/ai/labs/eddi/integrations/slack/rest/RestSlackWebhook.java
index f0e67ab20..876d8baf5 100644
--- a/src/main/java/ai/labs/eddi/integrations/slack/rest/RestSlackWebhook.java
+++ b/src/main/java/ai/labs/eddi/integrations/slack/rest/RestSlackWebhook.java
@@ -14,6 +14,7 @@
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
+import org.eclipse.microprofile.openapi.annotations.tags.Tag;
import org.jboss.logging.Logger;
import static ai.labs.eddi.utils.LogSanitizer.sanitize;
@@ -43,6 +44,7 @@
@ApplicationScoped
@Path("/integrations/slack")
@Produces(MediaType.APPLICATION_JSON)
+@Tag(name = "Integrations / Slack Webhook", description = "Slack Events API webhook receiver")
public class RestSlackWebhook {
private static final Logger LOGGER = Logger.getLogger(RestSlackWebhook.class);
diff --git a/src/main/java/ai/labs/eddi/modules/llm/rest/RestToolHistory.java b/src/main/java/ai/labs/eddi/modules/llm/rest/RestToolHistory.java
index 9f0ece5dd..fa88a9a59 100644
--- a/src/main/java/ai/labs/eddi/modules/llm/rest/RestToolHistory.java
+++ b/src/main/java/ai/labs/eddi/modules/llm/rest/RestToolHistory.java
@@ -14,10 +14,12 @@
import ai.labs.eddi.modules.llm.tools.ToolCacheService;
import ai.labs.eddi.modules.llm.tools.ToolCostTracker;
import ai.labs.eddi.modules.llm.tools.ToolRateLimiter;
+import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
+import org.eclipse.microprofile.openapi.annotations.tags.Tag;
import org.jboss.logging.Logger;
import java.util.ArrayList;
@@ -32,6 +34,8 @@
@Path("/llm/tools")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
+@Tag(name = "Tools / Tool History", description = "Tool execution history, cache, rate limits, and cost tracking")
+@ApplicationScoped
public class RestToolHistory {
private static final Logger LOGGER = Logger.getLogger(RestToolHistory.class);
diff --git a/src/main/java/ai/labs/eddi/modules/nlp/IRestSemanticParser.java b/src/main/java/ai/labs/eddi/modules/nlp/IRestSemanticParser.java
index fe3b9cf2b..897efa2c7 100644
--- a/src/main/java/ai/labs/eddi/modules/nlp/IRestSemanticParser.java
+++ b/src/main/java/ai/labs/eddi/modules/nlp/IRestSemanticParser.java
@@ -18,7 +18,7 @@
* Standalone semantic parser endpoint for NLP evaluation.
*/
@Path("/parser")
-@Tag(name = "Standalone NLP")
+@Tag(name = "Tools / NLP", description = "Standalone semantic parser")
public interface IRestSemanticParser {
@POST
diff --git a/src/main/java/ai/labs/eddi/modules/templating/rest/IRestTemplatePreview.java b/src/main/java/ai/labs/eddi/modules/templating/rest/IRestTemplatePreview.java
index 674c69751..e05f2432f 100644
--- a/src/main/java/ai/labs/eddi/modules/templating/rest/IRestTemplatePreview.java
+++ b/src/main/java/ai/labs/eddi/modules/templating/rest/IRestTemplatePreview.java
@@ -21,7 +21,7 @@
* @since 6.0.0
*/
@Path("/administration/preview")
-@Tag(name = "Template Preview")
+@Tag(name = "Tools / Template Preview", description = "Preview resolved system prompts with sample data")
public interface IRestTemplatePreview {
@POST
diff --git a/src/main/java/ai/labs/eddi/secrets/rest/IRestSecretStore.java b/src/main/java/ai/labs/eddi/secrets/rest/IRestSecretStore.java
index ffee3c775..e65c9c92a 100644
--- a/src/main/java/ai/labs/eddi/secrets/rest/IRestSecretStore.java
+++ b/src/main/java/ai/labs/eddi/secrets/rest/IRestSecretStore.java
@@ -25,7 +25,7 @@
* @since 6.0.0
*/
@Path("/secretstore/secrets")
-@Tag(name = "Secrets Vault")
+@Tag(name = "Security / Secrets Vault", description = "Encrypted secret storage and management")
@RolesAllowed("eddi-admin")
public interface IRestSecretStore {
diff --git a/src/main/java/ai/labs/eddi/ui/IRestHtmlChatResource.java b/src/main/java/ai/labs/eddi/ui/IRestHtmlChatResource.java
index 17f938ab6..fe749aed6 100644
--- a/src/main/java/ai/labs/eddi/ui/IRestHtmlChatResource.java
+++ b/src/main/java/ai/labs/eddi/ui/IRestHtmlChatResource.java
@@ -20,7 +20,7 @@
@Path("/chat")
@Produces(MediaType.TEXT_HTML)
-@Tag(name = "Chat UI")
+@Tag(name = "UI / Chat", description = "Embedded responsive chat window")
public interface IRestHtmlChatResource {
@GET
diff --git a/src/main/resources/META-INF/branding/eddi-logo.png b/src/main/resources/META-INF/branding/logo.png
similarity index 100%
rename from src/main/resources/META-INF/branding/eddi-logo.png
rename to src/main/resources/META-INF/branding/logo.png
diff --git a/src/main/resources/META-INF/branding/style.css b/src/main/resources/META-INF/branding/style.css
index 13d73fd68..12f4fc88a 100644
--- a/src/main/resources/META-INF/branding/style.css
+++ b/src/main/resources/META-INF/branding/style.css
@@ -1,6 +1,27 @@
+/* ═══════════════════════════════════════════════════════════════════════════
+ * EDDI Swagger UI Theme
+ * Dual light/dark mode with EDDI brand accents (zinc + amber).
+ *
+ * Dark palette (EDDI Manager):
+ * Primary: #f59e0b (amber-500)
+ * Background: #09090b (zinc-950)
+ * Surface/Card: #18181b (zinc-900)
+ * Border: #27272a (zinc-800)
+ * Foreground: #fafaf9 (stone-50)
+ * Muted text: #a1a1aa (zinc-400)
+ *
+ * Light palette:
+ * Primary: #d97706 (amber-600, darker for contrast)
+ * Background: #ffffff
+ * Surface/Card: #fafaf9 (stone-50)
+ * Border: #e4e4e7 (zinc-200)
+ * Foreground: #18181b (zinc-900)
+ * Muted text: #71717a (zinc-500)
+ * ═══════════════════════════════════════════════════════════════════════════ */
+
+/* ── Reset (both modes) ────────────────────────────────────────────────── */
html {
box-sizing: border-box;
- overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
@@ -12,139 +33,960 @@ html {
body {
margin: 0;
- background: #000;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
+}
+
+/* ══════════════════════════════════════════════════════════════════════════
+ * BRAND ACCENTS — shared between both modes
+ * ══════════════════════════════════════════════════════════════════════════ */
+
+/* ── Logo ──────────────────────────────────────────────────────────────── */
+#swaggerUiLogoLink {
+ max-width: none;
+}
+
+#swaggerUiLogoLink img {
+ max-height: 36px;
+}
+
+#swaggerUiTitleLink {
+ display: none;
+}
+
+/* ── Wrapper max-width ─────────────────────────────────────────────────── */
+.swagger-ui .wrapper {
+ max-width: 1460px;
+}
+
+/* ── Tag Group styling ─────────────────────────────────────────────────── */
+.swagger-ui .opblock-tag-section {
+ margin-bottom: 2px;
+}
+
+.swagger-ui .opblock-tag {
+ text-transform: uppercase;
+ letter-spacing: 0.08em;
+ font-size: 13px;
+ padding: 12px 20px;
+ transition: background-color 0.15s;
+}
+
+.swagger-ui .opblock-tag small {
+ text-transform: none;
+ letter-spacing: normal;
+ font-size: 12px;
+}
+
+/* ── Operation block styling ───────────────────────────────────────────── */
+.swagger-ui .opblock {
+ border-radius: 6px;
+ margin: 0 0 4px;
+}
+
+.swagger-ui .opblock .opblock-summary-method {
+ border-radius: 4px;
+ font-weight: 700;
+ font-size: 12px;
+ min-width: 70px;
+ text-align: center;
+}
+
+/* ── HTTP method colors (both modes) ───────────────────────────────────── */
+.swagger-ui .opblock.opblock-get .opblock-summary-method { background: #3b82f6; }
+.swagger-ui .opblock.opblock-post .opblock-summary-method { background: #22c55e; }
+.swagger-ui .opblock.opblock-put .opblock-summary-method { background: #f59e0b; }
+.swagger-ui .opblock.opblock-delete .opblock-summary-method { background: #ef4444; }
+.swagger-ui .opblock.opblock-patch .opblock-summary-method { background: #a855f7; }
+
+/* ── Input focus accent (both modes) ───────────────────────────────────── */
+.swagger-ui input[type=text]:focus,
+.swagger-ui textarea:focus,
+.swagger-ui select:focus {
+ border-color: #f59e0b;
+ outline: none;
+ box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
+}
+
+/* ── Button shared styling ─────────────────────────────────────────────── */
+.swagger-ui .btn {
+ border-radius: 6px;
+ transition: all 0.2s;
+}
+
+.swagger-ui .btn.cancel {
+ border-color: #ef4444;
+ color: #ef4444;
+}
+
+/* ── Required parameter indicator ──────────────────────────────────────── */
+.swagger-ui .parameter__name.required::after {
+ color: #ef4444;
+}
+
+/* ── Expand arrow hover ────────────────────────────────────────────────── */
+.swagger-ui .expand-methods:hover svg,
+.swagger-ui .expand-operation:hover svg {
+ fill: #f59e0b;
+}
+
+/* ── Errors (both modes) ───────────────────────────────────────────────── */
+.swagger-ui .errors-wrapper {
+ background-color: rgba(239, 68, 68, 0.1);
+ border: 1px solid #ef4444;
+ border-radius: 6px;
+}
+
+.swagger-ui .errors-wrapper h4 {
+ color: #ef4444;
+}
+
+/* ══════════════════════════════════════════════════════════════════════════
+ * LIGHT MODE (default when .dark-mode is NOT set)
+ * ══════════════════════════════════════════════════════════════════════════ */
+
+body {
+ background: #ffffff;
+ color: #18181b;
}
.swagger-ui {
- color: #fff;
+ color: #18181b;
}
+/* ── Topbar (light) ────────────────────────────────────────────────────── */
.swagger-ui .topbar {
- background-color: #000;
+ background-color: #18181b !important;
+ border-bottom: 1px solid #27272a !important;
+ padding: 8px 0;
}
-#footer {
- background-color: #000;
- font-family: sans-serif;
- color: #fff;
- font-size: 70%;
- text-align: center;
+.swagger-ui .topbar .download-url-wrapper .select-label {
+ color: #d4d4d8;
}
-#swaggerUiLogoLink {
- max-width: none;
+.swagger-ui .topbar .download-url-wrapper .select-label select {
+ border-color: #3f3f46;
+ background: #27272a;
+ color: #fafaf9;
}
-#swaggerUiTitleLink {
- display: none;
+.swagger-ui .topbar .download-url-wrapper input[type=text] {
+ border-color: #3f3f46 !important;
+ background: #27272a !important;
+ color: #fafaf9 !important;
+ border-radius: 6px;
}
-.swagger-ui .info {
- background-color: black;
- padding: 50px;
- border-agenttom: 5px solid white;
- color: white;
+.swagger-ui .topbar .download-url-wrapper .download-url-button {
+ background-color: #f59e0b !important;
+ color: #09090b !important;
+ border: 1px solid #f59e0b !important;
+ border-radius: 6px;
+ font-weight: 600;
}
-.swagger-ui .info .description p {
- color: white;
+.swagger-ui .topbar .download-url-wrapper .download-url-button:hover {
+ background-color: #d97706 !important;
+ border-color: #d97706 !important;
}
-.swagger-ui .info .description .markdown {
- color: white;
+.swagger-ui .topbar select {
+ background: #27272a !important;
+ border: 1px solid #3f3f46 !important;
+ color: #fafaf9 !important;
}
-.swagger-ui .scheme-container {
- background-color: rgba(1, 1, 1, 0);
- box-shadow: 0 0 0 0;
+.swagger-ui .topbar input[type=text]:focus {
+ border-color: #f59e0b !important;
+ box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2) !important;
+}
+
+/* ── Info Section (light) ──────────────────────────────────────────────── */
+.swagger-ui .info {
+ background-color: #fafaf9;
+ padding: 36px 48px;
+ border-bottom: 3px solid #d97706;
+ border-radius: 8px;
+ margin: 20px 0 30px;
}
.swagger-ui .info .title {
- color: white;
- letter-spacing: .1em;
+ color: #18181b;
+ letter-spacing: 0.03em;
}
-.swagger-ui .url {
- color: white;
- letter-spacing: .1em;
+.swagger-ui .info .title small {
+ background-color: #d97706 !important;
+ border: none !important;
+ color: #ffffff !important;
+ border-radius: 4px;
+ font-weight: 700;
+}
+
+.swagger-ui .info .title small.version-stamp {
+ background-color: #e4e4e7 !important;
+ color: #71717a !important;
+ border: 1px solid #d4d4d8 !important;
+ font-weight: 400;
+}
+
+.swagger-ui .info .title small pre {
+ color: #ffffff !important;
+}
+
+.swagger-ui .info .title small.version-stamp pre {
+ color: #71717a !important;
+}
+
+.swagger-ui .info .description,
+.swagger-ui .info .description p,
+.swagger-ui .info .description .markdown,
+.swagger-ui .info .description .markdown p {
+ color: #52525b;
}
.swagger-ui .info a {
- color: white;
+ color: #b45309;
+ text-decoration: none;
+ letter-spacing: 0.02em;
+ transition: color 0.2s;
+}
+
+.swagger-ui .info a:hover {
+ color: #d97706;
text-decoration: underline;
- letter-spacing: .1em;
}
-.swagger-ui .schemes-title {
- color: white;
- letter-spacing: .1em;
+.swagger-ui .info .base-url {
+ color: #a1a1aa;
+}
+
+/* ── Scheme Container (light) ──────────────────────────────────────────── */
+.swagger-ui .scheme-container {
+ background-color: transparent !important;
+ box-shadow: none !important;
+ border-bottom: 1px solid #e4e4e7;
+ padding: 15px 0;
+}
+
+/* ── Authorize button (light) ──────────────────────────────────────────── */
+.swagger-ui .btn.authorize {
+ color: #d97706 !important;
+ border-color: #d97706 !important;
+ background: transparent !important;
+}
+
+.swagger-ui .btn.authorize:hover {
+ background: rgba(217, 119, 6, 0.08) !important;
}
+.swagger-ui .btn.authorize svg {
+ fill: #d97706 !important;
+}
+
+/* ── Execute button (light) ────────────────────────────────────────────── */
+.swagger-ui .btn.execute {
+ background-color: #d97706 !important;
+ color: #ffffff !important;
+ border-color: #d97706 !important;
+ font-weight: 600;
+}
+
+.swagger-ui .btn.execute:hover {
+ background-color: #b45309 !important;
+ border-color: #b45309 !important;
+}
+
+/* ── Try-It-Out (light) ────────────────────────────────────────────────── */
+.swagger-ui .try-out__btn {
+ border-color: #d97706;
+ color: #d97706;
+}
+
+.swagger-ui .try-out__btn:hover {
+ background-color: rgba(217, 119, 6, 0.08);
+}
+
+/* ── Tag Groups (light) ────────────────────────────────────────────────── */
.swagger-ui .opblock-tag {
- color: white;
- text-transform: uppercase;
- letter-spacing: .1em;
- border-agenttom: 1px solid #D4BE7D;
+ color: #18181b;
+ border-bottom: 1px solid #e4e4e7 !important;
+}
+
+.swagger-ui .opblock-tag:hover {
+ background-color: rgba(217, 119, 6, 0.04);
}
.swagger-ui .opblock-tag small {
- color: white;
+ color: #71717a;
+}
+
+.swagger-ui .opblock-tag a.nostyle {
+ color: #18181b;
+}
+
+.swagger-ui .opblock-tag svg {
+ fill: #a1a1aa;
+}
+
+/* ── Operations (light) ────────────────────────────────────────────────── */
+.swagger-ui .opblock {
+ border: 1px solid #e4e4e7 !important;
+ background: #ffffff !important;
}
-.swagger-ui .op-block {
- border-radius: 0;
+.swagger-ui .opblock .opblock-summary {
+ border-color: #e4e4e7 !important;
}
.swagger-ui .opblock .opblock-summary-path {
- color: white;
+ color: #18181b;
}
.swagger-ui .opblock .opblock-summary-description {
- color: white;
+ color: #71717a;
}
-.swagger-ui .markdown {
- color: white;
+.swagger-ui .opblock.opblock-get { background: rgba(59, 130, 246, 0.03) !important; border-color: rgba(59, 130, 246, 0.15) !important; }
+.swagger-ui .opblock.opblock-post { background: rgba(34, 197, 94, 0.03) !important; border-color: rgba(34, 197, 94, 0.15) !important; }
+.swagger-ui .opblock.opblock-put { background: rgba(245, 158, 11, 0.03) !important; border-color: rgba(245, 158, 11, 0.15) !important; }
+.swagger-ui .opblock.opblock-delete { background: rgba(239, 68, 68, 0.03) !important; border-color: rgba(239, 68, 68, 0.15) !important; }
+.swagger-ui .opblock.opblock-patch { background: rgba(168, 85, 247, 0.03) !important; border-color: rgba(168, 85, 247, 0.15) !important; }
+
+/* ── Operation Body (light) ────────────────────────────────────────────── */
+.swagger-ui .opblock-body {
+ background: #ffffff;
+}
+
+.swagger-ui .opblock .opblock-section-header {
+ background: #fafaf9;
+ border-bottom: 1px solid #e4e4e7;
+}
+
+.swagger-ui .opblock .opblock-section-header h4 {
+ color: #18181b;
}
-.swagger-ui .markdown p {
- color: white;
+.swagger-ui .opblock .opblock-section-header label {
+ color: #71717a;
}
-.swagger-ui .table-container {
- color: white;
+/* ── Parameters (light) ────────────────────────────────────────────────── */
+.swagger-ui .parameters-col_name,
+.swagger-ui .parameter__name {
+ color: #18181b;
}
+.swagger-ui .parameter__type,
+.swagger-ui .parameter__in {
+ color: #a1a1aa;
+}
+
+.swagger-ui table thead tr td,
+.swagger-ui table thead tr th {
+ color: #71717a !important;
+ border-bottom: 1px solid #e4e4e7 !important;
+}
+
+/* ── Responses (light) ─────────────────────────────────────────────────── */
.swagger-ui .response-col_status {
- color: white;
+ color: #18181b !important;
}
-.swagger-ui .responses-header td {
- color: white;
+.swagger-ui .response-col_description,
+.swagger-ui .responses-header td,
+.swagger-ui .response-col_links {
+ color: #71717a;
}
-.swagger-ui .table-container th {
- color: white;
+.swagger-ui .responses-inner {
+ background: transparent;
}
-.swagger-ui .table-container .parameter__name {
- color: white;
+.swagger-ui .response-control-media-type__accept-message {
+ color: #22c55e;
}
+/* ── Models (light) ────────────────────────────────────────────────────── */
.swagger-ui section.models {
- border: 1px solid #D4BE7D;
- border-radius: 0;
+ border: 1px solid #e4e4e7 !important;
+ border-radius: 6px;
+ background: #fafaf9 !important;
}
.swagger-ui section.models h4 {
- color: white;
+ color: #18181b;
+ border-bottom: 1px solid #e4e4e7;
+}
+
+.swagger-ui section.models h4 svg {
+ fill: #a1a1aa;
}
.swagger-ui section.models .model-container {
- background-color: white;
- border-radius: 0;
+ background-color: #ffffff;
+ border-radius: 6px;
+ margin: 4px 0;
+ border: 1px solid #e4e4e7;
}
.swagger-ui section.models .model-container:hover {
- background-color: whitesmoke;
-}
\ No newline at end of file
+ background-color: #fafaf9;
+}
+
+.swagger-ui .model { color: #71717a; }
+.swagger-ui .model-title { color: #18181b; }
+.swagger-ui .model .property { color: #18181b; }
+.swagger-ui .model .property.primitive { color: #a1a1aa; }
+
+/* ── Inputs (light) ────────────────────────────────────────────────────── */
+.swagger-ui input[type=text],
+.swagger-ui input[type=password],
+.swagger-ui input[type=search],
+.swagger-ui input[type=email],
+.swagger-ui input[type=file],
+.swagger-ui textarea,
+.swagger-ui select {
+ background: #ffffff;
+ color: #18181b;
+ border: 1px solid #d4d4d8;
+ border-radius: 6px;
+}
+
+/* ── Code blocks (light) ───────────────────────────────────────────────── */
+.swagger-ui .opblock-body pre,
+.swagger-ui .highlight-code {
+ background: #fafaf9;
+ color: #18181b;
+ border: 1px solid #e4e4e7;
+ border-radius: 6px;
+}
+
+.swagger-ui .microlight {
+ background: #fafaf9 !important;
+ color: #18181b !important;
+ border-radius: 6px;
+}
+
+.swagger-ui .opblock-body pre.microlight,
+.swagger-ui pre.microlight {
+ background: #fafaf9 !important;
+ color: #18181b !important;
+ border: 1px solid #e4e4e7 !important;
+}
+
+/* ── Markdown (light) ──────────────────────────────────────────────────── */
+.swagger-ui .markdown code,
+.swagger-ui .renderedMarkdown code {
+ background: #e4e4e7;
+ color: #b45309;
+ padding: 2px 6px;
+ border-radius: 4px;
+}
+
+.swagger-ui .opblock-description-wrapper,
+.swagger-ui .opblock-description-wrapper p {
+ color: #71717a;
+}
+
+/* ── Misc (light) ──────────────────────────────────────────────────────── */
+.swagger-ui .copy-to-clipboard {
+ background: #e4e4e7;
+ border: 1px solid #d4d4d8;
+ border-radius: 4px;
+}
+
+.swagger-ui .prop-type { color: #3b82f6; }
+.swagger-ui .prop-format { color: #a1a1aa; }
+
+.swagger-ui .tab li { color: #71717a; }
+.swagger-ui .tab li.active { color: #18181b; }
+.swagger-ui .tab li:first-child::after { background: #e4e4e7; }
+
+.swagger-ui .loading-container .loading::after { color: #71717a; }
+
+.swagger-ui .btn-group .btn {
+ border-color: #d4d4d8;
+ color: #71717a;
+}
+
+.swagger-ui .url {
+ color: #a1a1aa;
+ letter-spacing: 0.02em;
+}
+
+.swagger-ui .content-type {
+ background: #ffffff;
+ color: #18181b;
+ border: 1px solid #d4d4d8;
+}
+
+.swagger-ui .expand-methods svg,
+.swagger-ui .expand-operation svg {
+ fill: #a1a1aa;
+ transition: fill 0.15s;
+}
+
+.swagger-ui a { color: #b45309; }
+.swagger-ui a:hover { color: #d97706; }
+
+.swagger-ui,
+.swagger-ui label,
+.swagger-ui .info .title,
+.swagger-ui .opblock-tag {
+ color: #18181b;
+}
+
+/* ── Dialog (light) ────────────────────────────────────────────────────── */
+.swagger-ui .dialog-ux .modal-ux {
+ background: #ffffff;
+ border: 1px solid #e4e4e7;
+ color: #18181b;
+ border-radius: 8px;
+}
+
+.swagger-ui .dialog-ux .modal-ux-header {
+ border-bottom: 1px solid #e4e4e7;
+}
+
+.swagger-ui .dialog-ux .modal-ux-header h3 { color: #18181b; }
+.swagger-ui .dialog-ux .modal-ux-content { color: #52525b; }
+.swagger-ui .dialog-ux .modal-ux-content p { color: #52525b; }
+.swagger-ui .dialog-ux .backdrop-ux { background: rgba(0, 0, 0, 0.4); }
+
+.swagger-ui .auth-wrapper { color: #18181b; }
+.swagger-ui .auth-wrapper .auth-btn-wrapper .btn-done {
+ color: #d97706;
+ border-color: #d97706;
+}
+.swagger-ui .auth-wrapper input { color: #18181b; }
+
+/* ── Footer (light) ────────────────────────────────────────────────────── */
+#footer {
+ background-color: #fafaf9;
+ border-top: 1px solid #e4e4e7;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
+ color: #a1a1aa;
+ font-size: 12px;
+ text-align: center;
+ padding: 16px 0;
+}
+
+/* ══════════════════════════════════════════════════════════════════════════
+ * DARK MODE — activated when Swagger UI toggle adds .dark-mode to
+ * ══════════════════════════════════════════════════════════════════════════ */
+
+html.dark-mode body {
+ background: #09090b;
+ color: #fafaf9;
+}
+
+html.dark-mode .swagger-ui {
+ color: #fafaf9;
+ background-color: #09090b !important;
+}
+
+html.dark-mode .swagger-ui .wrapper {
+ background-color: #09090b !important;
+}
+
+html.dark-mode .swagger-ui,
+html.dark-mode .swagger-ui label,
+html.dark-mode .swagger-ui .info .title,
+html.dark-mode .swagger-ui .opblock-tag {
+ color: #fafaf9;
+}
+
+/* ── Topbar (dark) ─────────────────────────────────────────────────────── */
+html.dark-mode .swagger-ui .topbar {
+ background-color: #000000 !important;
+ border-bottom: 1px solid #3f3f46 !important;
+}
+
+html.dark-mode .swagger-ui .topbar .download-url-wrapper .select-label {
+ color: #a1a1aa;
+}
+
+html.dark-mode .swagger-ui .topbar .download-url-wrapper .select-label select {
+ border-color: #27272a;
+ background: #18181b;
+ color: #fafaf9;
+}
+
+html.dark-mode .swagger-ui .topbar .download-url-wrapper input[type=text] {
+ border-color: #27272a !important;
+ background: #18181b !important;
+ color: #fafaf9 !important;
+}
+
+html.dark-mode .swagger-ui .topbar select {
+ background: #18181b !important;
+ border: 1px solid #27272a !important;
+ color: #fafaf9 !important;
+}
+
+/* ── Info Section (dark) ───────────────────────────────────────────────── */
+html.dark-mode .swagger-ui .info {
+ background-color: #18181b !important;
+ border-bottom: 3px solid #f59e0b !important;
+}
+
+html.dark-mode .swagger-ui .info .title {
+ color: #fafaf9;
+}
+
+html.dark-mode .swagger-ui .info .title small {
+ background-color: #f59e0b !important;
+ color: #09090b !important;
+}
+
+html.dark-mode .swagger-ui .info .title small.version-stamp {
+ background-color: #27272a !important;
+ color: #a1a1aa !important;
+ border: 1px solid #3f3f46 !important;
+}
+
+html.dark-mode .swagger-ui .info .title small pre {
+ color: #09090b !important;
+}
+
+html.dark-mode .swagger-ui .info .title small.version-stamp pre {
+ color: #a1a1aa !important;
+}
+
+html.dark-mode .swagger-ui .info .description,
+html.dark-mode .swagger-ui .info .description p,
+html.dark-mode .swagger-ui .info .description .markdown,
+html.dark-mode .swagger-ui .info .description .markdown p {
+ color: #a1a1aa;
+}
+
+html.dark-mode .swagger-ui .info a {
+ color: #fbbf24;
+}
+
+html.dark-mode .swagger-ui .info a:hover {
+ color: #f59e0b;
+}
+
+html.dark-mode .swagger-ui .info .base-url {
+ color: #71717a;
+}
+
+/* ── Scheme Container (dark) ───────────────────────────────────────────── */
+html.dark-mode .swagger-ui .scheme-container {
+ border-bottom-color: #27272a;
+}
+
+html.dark-mode .swagger-ui .schemes-title {
+ color: #a1a1aa;
+}
+
+/* ── Authorize button (dark) ───────────────────────────────────────────── */
+html.dark-mode .swagger-ui .btn.authorize {
+ color: #f59e0b !important;
+ border-color: #f59e0b !important;
+}
+
+html.dark-mode .swagger-ui .btn.authorize:hover {
+ background: rgba(245, 158, 11, 0.1) !important;
+}
+
+html.dark-mode .swagger-ui .btn.authorize svg {
+ fill: #f59e0b !important;
+}
+
+/* ── Execute button (dark) ─────────────────────────────────────────────── */
+html.dark-mode .swagger-ui .btn.execute {
+ background-color: #f59e0b !important;
+ color: #09090b !important;
+ border-color: #f59e0b !important;
+}
+
+html.dark-mode .swagger-ui .btn.execute:hover {
+ background-color: #d97706 !important;
+ border-color: #d97706 !important;
+}
+
+/* ── Try-It-Out (dark) ─────────────────────────────────────────────────── */
+html.dark-mode .swagger-ui .try-out__btn {
+ border-color: #f59e0b;
+ color: #f59e0b;
+}
+
+html.dark-mode .swagger-ui .try-out__btn:hover {
+ background-color: rgba(245, 158, 11, 0.1);
+}
+
+/* ── Tag Groups (dark) ─────────────────────────────────────────────────── */
+html.dark-mode .swagger-ui .opblock-tag {
+ color: #d4d4d8;
+ border-bottom-color: #27272a !important;
+}
+
+html.dark-mode .swagger-ui .opblock-tag:hover {
+ background-color: rgba(245, 158, 11, 0.05);
+}
+
+html.dark-mode .swagger-ui .opblock-tag small {
+ color: #71717a;
+}
+
+html.dark-mode .swagger-ui .opblock-tag a.nostyle {
+ color: #d4d4d8;
+}
+
+html.dark-mode .swagger-ui .opblock-tag svg {
+ fill: #71717a;
+}
+
+/* ── Operations (dark) ─────────────────────────────────────────────────── */
+html.dark-mode .swagger-ui .opblock {
+ border: 1px solid #27272a !important;
+ background: #18181b !important;
+}
+
+html.dark-mode .swagger-ui .opblock .opblock-summary {
+ border-bottom: 1px solid #27272a !important;
+}
+
+html.dark-mode .swagger-ui .opblock .opblock-summary-path,
+html.dark-mode .swagger-ui .opblock .opblock-summary-path span {
+ color: #fafaf9;
+}
+
+html.dark-mode .swagger-ui .opblock .opblock-summary-description {
+ color: #a1a1aa;
+}
+
+html.dark-mode .swagger-ui .opblock.opblock-get { background: rgba(59, 130, 246, 0.06) !important; border-color: rgba(59, 130, 246, 0.2) !important; }
+html.dark-mode .swagger-ui .opblock.opblock-post { background: rgba(34, 197, 94, 0.06) !important; border-color: rgba(34, 197, 94, 0.2) !important; }
+html.dark-mode .swagger-ui .opblock.opblock-put { background: rgba(245, 158, 11, 0.06) !important; border-color: rgba(245, 158, 11, 0.2) !important; }
+html.dark-mode .swagger-ui .opblock.opblock-delete { background: rgba(239, 68, 68, 0.06) !important; border-color: rgba(239, 68, 68, 0.2) !important; }
+html.dark-mode .swagger-ui .opblock.opblock-patch { background: rgba(168, 85, 247, 0.06) !important; border-color: rgba(168, 85, 247, 0.2) !important; }
+
+html.dark-mode .swagger-ui .opblock.opblock-get .opblock-summary { border-color: rgba(59, 130, 246, 0.15) !important; }
+html.dark-mode .swagger-ui .opblock.opblock-post .opblock-summary { border-color: rgba(34, 197, 94, 0.15) !important; }
+html.dark-mode .swagger-ui .opblock.opblock-put .opblock-summary { border-color: rgba(245, 158, 11, 0.15) !important; }
+html.dark-mode .swagger-ui .opblock.opblock-delete .opblock-summary { border-color: rgba(239, 68, 68, 0.15) !important; }
+html.dark-mode .swagger-ui .opblock.opblock-patch .opblock-summary { border-color: rgba(168, 85, 247, 0.15) !important; }
+
+/* ── Operation Body (dark) ─────────────────────────────────────────────── */
+html.dark-mode .swagger-ui .opblock-body {
+ background: #18181b;
+}
+
+html.dark-mode .swagger-ui .opblock-body pre {
+ background: #09090b;
+ color: #fafaf9;
+ border: 1px solid #27272a;
+ border-radius: 6px;
+}
+
+html.dark-mode .swagger-ui .opblock-body pre span {
+ color: #fafaf9 !important;
+}
+
+html.dark-mode .swagger-ui .opblock-description-wrapper,
+html.dark-mode .swagger-ui .opblock-description-wrapper p {
+ color: #a1a1aa;
+}
+
+html.dark-mode .swagger-ui .opblock .opblock-section-header {
+ background: rgba(39, 39, 42, 0.5);
+ border-bottom: 1px solid #27272a;
+}
+
+html.dark-mode .swagger-ui .opblock .opblock-section-header h4 {
+ color: #fafaf9;
+}
+
+html.dark-mode .swagger-ui .opblock .opblock-section-header label {
+ color: #a1a1aa;
+}
+
+/* ── Parameters (dark) ─────────────────────────────────────────────────── */
+html.dark-mode .swagger-ui .parameters-col_name,
+html.dark-mode .swagger-ui .parameter__name {
+ color: #fafaf9;
+}
+
+html.dark-mode .swagger-ui .parameter__type,
+html.dark-mode .swagger-ui .parameter__in {
+ color: #71717a;
+}
+
+html.dark-mode .swagger-ui table thead tr td,
+html.dark-mode .swagger-ui table thead tr th {
+ color: #a1a1aa !important;
+ border-bottom-color: #27272a !important;
+}
+
+html.dark-mode .swagger-ui .table-container {
+ color: #fafaf9;
+}
+
+/* ── Responses (dark) ──────────────────────────────────────────────────── */
+html.dark-mode .swagger-ui .response-col_status {
+ color: #fafaf9 !important;
+}
+
+html.dark-mode .swagger-ui .response-col_description,
+html.dark-mode .swagger-ui .responses-header td,
+html.dark-mode .swagger-ui .response-col_links {
+ color: #a1a1aa;
+}
+
+html.dark-mode .swagger-ui .responses-table {
+ border-top: 1px solid #27272a;
+}
+
+/* ── Models (dark) ─────────────────────────────────────────────────────── */
+html.dark-mode .swagger-ui section.models {
+ border: 1px solid #27272a !important;
+ background: #18181b !important;
+}
+
+html.dark-mode .swagger-ui section.models h4 {
+ color: #fafaf9;
+ border-bottom: 1px solid #27272a;
+}
+
+html.dark-mode .swagger-ui section.models h4 svg {
+ fill: #71717a;
+}
+
+html.dark-mode .swagger-ui section.models .model-container {
+ background-color: #09090b;
+ border: 1px solid #27272a;
+}
+
+html.dark-mode .swagger-ui section.models .model-container:hover {
+ background-color: #18181b;
+}
+
+html.dark-mode .swagger-ui .model { color: #a1a1aa; }
+html.dark-mode .swagger-ui .model-title { color: #fafaf9; }
+html.dark-mode .swagger-ui .model .property { color: #fafaf9; }
+html.dark-mode .swagger-ui .model .property.primitive { color: #71717a; }
+
+/* ── Inputs (dark) ─────────────────────────────────────────────────────── */
+html.dark-mode .swagger-ui input[type=text],
+html.dark-mode .swagger-ui input[type=password],
+html.dark-mode .swagger-ui input[type=search],
+html.dark-mode .swagger-ui input[type=email],
+html.dark-mode .swagger-ui input[type=file],
+html.dark-mode .swagger-ui textarea,
+html.dark-mode .swagger-ui select {
+ background: #09090b;
+ color: #fafaf9;
+ border: 1px solid #27272a;
+ border-radius: 6px;
+}
+
+/* ── Code blocks (dark) ────────────────────────────────────────────────── */
+html.dark-mode .swagger-ui .highlight-code {
+ background: #09090b;
+ border-radius: 6px;
+}
+
+html.dark-mode .swagger-ui .microlight {
+ background: #09090b !important;
+ color: #fafaf9 !important;
+ border-radius: 6px;
+}
+
+html.dark-mode .swagger-ui .opblock-body pre.microlight,
+html.dark-mode .swagger-ui pre.microlight {
+ background: #09090b !important;
+ color: #fafaf9 !important;
+ border: 1px solid #27272a !important;
+}
+
+/* ── Markdown (dark) ───────────────────────────────────────────────────── */
+html.dark-mode .swagger-ui .markdown,
+html.dark-mode .swagger-ui .markdown p,
+html.dark-mode .swagger-ui .renderedMarkdown,
+html.dark-mode .swagger-ui .renderedMarkdown p {
+ color: #a1a1aa;
+}
+
+html.dark-mode .swagger-ui .markdown code,
+html.dark-mode .swagger-ui .renderedMarkdown code {
+ background: #27272a;
+ color: #fbbf24;
+}
+
+/* ── Misc (dark) ───────────────────────────────────────────────────────── */
+html.dark-mode .swagger-ui .copy-to-clipboard {
+ background: #27272a;
+ border: 1px solid #3f3f46;
+}
+
+html.dark-mode .swagger-ui .content-type {
+ background: #09090b;
+ color: #fafaf9;
+ border: 1px solid #27272a;
+}
+
+html.dark-mode .swagger-ui .expand-methods svg,
+html.dark-mode .swagger-ui .expand-operation svg {
+ fill: #71717a;
+}
+
+html.dark-mode .swagger-ui .tab li { color: #a1a1aa; }
+html.dark-mode .swagger-ui .tab li.active { color: #fafaf9; }
+html.dark-mode .swagger-ui .tab li:first-child::after { background: #27272a; }
+
+html.dark-mode .swagger-ui .loading-container .loading::after { color: #a1a1aa; }
+
+html.dark-mode .swagger-ui .btn-group .btn {
+ border-color: #27272a;
+ color: #a1a1aa;
+}
+
+html.dark-mode .swagger-ui .url { color: #71717a; }
+
+html.dark-mode .swagger-ui .model-box {
+ background: #09090b;
+ border-radius: 6px;
+}
+
+html.dark-mode .swagger-ui a { color: #fbbf24; }
+html.dark-mode .swagger-ui a:hover { color: #f59e0b; }
+
+/* ── Dialog (dark) ─────────────────────────────────────────────────────── */
+html.dark-mode .swagger-ui .dialog-ux .modal-ux {
+ background: #18181b;
+ border: 1px solid #27272a;
+ color: #fafaf9;
+}
+
+html.dark-mode .swagger-ui .dialog-ux .modal-ux-header {
+ border-bottom: 1px solid #27272a;
+}
+
+html.dark-mode .swagger-ui .dialog-ux .modal-ux-header h3 { color: #fafaf9; }
+html.dark-mode .swagger-ui .dialog-ux .modal-ux-content { color: #a1a1aa; }
+html.dark-mode .swagger-ui .dialog-ux .modal-ux-content p { color: #a1a1aa; }
+html.dark-mode .swagger-ui .dialog-ux .backdrop-ux { background: rgba(9, 9, 11, 0.8); }
+
+html.dark-mode .swagger-ui .auth-wrapper { color: #fafaf9; }
+html.dark-mode .swagger-ui .auth-wrapper .auth-btn-wrapper .btn-done {
+ color: #f59e0b;
+ border-color: #f59e0b;
+}
+html.dark-mode .swagger-ui .auth-wrapper input { color: #fafaf9; }
+
+/* ── Footer (dark) ─────────────────────────────────────────────────────── */
+html.dark-mode #footer {
+ background-color: #09090b;
+ border-top: 1px solid #27272a;
+ color: #71717a;
+}
+
+/* ── Scrollbar (dark, Webkit) ──────────────────────────────────────────── */
+html.dark-mode ::-webkit-scrollbar { width: 8px; height: 8px; }
+html.dark-mode ::-webkit-scrollbar-track { background: #09090b; }
+html.dark-mode ::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 4px; }
+html.dark-mode ::-webkit-scrollbar-thumb:hover { background: #52525b; }
\ No newline at end of file
diff --git a/src/main/resources/META-INF/resources/assets/cssMode-CRRdssKx.js b/src/main/resources/META-INF/resources/assets/cssMode-CRRdssKx.js
deleted file mode 100644
index 4a4cd0692..000000000
--- a/src/main/resources/META-INF/resources/assets/cssMode-CRRdssKx.js
+++ /dev/null
@@ -1 +0,0 @@
-import{c,l as s}from"./index-Cfhvosw6.js";import{C as h,H as u,D as p,a as m,R as f,b as _,c as w,d as k,F as v,e as D,S as P,f as R,g as I}from"./lspLanguageFeatures-CWMiI3_8.js";import{h as b,i as H,j as y,t as U,k as T}from"./lspLanguageFeatures-CWMiI3_8.js";const C=120*1e3;class A{constructor(o){this._defaults=o,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>C&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=c({moduleId:"vs/language/css/cssWorker",createWorker:()=>new Worker(new URL("/assets/css.worker-B4z49cGk.js",import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...o){let e;return this._getClient().then(a=>{e=a}).then(a=>{if(this._worker)return this._worker.withSyncedResources(o)}).then(a=>e)}}function F(n){const o=[],e=[],a=new A(n);o.push(a);const r=(...t)=>a.getLanguageServiceWorker(...t);function l(){const{languageId:t,modeConfiguration:i}=n;g(e),i.completionItems&&e.push(s.registerCompletionItemProvider(t,new h(r,["/","-",":"]))),i.hovers&&e.push(s.registerHoverProvider(t,new u(r))),i.documentHighlights&&e.push(s.registerDocumentHighlightProvider(t,new p(r))),i.definitions&&e.push(s.registerDefinitionProvider(t,new m(r))),i.references&&e.push(s.registerReferenceProvider(t,new f(r))),i.documentSymbols&&e.push(s.registerDocumentSymbolProvider(t,new _(r))),i.rename&&e.push(s.registerRenameProvider(t,new w(r))),i.colors&&e.push(s.registerColorProvider(t,new k(r))),i.foldingRanges&&e.push(s.registerFoldingRangeProvider(t,new v(r))),i.diagnostics&&e.push(new D(t,r,n.onDidChange)),i.selectionRanges&&e.push(s.registerSelectionRangeProvider(t,new P(r))),i.documentFormattingEdits&&e.push(s.registerDocumentFormattingEditProvider(t,new R(r))),i.documentRangeFormattingEdits&&e.push(s.registerDocumentRangeFormattingEditProvider(t,new I(r)))}return l(),o.push(d(e)),d(o)}function d(n){return{dispose:()=>g(n)}}function g(n){for(;n.length;)n.pop().dispose()}export{h as CompletionAdapter,m as DefinitionAdapter,D as DiagnosticsAdapter,k as DocumentColorAdapter,R as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,b as DocumentLinkAdapter,I as DocumentRangeFormattingEditProvider,_ as DocumentSymbolAdapter,v as FoldingRangeAdapter,u as HoverAdapter,f as ReferenceAdapter,w as RenameAdapter,P as SelectionRangeAdapter,A as WorkerManager,H as fromPosition,y as fromRange,F as setupMode,U as toRange,T as toTextEdit};
diff --git a/src/main/resources/META-INF/resources/assets/cssMode-DMPmy9yy.js b/src/main/resources/META-INF/resources/assets/cssMode-DMPmy9yy.js
deleted file mode 100644
index 755b51fa6..000000000
--- a/src/main/resources/META-INF/resources/assets/cssMode-DMPmy9yy.js
+++ /dev/null
@@ -1 +0,0 @@
-import{c,l as s}from"./index-BFi5BZ7U.js";import{C as h,H as u,D as p,a as m,R as f,b as _,c as w,d as k,F as v,e as D,S as P,f as R,g as I}from"./lspLanguageFeatures-CjZ9t0R-.js";import{h as b,i as H,j as y,t as U,k as T}from"./lspLanguageFeatures-CjZ9t0R-.js";const C=120*1e3;class A{constructor(o){this._defaults=o,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>C&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=c({moduleId:"vs/language/css/cssWorker",createWorker:()=>new Worker(new URL("/assets/css.worker-B4z49cGk.js",import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...o){let e;return this._getClient().then(a=>{e=a}).then(a=>{if(this._worker)return this._worker.withSyncedResources(o)}).then(a=>e)}}function F(n){const o=[],e=[],a=new A(n);o.push(a);const r=(...t)=>a.getLanguageServiceWorker(...t);function l(){const{languageId:t,modeConfiguration:i}=n;g(e),i.completionItems&&e.push(s.registerCompletionItemProvider(t,new h(r,["/","-",":"]))),i.hovers&&e.push(s.registerHoverProvider(t,new u(r))),i.documentHighlights&&e.push(s.registerDocumentHighlightProvider(t,new p(r))),i.definitions&&e.push(s.registerDefinitionProvider(t,new m(r))),i.references&&e.push(s.registerReferenceProvider(t,new f(r))),i.documentSymbols&&e.push(s.registerDocumentSymbolProvider(t,new _(r))),i.rename&&e.push(s.registerRenameProvider(t,new w(r))),i.colors&&e.push(s.registerColorProvider(t,new k(r))),i.foldingRanges&&e.push(s.registerFoldingRangeProvider(t,new v(r))),i.diagnostics&&e.push(new D(t,r,n.onDidChange)),i.selectionRanges&&e.push(s.registerSelectionRangeProvider(t,new P(r))),i.documentFormattingEdits&&e.push(s.registerDocumentFormattingEditProvider(t,new R(r))),i.documentRangeFormattingEdits&&e.push(s.registerDocumentRangeFormattingEditProvider(t,new I(r)))}return l(),o.push(d(e)),d(o)}function d(n){return{dispose:()=>g(n)}}function g(n){for(;n.length;)n.pop().dispose()}export{h as CompletionAdapter,m as DefinitionAdapter,D as DiagnosticsAdapter,k as DocumentColorAdapter,R as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,b as DocumentLinkAdapter,I as DocumentRangeFormattingEditProvider,_ as DocumentSymbolAdapter,v as FoldingRangeAdapter,u as HoverAdapter,f as ReferenceAdapter,w as RenameAdapter,P as SelectionRangeAdapter,A as WorkerManager,H as fromPosition,y as fromRange,F as setupMode,U as toRange,T as toTextEdit};
diff --git a/src/main/resources/META-INF/resources/assets/freemarker2-Dl3FuCzB.js b/src/main/resources/META-INF/resources/assets/freemarker2-Dl3FuCzB.js
deleted file mode 100644
index 35ae16730..000000000
--- a/src/main/resources/META-INF/resources/assets/freemarker2-Dl3FuCzB.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import{l as c}from"./index-BFi5BZ7U.js";const s=["assign","flush","ftl","return","global","import","include","break","continue","local","nested","nt","setting","stop","t","lt","rt","fallback"],d=["attempt","autoesc","autoEsc","compress","comment","escape","noescape","function","if","list","items","sep","macro","noparse","noParse","noautoesc","noAutoEsc","outputformat","switch","visit","recurse"],a={close:">",id:"angle",open:"<"},r={close:"\\]",id:"bracket",open:"\\["},F={close:"[>\\]]",id:"auto",open:"[<\\[]"},k={close:"\\}",id:"dollar",open1:"\\$",open2:"\\{"},p={close:"\\]",id:"bracket",open1:"\\[",open2:"="};function l(t){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],comments:{blockComment:[`${t.open}--`,`--${t.close}`]},autoCloseBefore:`
-\r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`${t.open}#(?:${d.join("|")})([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),end:new RegExp(`${t.open}/#(?:${d.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`${t.open}#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),afterText:new RegExp(`^${t.open}/#([a-zA-Z_]+)[\\r\\n\\t ]*${t.close}$`),action:{indentAction:c.IndentAction.IndentOutdent}},{beforeText:new RegExp(`${t.open}#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),action:{indentAction:c.IndentAction.Indent}}]}}function g(){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],autoCloseBefore:`
-\r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`[<\\[]#(?:${d.join("|")})([^/>\\]]*(?!/)[>\\]])[^<\\[]*$`),end:new RegExp(`[<\\[]/#(?:${d.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`[<\\[]#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),afterText:new RegExp("^[<\\[]/#([a-zA-Z_]+)[\\r\\n\\t ]*[>\\]]$"),action:{indentAction:c.IndentAction.IndentOutdent}},{beforeText:new RegExp(`[<\\[]#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),action:{indentAction:c.IndentAction.Indent}}]}}function _(t,n){const i=`_${t.id}_${n.id}`,e=u=>u.replace(/__id__/g,i),o=u=>{const m=u.source.replace(/__id__/g,i);return new RegExp(m,u.flags)};return{unicode:!0,includeLF:!1,start:e("default__id__"),ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],[e("open__id__")]:new RegExp(t.open),[e("close__id__")]:new RegExp(t.close),[e("iOpen1__id__")]:new RegExp(n.open1),[e("iOpen2__id__")]:new RegExp(n.open2),[e("iClose__id__")]:new RegExp(n.close),[e("startTag__id__")]:o(/(@open__id__)(#)/),[e("endTag__id__")]:o(/(@open__id__)(\/#)/),[e("startOrEndTag__id__")]:o(/(@open__id__)(\/?#)/),[e("closeTag1__id__")]:o(/((?:@blank)*)(@close__id__)/),[e("closeTag2__id__")]:o(/((?:@blank)*\/?)(@close__id__)/),blank:/[ \t\n\r]/,keywords:["false","true","in","as","using"],directiveStartCloseTag1:/attempt|recover|sep|auto[eE]sc|no(?:autoe|AutoE)sc|compress|default|no[eE]scape|comment|no[pP]arse/,directiveStartCloseTag2:/else|break|continue|return|stop|flush|t|lt|rt|nt|nested|recurse|fallback|ftl/,directiveStartBlank:/if|else[iI]f|list|for[eE]ach|switch|case|assign|global|local|include|import|function|macro|transform|visit|stop|return|call|setting|output[fF]ormat|nested|recurse|escape|ftl|items/,directiveEndCloseTag1:/if|list|items|sep|recover|attempt|for[eE]ach|local|global|assign|function|macro|output[fF]ormat|auto[eE]sc|no(?:autoe|AutoE)sc|compress|transform|switch|escape|no[eE]scape/,escapedChar:/\\(?:[ntrfbgla\\'"\{=]|(?:x[0-9A-Fa-f]{1,4}))/,asciiDigit:/[0-9]/,integer:/[0-9]+/,nonEscapedIdStartChar:/[\$@-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u1FFF\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183-\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3006\u3031-\u3035\u303B-\u303C\u3040-\u318F\u31A0-\u31BA\u31F0-\u31FF\u3300-\u337F\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,escapedIdChar:/\\[\-\.:#]/,idStartChar:/(?:@nonEscapedIdStartChar)|(?:@escapedIdChar)/,id:/(?:@idStartChar)(?:(?:@idStartChar)|(?:@asciiDigit))*/,specialHashKeys:/\*\*|\*|false|true|in|as|using/,namedSymbols:/<=|>=|\\lte|\\lt|<|\\gte|\\gt|>|&&|\\and|->|->|==|!=|\+=|-=|\*=|\/=|%=|\+\+|--|<=|&&|\|\||:|\.\.\.|\.\.\*|\.\.<|\.\.!|\?\?|=|<|\+|-|\*|\/|%|\||\.\.|\?|!|&|\.|,|;/,arrows:["->","->"],delimiters:[";",":",",","."],stringOperators:["lte","lt","gte","gt"],noParseTags:["noparse","noParse","comment"],tokenizer:{[e("default__id__")]:[{include:e("@directive_token__id__")},{include:e("@interpolation_and_text_token__id__")}],[e("fmExpression__id__.directive")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("fmExpression__id__.interpolation")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("inParen__id__.plain")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("inParen__id__.gt")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("noSpaceExpression__id__")]:[{include:e("@no_space_expression_end_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("unifiedCall__id__")]:[{include:e("@unified_call_token__id__")}],[e("singleString__id__")]:[{include:e("@string_single_token__id__")}],[e("doubleString__id__")]:[{include:e("@string_double_token__id__")}],[e("rawSingleString__id__")]:[{include:e("@string_single_raw_token__id__")}],[e("rawDoubleString__id__")]:[{include:e("@string_double_raw_token__id__")}],[e("expressionComment__id__")]:[{include:e("@expression_comment_token__id__")}],[e("noParse__id__")]:[{include:e("@no_parse_token__id__")}],[e("terseComment__id__")]:[{include:e("@terse_comment_token__id__")}],[e("directive_token__id__")]:[[o(/(?:@startTag__id__)(@directiveStartCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{cases:{"@noParseTags":{token:"tag",next:e("@noParse__id__.$3")},"@default":{token:"tag"}}},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartCloseTag2)(?:@closeTag2__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartBlank)(@blank)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(?:@endTag__id__)(@directiveEndCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)(@)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive",next:e("@unifiedCall__id__")}]],[o(/(@open__id__)(\/@)((?:(?:@id)(?:\.(?:@id))*)?)(?:@closeTag1__id__)/),[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)#--/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:{token:"comment",next:e("@terseComment__id__")}],[o(/(?:@startOrEndTag__id__)([a-zA-Z_]+)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag.invalid",next:e("@fmExpression__id__.directive")}]]],[e("interpolation_and_text_token__id__")]:[[o(/(@iOpen1__id__)(@iOpen2__id__)/),[{token:n.id==="bracket"?"@brackets.interpolation":"delimiter.interpolation"},{token:n.id==="bracket"?"delimiter.interpolation":"@brackets.interpolation",next:e("@fmExpression__id__.interpolation")}]],[/[\$#<\[\{]|(?:@blank)+|[^\$<#\[\{\n\r\t ]+/,{token:"source"}]],[e("string_single_token__id__")]:[[/[^'\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/'/,{token:"string",next:"@pop"}]],[e("string_double_token__id__")]:[[/[^"\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/"/,{token:"string",next:"@pop"}]],[e("string_single_raw_token__id__")]:[[/[^']+/,{token:"string.raw"}],[/'/,{token:"string.raw",next:"@pop"}]],[e("string_double_raw_token__id__")]:[[/[^"]+/,{token:"string.raw"}],[/"/,{token:"string.raw",next:"@pop"}]],[e("expression_token__id__")]:[[/(r?)(['"])/,{cases:{"r'":[{token:"keyword"},{token:"string.raw",next:e("@rawSingleString__id__")}],'r"':[{token:"keyword"},{token:"string.raw",next:e("@rawDoubleString__id__")}],"'":[{token:"source"},{token:"string",next:e("@singleString__id__")}],'"':[{token:"source"},{token:"string",next:e("@doubleString__id__")}]}}],[/(?:@integer)(?:\.(?:@integer))?/,{cases:{"(?:@integer)":{token:"number"},"@default":{token:"number.float"}}}],[/(\.)(@blank*)(@specialHashKeys)/,[{token:"delimiter"},{token:""},{token:"identifier"}]],[/(?:@namedSymbols)/,{cases:{"@arrows":{token:"meta.arrow"},"@delimiters":{token:"delimiter"},"@default":{token:"operators"}}}],[/@id/,{cases:{"@keywords":{token:"keyword.$0"},"@stringOperators":{token:"operators"},"@default":{token:"identifier"}}}],[/[\[\]\(\)\{\}]/,{cases:{"\\[":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\]":{cases:{...n.id==="bracket"?{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}}:{},...t.id==="bracket"?{"$S2==directive":{token:"@brackets.directive",next:"@popall"}}:{},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\(":{token:"@brackets",next:e("@inParen__id__.gt")},"\\)":{cases:{[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\{":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\}":{cases:{...n.id==="bracket"?{}:{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}}}}],[/\$\{/,{token:"delimiter.invalid"}]],[e("blank_and_expression_comment_token__id__")]:[[/(?:@blank)+/,{token:""}],[/[<\[][#!]--/,{token:"comment",next:e("@expressionComment__id__")}]],[e("directive_end_token__id__")]:[[/>/,t.id==="bracket"?{token:"operators"}:{token:"@brackets.directive",next:"@popall"}],[o(/(\/)(@close__id__)/),[{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]]],[e("greater_operators_token__id__")]:[[/>/,{token:"operators"}],[/>=/,{token:"operators"}]],[e("no_space_expression_end_token__id__")]:[[/(?:@blank)+/,{token:"",switchTo:e("@fmExpression__id__.directive")}]],[e("unified_call_token__id__")]:[[/(@id)((?:@blank)+)/,[{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(@id)(\/?)(@close__id__)/),[{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]],[/./,{token:"@rematch",next:e("@noSpaceExpression__id__")}]],[e("no_parse_token__id__")]:[[o(/(@open__id__)(\/#?)([a-zA-Z]+)((?:@blank)*)(@close__id__)/),{cases:{"$S2==$3":[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:""},{token:"@brackets.directive",next:"@popall"}],"$S2==comment":[{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"}],"@default":[{token:"source"},{token:"source"},{token:"source"},{token:"source"},{token:"source"}]}}],[/[^<\[\-]+|[<\[\-]/,{cases:{"$S2==comment":{token:"comment"},"@default":{token:"source"}}}]],[e("expression_comment_token__id__")]:[[/--[>\]]/,{token:"comment",next:"@pop"}],[/[^\->\]]+|[>\]\-]/,{token:"comment"}]],[e("terse_comment_token__id__")]:[[o(/--(?:@close__id__)/),{token:"comment",next:"@popall"}],[/[^<\[\-]+|[<\[\-]/,{token:"comment"}]]}}}function A(t){const n=_(a,t),i=_(r,t),e=_(F,t);return{...n,...i,...e,unicode:!0,includeLF:!1,start:`default_auto_${t.id}`,ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{...n.tokenizer,...i.tokenizer,...e.tokenizer}}}const b={conf:l(a),language:_(a,k)},x={conf:l(r),language:_(r,k)},$={conf:l(a),language:_(a,p)},E={conf:l(r),language:_(r,p)},B={conf:g(),language:A(k)},D={conf:g(),language:A(p)};export{$ as TagAngleInterpolationBracket,b as TagAngleInterpolationDollar,D as TagAutoInterpolationBracket,B as TagAutoInterpolationDollar,E as TagBracketInterpolationBracket,x as TagBracketInterpolationDollar};
diff --git a/src/main/resources/META-INF/resources/assets/freemarker2-DqDWCtuK.js b/src/main/resources/META-INF/resources/assets/freemarker2-DqDWCtuK.js
deleted file mode 100644
index bf27c831b..000000000
--- a/src/main/resources/META-INF/resources/assets/freemarker2-DqDWCtuK.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import{l as c}from"./index-Cfhvosw6.js";const s=["assign","flush","ftl","return","global","import","include","break","continue","local","nested","nt","setting","stop","t","lt","rt","fallback"],d=["attempt","autoesc","autoEsc","compress","comment","escape","noescape","function","if","list","items","sep","macro","noparse","noParse","noautoesc","noAutoEsc","outputformat","switch","visit","recurse"],a={close:">",id:"angle",open:"<"},r={close:"\\]",id:"bracket",open:"\\["},F={close:"[>\\]]",id:"auto",open:"[<\\[]"},k={close:"\\}",id:"dollar",open1:"\\$",open2:"\\{"},p={close:"\\]",id:"bracket",open1:"\\[",open2:"="};function l(t){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],comments:{blockComment:[`${t.open}--`,`--${t.close}`]},autoCloseBefore:`
-\r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`${t.open}#(?:${d.join("|")})([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),end:new RegExp(`${t.open}/#(?:${d.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`${t.open}#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),afterText:new RegExp(`^${t.open}/#([a-zA-Z_]+)[\\r\\n\\t ]*${t.close}$`),action:{indentAction:c.IndentAction.IndentOutdent}},{beforeText:new RegExp(`${t.open}#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),action:{indentAction:c.IndentAction.Indent}}]}}function g(){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],autoCloseBefore:`
-\r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`[<\\[]#(?:${d.join("|")})([^/>\\]]*(?!/)[>\\]])[^<\\[]*$`),end:new RegExp(`[<\\[]/#(?:${d.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`[<\\[]#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),afterText:new RegExp("^[<\\[]/#([a-zA-Z_]+)[\\r\\n\\t ]*[>\\]]$"),action:{indentAction:c.IndentAction.IndentOutdent}},{beforeText:new RegExp(`[<\\[]#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),action:{indentAction:c.IndentAction.Indent}}]}}function _(t,n){const i=`_${t.id}_${n.id}`,e=u=>u.replace(/__id__/g,i),o=u=>{const m=u.source.replace(/__id__/g,i);return new RegExp(m,u.flags)};return{unicode:!0,includeLF:!1,start:e("default__id__"),ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],[e("open__id__")]:new RegExp(t.open),[e("close__id__")]:new RegExp(t.close),[e("iOpen1__id__")]:new RegExp(n.open1),[e("iOpen2__id__")]:new RegExp(n.open2),[e("iClose__id__")]:new RegExp(n.close),[e("startTag__id__")]:o(/(@open__id__)(#)/),[e("endTag__id__")]:o(/(@open__id__)(\/#)/),[e("startOrEndTag__id__")]:o(/(@open__id__)(\/?#)/),[e("closeTag1__id__")]:o(/((?:@blank)*)(@close__id__)/),[e("closeTag2__id__")]:o(/((?:@blank)*\/?)(@close__id__)/),blank:/[ \t\n\r]/,keywords:["false","true","in","as","using"],directiveStartCloseTag1:/attempt|recover|sep|auto[eE]sc|no(?:autoe|AutoE)sc|compress|default|no[eE]scape|comment|no[pP]arse/,directiveStartCloseTag2:/else|break|continue|return|stop|flush|t|lt|rt|nt|nested|recurse|fallback|ftl/,directiveStartBlank:/if|else[iI]f|list|for[eE]ach|switch|case|assign|global|local|include|import|function|macro|transform|visit|stop|return|call|setting|output[fF]ormat|nested|recurse|escape|ftl|items/,directiveEndCloseTag1:/if|list|items|sep|recover|attempt|for[eE]ach|local|global|assign|function|macro|output[fF]ormat|auto[eE]sc|no(?:autoe|AutoE)sc|compress|transform|switch|escape|no[eE]scape/,escapedChar:/\\(?:[ntrfbgla\\'"\{=]|(?:x[0-9A-Fa-f]{1,4}))/,asciiDigit:/[0-9]/,integer:/[0-9]+/,nonEscapedIdStartChar:/[\$@-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u1FFF\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183-\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3006\u3031-\u3035\u303B-\u303C\u3040-\u318F\u31A0-\u31BA\u31F0-\u31FF\u3300-\u337F\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,escapedIdChar:/\\[\-\.:#]/,idStartChar:/(?:@nonEscapedIdStartChar)|(?:@escapedIdChar)/,id:/(?:@idStartChar)(?:(?:@idStartChar)|(?:@asciiDigit))*/,specialHashKeys:/\*\*|\*|false|true|in|as|using/,namedSymbols:/<=|>=|\\lte|\\lt|<|\\gte|\\gt|>|&&|\\and|->|->|==|!=|\+=|-=|\*=|\/=|%=|\+\+|--|<=|&&|\|\||:|\.\.\.|\.\.\*|\.\.<|\.\.!|\?\?|=|<|\+|-|\*|\/|%|\||\.\.|\?|!|&|\.|,|;/,arrows:["->","->"],delimiters:[";",":",",","."],stringOperators:["lte","lt","gte","gt"],noParseTags:["noparse","noParse","comment"],tokenizer:{[e("default__id__")]:[{include:e("@directive_token__id__")},{include:e("@interpolation_and_text_token__id__")}],[e("fmExpression__id__.directive")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("fmExpression__id__.interpolation")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("inParen__id__.plain")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("inParen__id__.gt")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("noSpaceExpression__id__")]:[{include:e("@no_space_expression_end_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("unifiedCall__id__")]:[{include:e("@unified_call_token__id__")}],[e("singleString__id__")]:[{include:e("@string_single_token__id__")}],[e("doubleString__id__")]:[{include:e("@string_double_token__id__")}],[e("rawSingleString__id__")]:[{include:e("@string_single_raw_token__id__")}],[e("rawDoubleString__id__")]:[{include:e("@string_double_raw_token__id__")}],[e("expressionComment__id__")]:[{include:e("@expression_comment_token__id__")}],[e("noParse__id__")]:[{include:e("@no_parse_token__id__")}],[e("terseComment__id__")]:[{include:e("@terse_comment_token__id__")}],[e("directive_token__id__")]:[[o(/(?:@startTag__id__)(@directiveStartCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{cases:{"@noParseTags":{token:"tag",next:e("@noParse__id__.$3")},"@default":{token:"tag"}}},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartCloseTag2)(?:@closeTag2__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartBlank)(@blank)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(?:@endTag__id__)(@directiveEndCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)(@)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive",next:e("@unifiedCall__id__")}]],[o(/(@open__id__)(\/@)((?:(?:@id)(?:\.(?:@id))*)?)(?:@closeTag1__id__)/),[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)#--/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:{token:"comment",next:e("@terseComment__id__")}],[o(/(?:@startOrEndTag__id__)([a-zA-Z_]+)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag.invalid",next:e("@fmExpression__id__.directive")}]]],[e("interpolation_and_text_token__id__")]:[[o(/(@iOpen1__id__)(@iOpen2__id__)/),[{token:n.id==="bracket"?"@brackets.interpolation":"delimiter.interpolation"},{token:n.id==="bracket"?"delimiter.interpolation":"@brackets.interpolation",next:e("@fmExpression__id__.interpolation")}]],[/[\$#<\[\{]|(?:@blank)+|[^\$<#\[\{\n\r\t ]+/,{token:"source"}]],[e("string_single_token__id__")]:[[/[^'\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/'/,{token:"string",next:"@pop"}]],[e("string_double_token__id__")]:[[/[^"\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/"/,{token:"string",next:"@pop"}]],[e("string_single_raw_token__id__")]:[[/[^']+/,{token:"string.raw"}],[/'/,{token:"string.raw",next:"@pop"}]],[e("string_double_raw_token__id__")]:[[/[^"]+/,{token:"string.raw"}],[/"/,{token:"string.raw",next:"@pop"}]],[e("expression_token__id__")]:[[/(r?)(['"])/,{cases:{"r'":[{token:"keyword"},{token:"string.raw",next:e("@rawSingleString__id__")}],'r"':[{token:"keyword"},{token:"string.raw",next:e("@rawDoubleString__id__")}],"'":[{token:"source"},{token:"string",next:e("@singleString__id__")}],'"':[{token:"source"},{token:"string",next:e("@doubleString__id__")}]}}],[/(?:@integer)(?:\.(?:@integer))?/,{cases:{"(?:@integer)":{token:"number"},"@default":{token:"number.float"}}}],[/(\.)(@blank*)(@specialHashKeys)/,[{token:"delimiter"},{token:""},{token:"identifier"}]],[/(?:@namedSymbols)/,{cases:{"@arrows":{token:"meta.arrow"},"@delimiters":{token:"delimiter"},"@default":{token:"operators"}}}],[/@id/,{cases:{"@keywords":{token:"keyword.$0"},"@stringOperators":{token:"operators"},"@default":{token:"identifier"}}}],[/[\[\]\(\)\{\}]/,{cases:{"\\[":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\]":{cases:{...n.id==="bracket"?{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}}:{},...t.id==="bracket"?{"$S2==directive":{token:"@brackets.directive",next:"@popall"}}:{},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\(":{token:"@brackets",next:e("@inParen__id__.gt")},"\\)":{cases:{[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\{":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\}":{cases:{...n.id==="bracket"?{}:{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}}}}],[/\$\{/,{token:"delimiter.invalid"}]],[e("blank_and_expression_comment_token__id__")]:[[/(?:@blank)+/,{token:""}],[/[<\[][#!]--/,{token:"comment",next:e("@expressionComment__id__")}]],[e("directive_end_token__id__")]:[[/>/,t.id==="bracket"?{token:"operators"}:{token:"@brackets.directive",next:"@popall"}],[o(/(\/)(@close__id__)/),[{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]]],[e("greater_operators_token__id__")]:[[/>/,{token:"operators"}],[/>=/,{token:"operators"}]],[e("no_space_expression_end_token__id__")]:[[/(?:@blank)+/,{token:"",switchTo:e("@fmExpression__id__.directive")}]],[e("unified_call_token__id__")]:[[/(@id)((?:@blank)+)/,[{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(@id)(\/?)(@close__id__)/),[{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]],[/./,{token:"@rematch",next:e("@noSpaceExpression__id__")}]],[e("no_parse_token__id__")]:[[o(/(@open__id__)(\/#?)([a-zA-Z]+)((?:@blank)*)(@close__id__)/),{cases:{"$S2==$3":[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:""},{token:"@brackets.directive",next:"@popall"}],"$S2==comment":[{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"}],"@default":[{token:"source"},{token:"source"},{token:"source"},{token:"source"},{token:"source"}]}}],[/[^<\[\-]+|[<\[\-]/,{cases:{"$S2==comment":{token:"comment"},"@default":{token:"source"}}}]],[e("expression_comment_token__id__")]:[[/--[>\]]/,{token:"comment",next:"@pop"}],[/[^\->\]]+|[>\]\-]/,{token:"comment"}]],[e("terse_comment_token__id__")]:[[o(/--(?:@close__id__)/),{token:"comment",next:"@popall"}],[/[^<\[\-]+|[<\[\-]/,{token:"comment"}]]}}}function A(t){const n=_(a,t),i=_(r,t),e=_(F,t);return{...n,...i,...e,unicode:!0,includeLF:!1,start:`default_auto_${t.id}`,ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{...n.tokenizer,...i.tokenizer,...e.tokenizer}}}const b={conf:l(a),language:_(a,k)},x={conf:l(r),language:_(r,k)},$={conf:l(a),language:_(a,p)},E={conf:l(r),language:_(r,p)},B={conf:g(),language:A(k)},D={conf:g(),language:A(p)};export{$ as TagAngleInterpolationBracket,b as TagAngleInterpolationDollar,D as TagAutoInterpolationBracket,B as TagAutoInterpolationDollar,E as TagBracketInterpolationBracket,x as TagBracketInterpolationDollar};
diff --git a/src/main/resources/META-INF/resources/assets/handlebars-B6GL_0Gw.js b/src/main/resources/META-INF/resources/assets/handlebars-B6GL_0Gw.js
deleted file mode 100644
index e3e69b7bf..000000000
--- a/src/main/resources/META-INF/resources/assets/handlebars-B6GL_0Gw.js
+++ /dev/null
@@ -1 +0,0 @@
-import{l as e}from"./index-Cfhvosw6.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],a={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[[""],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}]},m={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/,"delimiter.html"],[/\{/,"delimiter.html"],[/[^<{]+/]],doctype:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{a as conf,m as language};
diff --git a/src/main/resources/META-INF/resources/assets/handlebars-u8CdY6Y6.js b/src/main/resources/META-INF/resources/assets/handlebars-u8CdY6Y6.js
deleted file mode 100644
index a70c3e20f..000000000
--- a/src/main/resources/META-INF/resources/assets/handlebars-u8CdY6Y6.js
+++ /dev/null
@@ -1 +0,0 @@
-import{l as e}from"./index-BFi5BZ7U.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],a={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[[""],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}]},m={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/,"delimiter.html"],[/\{/,"delimiter.html"],[/[^<{]+/]],doctype:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{a as conf,m as language};
diff --git a/src/main/resources/META-INF/resources/assets/html-CXIKgM1_.js b/src/main/resources/META-INF/resources/assets/html-CXIKgM1_.js
deleted file mode 100644
index e45b7ddef..000000000
--- a/src/main/resources/META-INF/resources/assets/html-CXIKgM1_.js
+++ /dev/null
@@ -1 +0,0 @@
-import{l as e}from"./index-BFi5BZ7U.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],i={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[""]},brackets:[[""],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*"),end:new RegExp("^\\s*")}}},r={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/,"delimiter"],[/[^<]+/]],doctype:[[/[^>]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"module"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/'module'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}};export{i as conf,r as language};
diff --git a/src/main/resources/META-INF/resources/assets/html-z1CojlRt.js b/src/main/resources/META-INF/resources/assets/html-z1CojlRt.js
deleted file mode 100644
index b40ff6b46..000000000
--- a/src/main/resources/META-INF/resources/assets/html-z1CojlRt.js
+++ /dev/null
@@ -1 +0,0 @@
-import{l as e}from"./index-Cfhvosw6.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],i={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[""]},brackets:[[""],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*"),end:new RegExp("^\\s*")}}},r={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/,"delimiter"],[/[^<]+/]],doctype:[[/[^>]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"module"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/'module'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}};export{i as conf,r as language};
diff --git a/src/main/resources/META-INF/resources/assets/htmlMode-CqKL2ox8.js b/src/main/resources/META-INF/resources/assets/htmlMode-CqKL2ox8.js
deleted file mode 100644
index f2e9ffa51..000000000
--- a/src/main/resources/META-INF/resources/assets/htmlMode-CqKL2ox8.js
+++ /dev/null
@@ -1 +0,0 @@
-import{c as D,l as t}from"./index-BFi5BZ7U.js";import{H as d,D as l,h as c,F as u,b as h,S as m,c as p,f as w,g as _,C as R}from"./lspLanguageFeatures-CjZ9t0R-.js";import{a as E,e as H,d as b,R as y,i as T,j as U,t as x,k as M}from"./lspLanguageFeatures-CjZ9t0R-.js";const I=120*1e3;class f{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>I&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=D({moduleId:"vs/language/html/htmlWorker",createWorker:()=>new Worker(new URL("/assets/html.worker-DtiGdgqp.js",import.meta.url),{type:"module"}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(r=>{e=r}).then(r=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(r=>e)}}class v extends R{constructor(n){super(n,[".",":","<",'"',"=","/"])}}function C(i){const n=new f(i),e=(...s)=>n.getLanguageServiceWorker(...s);let r=i.languageId;t.registerCompletionItemProvider(r,new v(e)),t.registerHoverProvider(r,new d(e)),t.registerDocumentHighlightProvider(r,new l(e)),t.registerLinkProvider(r,new c(e)),t.registerFoldingRangeProvider(r,new u(e)),t.registerDocumentSymbolProvider(r,new h(e)),t.registerSelectionRangeProvider(r,new m(e)),t.registerRenameProvider(r,new p(e)),r==="html"&&(t.registerDocumentFormattingEditProvider(r,new w(e)),t.registerDocumentRangeFormattingEditProvider(r,new _(e)))}function W(i){const n=[],e=[],r=new f(i);n.push(r);const s=(...o)=>r.getLanguageServiceWorker(...o);function P(){const{languageId:o,modeConfiguration:a}=i;k(e),a.completionItems&&e.push(t.registerCompletionItemProvider(o,new v(s))),a.hovers&&e.push(t.registerHoverProvider(o,new d(s))),a.documentHighlights&&e.push(t.registerDocumentHighlightProvider(o,new l(s))),a.links&&e.push(t.registerLinkProvider(o,new c(s))),a.documentSymbols&&e.push(t.registerDocumentSymbolProvider(o,new h(s))),a.rename&&e.push(t.registerRenameProvider(o,new p(s))),a.foldingRanges&&e.push(t.registerFoldingRangeProvider(o,new u(s))),a.selectionRanges&&e.push(t.registerSelectionRangeProvider(o,new m(s))),a.documentFormattingEdits&&e.push(t.registerDocumentFormattingEditProvider(o,new w(s))),a.documentRangeFormattingEdits&&e.push(t.registerDocumentRangeFormattingEditProvider(o,new _(s)))}return P(),n.push(g(e)),g(n)}function g(i){return{dispose:()=>k(i)}}function k(i){for(;i.length;)i.pop().dispose()}export{R as CompletionAdapter,E as DefinitionAdapter,H as DiagnosticsAdapter,b as DocumentColorAdapter,w as DocumentFormattingEditProvider,l as DocumentHighlightAdapter,c as DocumentLinkAdapter,_ as DocumentRangeFormattingEditProvider,h as DocumentSymbolAdapter,u as FoldingRangeAdapter,d as HoverAdapter,y as ReferenceAdapter,p as RenameAdapter,m as SelectionRangeAdapter,f as WorkerManager,T as fromPosition,U as fromRange,W as setupMode,C as setupMode1,x as toRange,M as toTextEdit};
diff --git a/src/main/resources/META-INF/resources/assets/htmlMode-FnQ1MKvn.js b/src/main/resources/META-INF/resources/assets/htmlMode-FnQ1MKvn.js
deleted file mode 100644
index 602ae915e..000000000
--- a/src/main/resources/META-INF/resources/assets/htmlMode-FnQ1MKvn.js
+++ /dev/null
@@ -1 +0,0 @@
-import{c as D,l as t}from"./index-Cfhvosw6.js";import{H as d,D as l,h as c,F as u,b as h,S as m,c as p,f as w,g as _,C as R}from"./lspLanguageFeatures-CWMiI3_8.js";import{a as E,e as H,d as b,R as y,i as T,j as U,t as x,k as M}from"./lspLanguageFeatures-CWMiI3_8.js";const I=120*1e3;class f{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>I&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=D({moduleId:"vs/language/html/htmlWorker",createWorker:()=>new Worker(new URL("/assets/html.worker-DtiGdgqp.js",import.meta.url),{type:"module"}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(r=>{e=r}).then(r=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(r=>e)}}class v extends R{constructor(n){super(n,[".",":","<",'"',"=","/"])}}function C(i){const n=new f(i),e=(...s)=>n.getLanguageServiceWorker(...s);let r=i.languageId;t.registerCompletionItemProvider(r,new v(e)),t.registerHoverProvider(r,new d(e)),t.registerDocumentHighlightProvider(r,new l(e)),t.registerLinkProvider(r,new c(e)),t.registerFoldingRangeProvider(r,new u(e)),t.registerDocumentSymbolProvider(r,new h(e)),t.registerSelectionRangeProvider(r,new m(e)),t.registerRenameProvider(r,new p(e)),r==="html"&&(t.registerDocumentFormattingEditProvider(r,new w(e)),t.registerDocumentRangeFormattingEditProvider(r,new _(e)))}function W(i){const n=[],e=[],r=new f(i);n.push(r);const s=(...o)=>r.getLanguageServiceWorker(...o);function P(){const{languageId:o,modeConfiguration:a}=i;k(e),a.completionItems&&e.push(t.registerCompletionItemProvider(o,new v(s))),a.hovers&&e.push(t.registerHoverProvider(o,new d(s))),a.documentHighlights&&e.push(t.registerDocumentHighlightProvider(o,new l(s))),a.links&&e.push(t.registerLinkProvider(o,new c(s))),a.documentSymbols&&e.push(t.registerDocumentSymbolProvider(o,new h(s))),a.rename&&e.push(t.registerRenameProvider(o,new p(s))),a.foldingRanges&&e.push(t.registerFoldingRangeProvider(o,new u(s))),a.selectionRanges&&e.push(t.registerSelectionRangeProvider(o,new m(s))),a.documentFormattingEdits&&e.push(t.registerDocumentFormattingEditProvider(o,new w(s))),a.documentRangeFormattingEdits&&e.push(t.registerDocumentRangeFormattingEditProvider(o,new _(s)))}return P(),n.push(g(e)),g(n)}function g(i){return{dispose:()=>k(i)}}function k(i){for(;i.length;)i.pop().dispose()}export{R as CompletionAdapter,E as DefinitionAdapter,H as DiagnosticsAdapter,b as DocumentColorAdapter,w as DocumentFormattingEditProvider,l as DocumentHighlightAdapter,c as DocumentLinkAdapter,_ as DocumentRangeFormattingEditProvider,h as DocumentSymbolAdapter,u as FoldingRangeAdapter,d as HoverAdapter,y as ReferenceAdapter,p as RenameAdapter,m as SelectionRangeAdapter,f as WorkerManager,T as fromPosition,U as fromRange,W as setupMode,C as setupMode1,x as toRange,M as toTextEdit};
diff --git a/src/main/resources/META-INF/resources/assets/index-BFi5BZ7U.js b/src/main/resources/META-INF/resources/assets/index-BFi5BZ7U.js
deleted file mode 100644
index 57e270f4e..000000000
--- a/src/main/resources/META-INF/resources/assets/index-BFi5BZ7U.js
+++ /dev/null
@@ -1,1905 +0,0 @@
-const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cssMode-DMPmy9yy.js","assets/lspLanguageFeatures-CjZ9t0R-.js","assets/htmlMode-CqKL2ox8.js","assets/jsonMode-D3E7SjOF.js","assets/javascript-SxiXgJ1p.js","assets/typescript-G7Eu3Ar3.js"])))=>i.map(i=>d[i]);
-var LFe=Object.defineProperty;var oge=i=>{throw TypeError(i)};var DFe=(i,e,t)=>e in i?LFe(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var kt=(i,e,t)=>DFe(i,typeof e!="symbol"?e+"":e,t),$z=(i,e,t)=>e.has(i)||oge("Cannot "+t);var oe=(i,e,t)=>($z(i,e,"read from private field"),t?t.call(i):e.get(i)),Ht=(i,e,t)=>e.has(i)?oge("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),yt=(i,e,t,n)=>($z(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t),st=(i,e,t)=>($z(i,e,"access private method"),t);var c5=(i,e,t,n)=>({set _(s){yt(i,e,s,t)},get _(){return oe(i,e,n)}});function TFe(i,e){for(var t=0;tn[s]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();function t7(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var qz={exports:{}},hT={};/**
- * @license React
- * react-jsx-runtime.production.js
- *
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var age;function IFe(){if(age)return hT;age=1;var i=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,s,r){var o=null;if(r!==void 0&&(o=""+r),s.key!==void 0&&(o=""+s.key),"key"in s){r={};for(var a in s)a!=="key"&&(r[a]=s[a])}else r=s;return s=r.ref,{$$typeof:i,type:n,key:o,ref:s!==void 0?s:null,props:r}}return hT.Fragment=e,hT.jsx=t,hT.jsxs=t,hT}var lge;function AFe(){return lge||(lge=1,qz.exports=IFe()),qz.exports}var d=AFe(),Kz={exports:{}},si={};/**
- * @license React
- * react.production.js
- *
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var cge;function RFe(){if(cge)return si;cge=1;var i=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),r=Symbol.for("react.consumer"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),g=Symbol.iterator;function f(Q){return Q===null||typeof Q!="object"?null:(Q=g&&Q[g]||Q["@@iterator"],typeof Q=="function"?Q:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,v={};function _(Q,Y,V){this.props=Q,this.context=Y,this.refs=v,this.updater=V||m}_.prototype.isReactComponent={},_.prototype.setState=function(Q,Y){if(typeof Q!="object"&&typeof Q!="function"&&Q!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Q,Y,"setState")},_.prototype.forceUpdate=function(Q){this.updater.enqueueForceUpdate(this,Q,"forceUpdate")};function w(){}w.prototype=_.prototype;function k(Q,Y,V){this.props=Q,this.context=Y,this.refs=v,this.updater=V||m}var C=k.prototype=new w;C.constructor=k,x(C,_.prototype),C.isPureReactComponent=!0;var E=Array.isArray;function D(){}var T={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function R(Q,Y,V){var ue=V.ref;return{$$typeof:i,type:Q,key:Y,ref:ue!==void 0?ue:null,props:V}}function P(Q,Y){return R(Q.type,Y,Q.props)}function j(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===i}function B(Q){var Y={"=":"=0",":":"=2"};return"$"+Q.replace(/[=:]/g,function(V){return Y[V]})}var U=/\/+/g;function $(Q,Y){return typeof Q=="object"&&Q!==null&&Q.key!=null?B(""+Q.key):Y.toString(36)}function K(Q){switch(Q.status){case"fulfilled":return Q.value;case"rejected":throw Q.reason;default:switch(typeof Q.status=="string"?Q.then(D,D):(Q.status="pending",Q.then(function(Y){Q.status==="pending"&&(Q.status="fulfilled",Q.value=Y)},function(Y){Q.status==="pending"&&(Q.status="rejected",Q.reason=Y)})),Q.status){case"fulfilled":return Q.value;case"rejected":throw Q.reason}}throw Q}function z(Q,Y,V,ue,he){var Te=typeof Q;(Te==="undefined"||Te==="boolean")&&(Q=null);var nt=!1;if(Q===null)nt=!0;else switch(Te){case"bigint":case"string":case"number":nt=!0;break;case"object":switch(Q.$$typeof){case i:case e:nt=!0;break;case u:return nt=Q._init,z(nt(Q._payload),Y,V,ue,he)}}if(nt)return he=he(Q),nt=ue===""?"."+$(Q,0):ue,E(he)?(V="",nt!=null&&(V=nt.replace(U,"$&/")+"/"),z(he,Y,V,"",function($e){return $e})):he!=null&&(j(he)&&(he=P(he,V+(he.key==null||Q&&Q.key===he.key?"":(""+he.key).replace(U,"$&/")+"/")+nt)),Y.push(he)),1;nt=0;var ge=ue===""?".":ue+":";if(E(Q))for(var _e=0;_e>>1,H=z[te];if(0>>1;tes(V,ne))ues(he,V)?(z[te]=he,z[ue]=ne,te=ue):(z[te]=V,z[Y]=ne,te=Y);else if(ues(he,ne))z[te]=he,z[ue]=ne,te=ue;else break e}}return G}function s(z,G){var ne=z.sortIndex-G.sortIndex;return ne!==0?ne:z.id-G.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;i.unstable_now=function(){return r.now()}}else{var o=Date,a=o.now();i.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,h=null,g=3,f=!1,m=!1,x=!1,v=!1,_=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function C(z){for(var G=t(c);G!==null;){if(G.callback===null)n(c);else if(G.startTime<=z)n(c),G.sortIndex=G.expirationTime,e(l,G);else break;G=t(c)}}function E(z){if(x=!1,C(z),!m)if(t(l)!==null)m=!0,D||(D=!0,B());else{var G=t(c);G!==null&&K(E,G.startTime-z)}}var D=!1,T=-1,I=5,R=-1;function P(){return v?!0:!(i.unstable_now()-Rz&&P());){var te=h.callback;if(typeof te=="function"){h.callback=null,g=h.priorityLevel;var H=te(h.expirationTime<=z);if(z=i.unstable_now(),typeof H=="function"){h.callback=H,C(z),G=!0;break t}h===t(l)&&n(l),C(z)}else n(l);h=t(l)}if(h!==null)G=!0;else{var Q=t(c);Q!==null&&K(E,Q.startTime-z),G=!1}}break e}finally{h=null,g=ne,f=!1}G=void 0}}finally{G?B():D=!1}}}var B;if(typeof k=="function")B=function(){k(j)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,$=U.port2;U.port1.onmessage=j,B=function(){$.postMessage(null)}}else B=function(){_(j,0)};function K(z,G){T=_(function(){z(i.unstable_now())},G)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(z){z.callback=null},i.unstable_forceFrameRate=function(z){0>z||125te?(z.sortIndex=ne,e(c,z),t(l)===null&&z===t(c)&&(x?(w(T),T=-1):x=!0,K(E,ne-te))):(z.sortIndex=H,e(l,z),m||f||(m=!0,D||(D=!0,B()))),z},i.unstable_shouldYield=P,i.unstable_wrapCallback=function(z){var G=g;return function(){var ne=g;g=G;try{return z.apply(this,arguments)}finally{g=ne}}}})(Qz)),Qz}var hge;function PFe(){return hge||(hge=1,Yz.exports=MFe()),Yz.exports}var Xz={exports:{}},Bl={};/**
- * @license React
- * react-dom.production.js
- *
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var gge;function OFe(){if(gge)return Bl;gge=1;var i=_ie();function e(l){var c="https://react.dev/errors/"+l;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(e){console.error(e)}}return i(),Xz.exports=OFe(),Xz.exports}/**
- * @license React
- * react-dom-client.production.js
- *
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var pge;function jFe(){if(pge)return gT;pge=1;var i=PFe(),e=_ie(),t=DCe();function n(p){var b="https://react.dev/errors/"+p;if(1H||(p.current=te[H],te[H]=null,H--)}function V(p,b){H++,te[H]=p.current,p.current=b}var ue=Q(null),he=Q(null),Te=Q(null),nt=Q(null);function ge(p,b){switch(V(Te,b),V(he,p),V(ue,null),b.nodeType){case 9:case 11:p=(p=b.documentElement)&&(p=p.namespaceURI)?Dhe(p):0;break;default:if(p=b.tagName,b=b.namespaceURI)b=Dhe(b),p=The(b,p);else switch(p){case"svg":p=1;break;case"math":p=2;break;default:p=0}}Y(ue),V(ue,p)}function _e(){Y(ue),Y(he),Y(Te)}function $e(p){p.memoizedState!==null&&V(nt,p);var b=ue.current,y=The(b,p.type);b!==y&&(V(he,p),V(ue,y))}function Ke(p){he.current===p&&(Y(ue),Y(he)),nt.current===p&&(Y(nt),lT._currentValue=ne)}var ht,Ct;function Ft(p){if(ht===void 0)try{throw Error()}catch(y){var b=y.stack.trim().match(/\n( *(at )?)/);ht=b&&b[1]||"",Ct=-1)":-1A||me[N]!==Be[A]){var et=`
-`+me[N].replace(" at new "," at ");return p.displayName&&et.includes("")&&(et=et.replace("",p.displayName)),et}while(1<=N&&0<=A);break}}}finally{Ve=!1,Error.prepareStackTrace=y}return(y=p?p.displayName||p.name:"")?Ft(y):""}function qt(p,b){switch(p.tag){case 26:case 27:case 5:return Ft(p.type);case 16:return Ft("Lazy");case 13:return p.child!==b&&b!==null?Ft("Suspense Fallback"):Ft("Suspense");case 19:return Ft("SuspenseList");case 0:case 15:return tt(p.type,!1);case 11:return tt(p.type.render,!1);case 1:return tt(p.type,!0);case 31:return Ft("Activity");default:return""}}function It(p){try{var b="",y=null;do b+=qt(p,y),y=p,p=p.return;while(p);return b}catch(N){return`
-Error generating stack: `+N.message+`
-`+N.stack}}var Zt=Object.prototype.hasOwnProperty,En=i.unstable_scheduleCallback,Xi=i.unstable_cancelCallback,zi=i.unstable_shouldYield,Tr=i.unstable_requestPaint,Fs=i.unstable_now,qo=i.unstable_getCurrentPriorityLevel,Ge=i.unstable_ImmediatePriority,mt=i.unstable_UserBlockingPriority,tn=i.unstable_NormalPriority,Ln=i.unstable_LowPriority,Un=i.unstable_IdlePriority,vs=i.log,_r=i.unstable_setDisableYieldValue,Js=null,Ei=null;function wi(p){if(typeof vs=="function"&&_r(p),Ei&&typeof Ei.setStrictMode=="function")try{Ei.setStrictMode(Js,p)}catch{}}var ii=Math.clz32?Math.clz32:ba,Ko=Math.log,Vr=Math.LN2;function ba(p){return p>>>=0,p===0?32:31-(Ko(p)/Vr|0)|0}var ll=256,qc=262144,_s=4194304;function ys(p){var b=p&42;if(b!==0)return b;switch(p&-p){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return p&261888;case 262144:case 524288:case 1048576:case 2097152:return p&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return p&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return p}}function on(p,b,y){var N=p.pendingLanes;if(N===0)return 0;var A=0,M=p.suspendedLanes,q=p.pingedLanes;p=p.warmLanes;var ee=N&134217727;return ee!==0?(N=ee&~M,N!==0?A=ys(N):(q&=ee,q!==0?A=ys(q):y||(y=ee&~p,y!==0&&(A=ys(y))))):(ee=N&~M,ee!==0?A=ys(ee):q!==0?A=ys(q):y||(y=N&~p,y!==0&&(A=ys(y)))),A===0?0:b!==0&&b!==A&&(b&M)===0&&(M=A&-A,y=b&-b,M>=y||M===32&&(y&4194048)!==0)?b:A}function Nn(p,b){return(p.pendingLanes&~(p.suspendedLanes&~p.pingedLanes)&b)===0}function vn(p,b){switch(p){case 1:case 2:case 4:case 8:case 64:return b+250;case 16:case 32: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 b+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ci(){var p=_s;return _s<<=1,(_s&62914560)===0&&(_s=4194304),p}function zr(p){for(var b=[],y=0;31>y;y++)b.push(p);return b}function Ii(p,b){p.pendingLanes|=b,b!==268435456&&(p.suspendedLanes=0,p.pingedLanes=0,p.warmLanes=0)}function Si(p,b,y,N,A,M){var q=p.pendingLanes;p.pendingLanes=y,p.suspendedLanes=0,p.pingedLanes=0,p.warmLanes=0,p.expiredLanes&=y,p.entangledLanes&=y,p.errorRecoveryDisabledLanes&=y,p.shellSuspendCounter=0;var ee=p.entanglements,me=p.expirationTimes,Be=p.hiddenUpdates;for(y=q&~y;0"u")return null;try{return p.activeElement||p.body}catch{return p.body}}var w4e=/[\n"\\]/g;function Hu(p){return p.replace(w4e,function(b){return"\\"+b.charCodeAt(0).toString(16)+" "})}function BW(p,b,y,N,A,M,q,ee){p.name="",q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?p.type=q:p.removeAttribute("type"),b!=null?q==="number"?(b===0&&p.value===""||p.value!=b)&&(p.value=""+Bu(b)):p.value!==""+Bu(b)&&(p.value=""+Bu(b)):q!=="submit"&&q!=="reset"||p.removeAttribute("value"),b!=null?HW(p,q,Bu(b)):y!=null?HW(p,q,Bu(y)):N!=null&&p.removeAttribute("value"),A==null&&M!=null&&(p.defaultChecked=!!M),A!=null&&(p.checked=A&&typeof A!="function"&&typeof A!="symbol"),ee!=null&&typeof ee!="function"&&typeof ee!="symbol"&&typeof ee!="boolean"?p.name=""+Bu(ee):p.removeAttribute("name")}function Cce(p,b,y,N,A,M,q,ee){if(M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(p.type=M),b!=null||y!=null){if(!(M!=="submit"&&M!=="reset"||b!=null)){FW(p);return}y=y!=null?""+Bu(y):"",b=b!=null?""+Bu(b):y,ee||b===p.value||(p.value=b),p.defaultValue=b}N=N??A,N=typeof N!="function"&&typeof N!="symbol"&&!!N,p.checked=ee?p.checked:!!N,p.defaultChecked=!!N,q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"&&(p.name=q),FW(p)}function HW(p,b,y){b==="number"&&JP(p.ownerDocument)===p||p.defaultValue===""+y||(p.defaultValue=""+y)}function YC(p,b,y,N){if(p=p.options,b){b={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$W=!1;if(Ap)try{var ND={};Object.defineProperty(ND,"passive",{get:function(){$W=!0}}),window.addEventListener("test",ND,ND),window.removeEventListener("test",ND,ND)}catch{$W=!1}var nx=null,qW=null,tO=null;function Tce(){if(tO)return tO;var p,b=qW,y=b.length,N,A="value"in nx?nx.value:nx.textContent,M=A.length;for(p=0;p=DD),Oce=" ",jce=!1;function Fce(p,b){switch(p){case"keyup":return Q4e.indexOf(b.keyCode)!==-1;case"keydown":return b.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bce(p){return p=p.detail,typeof p=="object"&&"data"in p?p.data:null}var JC=!1;function Z4e(p,b){switch(p){case"compositionend":return Bce(b);case"keypress":return b.which!==32?null:(jce=!0,Oce);case"textInput":return p=b.data,p===Oce&&jce?null:p;default:return null}}function J4e(p,b){if(JC)return p==="compositionend"||!XW&&Fce(p,b)?(p=Tce(),tO=qW=nx=null,JC=!1,p):null;switch(p){case"paste":return null;case"keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:y,offset:b-p};p=N}e:{for(;y;){if(y.nextSibling){y=y.nextSibling;break e}y=y.parentNode}y=void 0}y=Kce(y)}}function Yce(p,b){return p&&b?p===b?!0:p&&p.nodeType===3?!1:b&&b.nodeType===3?Yce(p,b.parentNode):"contains"in p?p.contains(b):p.compareDocumentPosition?!!(p.compareDocumentPosition(b)&16):!1:!1}function Qce(p){p=p!=null&&p.ownerDocument!=null&&p.ownerDocument.defaultView!=null?p.ownerDocument.defaultView:window;for(var b=JP(p.document);b instanceof p.HTMLIFrameElement;){try{var y=typeof b.contentWindow.location.href=="string"}catch{y=!1}if(y)p=b.contentWindow;else break;b=JP(p.document)}return b}function eV(p){var b=p&&p.nodeName&&p.nodeName.toLowerCase();return b&&(b==="input"&&(p.type==="text"||p.type==="search"||p.type==="tel"||p.type==="url"||p.type==="password")||b==="textarea"||p.contentEditable==="true")}var aje=Ap&&"documentMode"in document&&11>=document.documentMode,eS=null,tV=null,RD=null,nV=!1;function Xce(p,b,y){var N=y.window===y?y.document:y.nodeType===9?y:y.ownerDocument;nV||eS==null||eS!==JP(N)||(N=eS,"selectionStart"in N&&eV(N)?N={start:N.selectionStart,end:N.selectionEnd}:(N=(N.ownerDocument&&N.ownerDocument.defaultView||window).getSelection(),N={anchorNode:N.anchorNode,anchorOffset:N.anchorOffset,focusNode:N.focusNode,focusOffset:N.focusOffset}),RD&&AD(RD,N)||(RD=N,N=GO(tV,"onSelect"),0>=q,A-=q,Hg=1<<32-ii(b)+A|y<fi?(qi=mn,mn=null):qi=mn.sibling;var Ss=Ue(De,mn,Fe[fi],it);if(Ss===null){mn===null&&(mn=qi);break}p&&mn&&Ss.alternate===null&&b(De,mn),ke=M(Ss,ke,fi),Cs===null?Cn=Ss:Cs.sibling=Ss,Cs=Ss,mn=qi}if(fi===Fe.length)return y(De,mn),Zi&&Mp(De,fi),Cn;if(mn===null){for(;fifi?(qi=mn,mn=null):qi=mn.sibling;var Sx=Ue(De,mn,Ss.value,it);if(Sx===null){mn===null&&(mn=qi);break}p&&mn&&Sx.alternate===null&&b(De,mn),ke=M(Sx,ke,fi),Cs===null?Cn=Sx:Cs.sibling=Sx,Cs=Sx,mn=qi}if(Ss.done)return y(De,mn),Zi&&Mp(De,fi),Cn;if(mn===null){for(;!Ss.done;fi++,Ss=Fe.next())Ss=at(De,Ss.value,it),Ss!==null&&(ke=M(Ss,ke,fi),Cs===null?Cn=Ss:Cs.sibling=Ss,Cs=Ss);return Zi&&Mp(De,fi),Cn}for(mn=N(mn);!Ss.done;fi++,Ss=Fe.next())Ss=Ye(mn,De,fi,Ss.value,it),Ss!==null&&(p&&Ss.alternate!==null&&mn.delete(Ss.key===null?fi:Ss.key),ke=M(Ss,ke,fi),Cs===null?Cn=Ss:Cs.sibling=Ss,Cs=Ss);return p&&mn.forEach(function(EFe){return b(De,EFe)}),Zi&&Mp(De,fi),Cn}function ur(De,ke,Fe,it){if(typeof Fe=="object"&&Fe!==null&&Fe.type===x&&Fe.key===null&&(Fe=Fe.props.children),typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case f:e:{for(var Cn=Fe.key;ke!==null;){if(ke.key===Cn){if(Cn=Fe.type,Cn===x){if(ke.tag===7){y(De,ke.sibling),it=A(ke,Fe.props.children),it.return=De,De=it;break e}}else if(ke.elementType===Cn||typeof Cn=="object"&&Cn!==null&&Cn.$$typeof===I&&w0(Cn)===ke.type){y(De,ke.sibling),it=A(ke,Fe.props),BD(it,Fe),it.return=De,De=it;break e}y(De,ke);break}else b(De,ke);ke=ke.sibling}Fe.type===x?(it=b0(Fe.props.children,De.mode,it,Fe.key),it.return=De,De=it):(it=uO(Fe.type,Fe.key,Fe.props,null,De.mode,it),BD(it,Fe),it.return=De,De=it)}return q(De);case m:e:{for(Cn=Fe.key;ke!==null;){if(ke.key===Cn)if(ke.tag===4&&ke.stateNode.containerInfo===Fe.containerInfo&&ke.stateNode.implementation===Fe.implementation){y(De,ke.sibling),it=A(ke,Fe.children||[]),it.return=De,De=it;break e}else{y(De,ke);break}else b(De,ke);ke=ke.sibling}it=cV(Fe,De.mode,it),it.return=De,De=it}return q(De);case I:return Fe=w0(Fe),ur(De,ke,Fe,it)}if(K(Fe))return nn(De,ke,Fe,it);if(B(Fe)){if(Cn=B(Fe),typeof Cn!="function")throw Error(n(150));return Fe=Cn.call(Fe),Pn(De,ke,Fe,it)}if(typeof Fe.then=="function")return ur(De,ke,xO(Fe),it);if(Fe.$$typeof===k)return ur(De,ke,fO(De,Fe),it);vO(De,Fe)}return typeof Fe=="string"&&Fe!==""||typeof Fe=="number"||typeof Fe=="bigint"?(Fe=""+Fe,ke!==null&&ke.tag===6?(y(De,ke.sibling),it=A(ke,Fe),it.return=De,De=it):(y(De,ke),it=lV(Fe,De.mode,it),it.return=De,De=it),q(De)):y(De,ke)}return function(De,ke,Fe,it){try{FD=0;var Cn=ur(De,ke,Fe,it);return uS=null,Cn}catch(mn){if(mn===dS||mn===mO)throw mn;var Cs=Ud(29,mn,null,De.mode);return Cs.lanes=it,Cs.return=De,Cs}finally{}}}var S0=_de(!0),yde=_de(!1),ax=!1;function yV(p){p.updateQueue={baseState:p.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wV(p,b){p=p.updateQueue,b.updateQueue===p&&(b.updateQueue={baseState:p.baseState,firstBaseUpdate:p.firstBaseUpdate,lastBaseUpdate:p.lastBaseUpdate,shared:p.shared,callbacks:null})}function lx(p){return{lane:p,tag:0,payload:null,callback:null,next:null}}function cx(p,b,y){var N=p.updateQueue;if(N===null)return null;if(N=N.shared,(Ts&2)!==0){var A=N.pending;return A===null?b.next=b:(b.next=A.next,A.next=b),N.pending=b,b=dO(p),sde(p,null,y),b}return cO(p,N,b,y),dO(p)}function HD(p,b,y){if(b=b.updateQueue,b!==null&&(b=b.shared,(y&4194048)!==0)){var N=b.lanes;N&=p.pendingLanes,y|=N,b.lanes=y,Bs(p,y)}}function CV(p,b){var y=p.updateQueue,N=p.alternate;if(N!==null&&(N=N.updateQueue,y===N)){var A=null,M=null;if(y=y.firstBaseUpdate,y!==null){do{var q={lane:y.lane,tag:y.tag,payload:y.payload,callback:null,next:null};M===null?A=M=q:M=M.next=q,y=y.next}while(y!==null);M===null?A=M=b:M=M.next=b}else A=M=b;y={baseState:N.baseState,firstBaseUpdate:A,lastBaseUpdate:M,shared:N.shared,callbacks:N.callbacks},p.updateQueue=y;return}p=y.lastBaseUpdate,p===null?y.firstBaseUpdate=b:p.next=b,y.lastBaseUpdate=b}var SV=!1;function WD(){if(SV){var p=cS;if(p!==null)throw p}}function VD(p,b,y,N){SV=!1;var A=p.updateQueue;ax=!1;var M=A.firstBaseUpdate,q=A.lastBaseUpdate,ee=A.shared.pending;if(ee!==null){A.shared.pending=null;var me=ee,Be=me.next;me.next=null,q===null?M=Be:q.next=Be,q=me;var et=p.alternate;et!==null&&(et=et.updateQueue,ee=et.lastBaseUpdate,ee!==q&&(ee===null?et.firstBaseUpdate=Be:ee.next=Be,et.lastBaseUpdate=me))}if(M!==null){var at=A.baseState;q=0,et=Be=me=null,ee=M;do{var Ue=ee.lane&-536870913,Ye=Ue!==ee.lane;if(Ye?($i&Ue)===Ue:(N&Ue)===Ue){Ue!==0&&Ue===lS&&(SV=!0),et!==null&&(et=et.next={lane:0,tag:ee.tag,payload:ee.payload,callback:null,next:null});e:{var nn=p,Pn=ee;Ue=b;var ur=y;switch(Pn.tag){case 1:if(nn=Pn.payload,typeof nn=="function"){at=nn.call(ur,at,Ue);break e}at=nn;break e;case 3:nn.flags=nn.flags&-65537|128;case 0:if(nn=Pn.payload,Ue=typeof nn=="function"?nn.call(ur,at,Ue):nn,Ue==null)break e;at=h({},at,Ue);break e;case 2:ax=!0}}Ue=ee.callback,Ue!==null&&(p.flags|=64,Ye&&(p.flags|=8192),Ye=A.callbacks,Ye===null?A.callbacks=[Ue]:Ye.push(Ue))}else Ye={lane:Ue,tag:ee.tag,payload:ee.payload,callback:ee.callback,next:null},et===null?(Be=et=Ye,me=at):et=et.next=Ye,q|=Ue;if(ee=ee.next,ee===null){if(ee=A.shared.pending,ee===null)break;Ye=ee,ee=Ye.next,Ye.next=null,A.lastBaseUpdate=Ye,A.shared.pending=null}}while(!0);et===null&&(me=at),A.baseState=me,A.firstBaseUpdate=Be,A.lastBaseUpdate=et,M===null&&(A.shared.lanes=0),fx|=q,p.lanes=q,p.memoizedState=at}}function wde(p,b){if(typeof p!="function")throw Error(n(191,p));p.call(b)}function Cde(p,b){var y=p.callbacks;if(y!==null)for(p.callbacks=null,p=0;pM?M:8;var q=z.T,ee={};z.T=ee,zV(p,!1,b,y);try{var me=A(),Be=z.S;if(Be!==null&&Be(ee,me),me!==null&&typeof me=="object"&&typeof me.then=="function"){var et=mje(me,N);$D(p,b,et,Yd(p))}else $D(p,b,N,Yd(p))}catch(at){$D(p,b,{then:function(){},status:"rejected",reason:at},Yd())}finally{G.p=M,q!==null&&ee.types!==null&&(q.types=ee.types),z.T=q}}function wje(){}function WV(p,b,y,N){if(p.tag!==5)throw Error(n(476));var A=tue(p).queue;eue(p,A,b,ne,y===null?wje:function(){return nue(p),y(N)})}function tue(p){var b=p.memoizedState;if(b!==null)return b;b={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fp,lastRenderedState:ne},next:null};var y={};return b.next={memoizedState:y,baseState:y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fp,lastRenderedState:y},next:null},p.memoizedState=b,p=p.alternate,p!==null&&(p.memoizedState=b),b}function nue(p){var b=tue(p);b.next===null&&(b=p.alternate.memoizedState),$D(p,b.next.queue,{},Yd())}function VV(){return dl(lT)}function iue(){return Mo().memoizedState}function sue(){return Mo().memoizedState}function Cje(p){for(var b=p.return;b!==null;){switch(b.tag){case 24:case 3:var y=Yd();p=lx(y);var N=cx(b,p,y);N!==null&&(Zc(N,b,y),HD(N,b,y)),b={cache:bV()},p.payload=b;return}b=b.return}}function Sje(p,b,y){var N=Yd();y={lane:N,revertLane:0,gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},DO(p)?oue(b,y):(y=oV(p,b,y,N),y!==null&&(Zc(y,p,N),aue(y,b,N)))}function rue(p,b,y){var N=Yd();$D(p,b,y,N)}function $D(p,b,y,N){var A={lane:N,revertLane:0,gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null};if(DO(p))oue(b,A);else{var M=p.alternate;if(p.lanes===0&&(M===null||M.lanes===0)&&(M=b.lastRenderedReducer,M!==null))try{var q=b.lastRenderedState,ee=M(q,y);if(A.hasEagerState=!0,A.eagerState=ee,zd(ee,q))return cO(p,b,A,0),wr===null&&lO(),!1}catch{}finally{}if(y=oV(p,b,A,N),y!==null)return Zc(y,p,N),aue(y,b,N),!0}return!1}function zV(p,b,y,N){if(N={lane:2,revertLane:yz(),gesture:null,action:N,hasEagerState:!1,eagerState:null,next:null},DO(p)){if(b)throw Error(n(479))}else b=oV(p,y,N,2),b!==null&&Zc(b,p,2)}function DO(p){var b=p.alternate;return p===ci||b!==null&&b===ci}function oue(p,b){gS=wO=!0;var y=p.pending;y===null?b.next=b:(b.next=y.next,y.next=b),p.pending=b}function aue(p,b,y){if((y&4194048)!==0){var N=b.lanes;N&=p.pendingLanes,y|=N,b.lanes=y,Bs(p,y)}}var qD={readContext:dl,use:kO,useCallback:xo,useContext:xo,useEffect:xo,useImperativeHandle:xo,useLayoutEffect:xo,useInsertionEffect:xo,useMemo:xo,useReducer:xo,useRef:xo,useState:xo,useDebugValue:xo,useDeferredValue:xo,useTransition:xo,useSyncExternalStore:xo,useId:xo,useHostTransitionStatus:xo,useFormState:xo,useActionState:xo,useOptimistic:xo,useMemoCache:xo,useCacheRefresh:xo};qD.useEffectEvent=xo;var lue={readContext:dl,use:kO,useCallback:function(p,b){return fc().memoizedState=[p,b===void 0?null:b],p},useContext:dl,useEffect:$de,useImperativeHandle:function(p,b,y){y=y!=null?y.concat([p]):null,EO(4194308,4,Yde.bind(null,b,p),y)},useLayoutEffect:function(p,b){return EO(4194308,4,p,b)},useInsertionEffect:function(p,b){EO(4,2,p,b)},useMemo:function(p,b){var y=fc();b=b===void 0?null:b;var N=p();if(k0){wi(!0);try{p()}finally{wi(!1)}}return y.memoizedState=[N,b],N},useReducer:function(p,b,y){var N=fc();if(y!==void 0){var A=y(b);if(k0){wi(!0);try{y(b)}finally{wi(!1)}}}else A=b;return N.memoizedState=N.baseState=A,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:p,lastRenderedState:A},N.queue=p,p=p.dispatch=Sje.bind(null,ci,p),[N.memoizedState,p]},useRef:function(p){var b=fc();return p={current:p},b.memoizedState=p},useState:function(p){p=OV(p);var b=p.queue,y=rue.bind(null,ci,b);return b.dispatch=y,[p.memoizedState,y]},useDebugValue:BV,useDeferredValue:function(p,b){var y=fc();return HV(y,p,b)},useTransition:function(){var p=OV(!1);return p=eue.bind(null,ci,p.queue,!0,!1),fc().memoizedState=p,[!1,p]},useSyncExternalStore:function(p,b,y){var N=ci,A=fc();if(Zi){if(y===void 0)throw Error(n(407));y=y()}else{if(y=b(),wr===null)throw Error(n(349));($i&127)!==0||Dde(N,b,y)}A.memoizedState=y;var M={value:y,getSnapshot:b};return A.queue=M,$de(Ide.bind(null,N,M,p),[p]),N.flags|=2048,pS(9,{destroy:void 0},Tde.bind(null,N,M,y,b),null),y},useId:function(){var p=fc(),b=wr.identifierPrefix;if(Zi){var y=Wg,N=Hg;y=(N&~(1<<32-ii(N)-1)).toString(32)+y,b="_"+b+"R_"+y,y=CO++,0<\/script>",M=M.removeChild(M.firstChild);break;case"select":M=typeof N.is=="string"?q.createElement("select",{is:N.is}):q.createElement("select"),N.multiple?M.multiple=!0:N.size&&(M.size=N.size);break;default:M=typeof N.is=="string"?q.createElement(A,{is:N.is}):q.createElement(A)}}M[Ds]=b,M[yr]=N;e:for(q=b.child;q!==null;){if(q.tag===5||q.tag===6)M.appendChild(q.stateNode);else if(q.tag!==4&&q.tag!==27&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===b)break e;for(;q.sibling===null;){if(q.return===null||q.return===b)break e;q=q.return}q.sibling.return=q.return,q=q.sibling}b.stateNode=M;e:switch(hl(M,A,N),A){case"button":case"input":case"select":case"textarea":N=!!N.autoFocus;break e;case"img":N=!0;break e;default:N=!1}N&&Hp(b)}}return Fr(b),iz(b,b.type,p===null?null:p.memoizedProps,b.pendingProps,y),null;case 6:if(p&&b.stateNode!=null)p.memoizedProps!==N&&Hp(b);else{if(typeof N!="string"&&b.stateNode===null)throw Error(n(166));if(p=Te.current,oS(b)){if(p=b.stateNode,y=b.memoizedProps,N=null,A=cl,A!==null)switch(A.tag){case 27:case 5:N=A.memoizedProps}p[Ds]=b,p=!!(p.nodeValue===y||N!==null&&N.suppressHydrationWarning===!0||Ehe(p.nodeValue,y)),p||rx(b,!0)}else p=YO(p).createTextNode(N),p[Ds]=b,b.stateNode=p}return Fr(b),null;case 31:if(y=b.memoizedState,p===null||p.memoizedState!==null){if(N=oS(b),y!==null){if(p===null){if(!N)throw Error(n(318));if(p=b.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(n(557));p[Ds]=b}else x0(),(b.flags&128)===0&&(b.memoizedState=null),b.flags|=4;Fr(b),p=!1}else y=gV(),p!==null&&p.memoizedState!==null&&(p.memoizedState.hydrationErrors=y),p=!0;if(!p)return b.flags&256?(qd(b),b):(qd(b),null);if((b.flags&128)!==0)throw Error(n(558))}return Fr(b),null;case 13:if(N=b.memoizedState,p===null||p.memoizedState!==null&&p.memoizedState.dehydrated!==null){if(A=oS(b),N!==null&&N.dehydrated!==null){if(p===null){if(!A)throw Error(n(318));if(A=b.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(n(317));A[Ds]=b}else x0(),(b.flags&128)===0&&(b.memoizedState=null),b.flags|=4;Fr(b),A=!1}else A=gV(),p!==null&&p.memoizedState!==null&&(p.memoizedState.hydrationErrors=A),A=!0;if(!A)return b.flags&256?(qd(b),b):(qd(b),null)}return qd(b),(b.flags&128)!==0?(b.lanes=y,b):(y=N!==null,p=p!==null&&p.memoizedState!==null,y&&(N=b.child,A=null,N.alternate!==null&&N.alternate.memoizedState!==null&&N.alternate.memoizedState.cachePool!==null&&(A=N.alternate.memoizedState.cachePool.pool),M=null,N.memoizedState!==null&&N.memoizedState.cachePool!==null&&(M=N.memoizedState.cachePool.pool),M!==A&&(N.flags|=2048)),y!==p&&y&&(b.child.flags|=8192),MO(b,b.updateQueue),Fr(b),null);case 4:return _e(),p===null&&kz(b.stateNode.containerInfo),Fr(b),null;case 10:return Op(b.type),Fr(b),null;case 19:if(Y(Ro),N=b.memoizedState,N===null)return Fr(b),null;if(A=(b.flags&128)!==0,M=N.rendering,M===null)if(A)GD(N,!1);else{if(vo!==0||p!==null&&(p.flags&128)!==0)for(p=b.child;p!==null;){if(M=yO(p),M!==null){for(b.flags|=128,GD(N,!1),p=M.updateQueue,b.updateQueue=p,MO(b,p),b.subtreeFlags=0,p=y,y=b.child;y!==null;)rde(y,p),y=y.sibling;return V(Ro,Ro.current&1|2),Zi&&Mp(b,N.treeForkCount),b.child}p=p.sibling}N.tail!==null&&Fs()>BO&&(b.flags|=128,A=!0,GD(N,!1),b.lanes=4194304)}else{if(!A)if(p=yO(M),p!==null){if(b.flags|=128,A=!0,p=p.updateQueue,b.updateQueue=p,MO(b,p),GD(N,!0),N.tail===null&&N.tailMode==="hidden"&&!M.alternate&&!Zi)return Fr(b),null}else 2*Fs()-N.renderingStartTime>BO&&y!==536870912&&(b.flags|=128,A=!0,GD(N,!1),b.lanes=4194304);N.isBackwards?(M.sibling=b.child,b.child=M):(p=N.last,p!==null?p.sibling=M:b.child=M,N.last=M)}return N.tail!==null?(p=N.tail,N.rendering=p,N.tail=p.sibling,N.renderingStartTime=Fs(),p.sibling=null,y=Ro.current,V(Ro,A?y&1|2:y&1),Zi&&Mp(b,N.treeForkCount),p):(Fr(b),null);case 22:case 23:return qd(b),NV(),N=b.memoizedState!==null,p!==null?p.memoizedState!==null!==N&&(b.flags|=8192):N&&(b.flags|=8192),N?(y&536870912)!==0&&(b.flags&128)===0&&(Fr(b),b.subtreeFlags&6&&(b.flags|=8192)):Fr(b),y=b.updateQueue,y!==null&&MO(b,y.retryQueue),y=null,p!==null&&p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(y=p.memoizedState.cachePool.pool),N=null,b.memoizedState!==null&&b.memoizedState.cachePool!==null&&(N=b.memoizedState.cachePool.pool),N!==y&&(b.flags|=2048),p!==null&&Y(y0),null;case 24:return y=null,p!==null&&(y=p.memoizedState.cache),b.memoizedState.cache!==y&&(b.flags|=2048),Op(Go),Fr(b),null;case 25:return null;case 30:return null}throw Error(n(156,b.tag))}function Dje(p,b){switch(uV(b),b.tag){case 1:return p=b.flags,p&65536?(b.flags=p&-65537|128,b):null;case 3:return Op(Go),_e(),p=b.flags,(p&65536)!==0&&(p&128)===0?(b.flags=p&-65537|128,b):null;case 26:case 27:case 5:return Ke(b),null;case 31:if(b.memoizedState!==null){if(qd(b),b.alternate===null)throw Error(n(340));x0()}return p=b.flags,p&65536?(b.flags=p&-65537|128,b):null;case 13:if(qd(b),p=b.memoizedState,p!==null&&p.dehydrated!==null){if(b.alternate===null)throw Error(n(340));x0()}return p=b.flags,p&65536?(b.flags=p&-65537|128,b):null;case 19:return Y(Ro),null;case 4:return _e(),null;case 10:return Op(b.type),null;case 22:case 23:return qd(b),NV(),p!==null&&Y(y0),p=b.flags,p&65536?(b.flags=p&-65537|128,b):null;case 24:return Op(Go),null;case 25:return null;default:return null}}function Aue(p,b){switch(uV(b),b.tag){case 3:Op(Go),_e();break;case 26:case 27:case 5:Ke(b);break;case 4:_e();break;case 31:b.memoizedState!==null&&qd(b);break;case 13:qd(b);break;case 19:Y(Ro);break;case 10:Op(b.type);break;case 22:case 23:qd(b),NV(),p!==null&&Y(y0);break;case 24:Op(Go)}}function YD(p,b){try{var y=b.updateQueue,N=y!==null?y.lastEffect:null;if(N!==null){var A=N.next;y=A;do{if((y.tag&p)===p){N=void 0;var M=y.create,q=y.inst;N=M(),q.destroy=N}y=y.next}while(y!==A)}}catch(ee){tr(b,b.return,ee)}}function hx(p,b,y){try{var N=b.updateQueue,A=N!==null?N.lastEffect:null;if(A!==null){var M=A.next;N=M;do{if((N.tag&p)===p){var q=N.inst,ee=q.destroy;if(ee!==void 0){q.destroy=void 0,A=b;var me=y,Be=ee;try{Be()}catch(et){tr(A,me,et)}}}N=N.next}while(N!==M)}}catch(et){tr(b,b.return,et)}}function Rue(p){var b=p.updateQueue;if(b!==null){var y=p.stateNode;try{Cde(b,y)}catch(N){tr(p,p.return,N)}}}function Mue(p,b,y){y.props=N0(p.type,p.memoizedProps),y.state=p.memoizedState;try{y.componentWillUnmount()}catch(N){tr(p,b,N)}}function QD(p,b){try{var y=p.ref;if(y!==null){switch(p.tag){case 26:case 27:case 5:var N=p.stateNode;break;case 30:N=p.stateNode;break;default:N=p.stateNode}typeof y=="function"?p.refCleanup=y(N):y.current=N}}catch(A){tr(p,b,A)}}function Vg(p,b){var y=p.ref,N=p.refCleanup;if(y!==null)if(typeof N=="function")try{N()}catch(A){tr(p,b,A)}finally{p.refCleanup=null,p=p.alternate,p!=null&&(p.refCleanup=null)}else if(typeof y=="function")try{y(null)}catch(A){tr(p,b,A)}else y.current=null}function Pue(p){var b=p.type,y=p.memoizedProps,N=p.stateNode;try{e:switch(b){case"button":case"input":case"select":case"textarea":y.autoFocus&&N.focus();break e;case"img":y.src?N.src=y.src:y.srcSet&&(N.srcset=y.srcSet)}}catch(A){tr(p,p.return,A)}}function sz(p,b,y){try{var N=p.stateNode;Xje(N,p.type,y,b),N[yr]=b}catch(A){tr(p,p.return,A)}}function Oue(p){return p.tag===5||p.tag===3||p.tag===26||p.tag===27&&vx(p.type)||p.tag===4}function rz(p){e:for(;;){for(;p.sibling===null;){if(p.return===null||Oue(p.return))return null;p=p.return}for(p.sibling.return=p.return,p=p.sibling;p.tag!==5&&p.tag!==6&&p.tag!==18;){if(p.tag===27&&vx(p.type)||p.flags&2||p.child===null||p.tag===4)continue e;p.child.return=p,p=p.child}if(!(p.flags&2))return p.stateNode}}function oz(p,b,y){var N=p.tag;if(N===5||N===6)p=p.stateNode,b?(y.nodeType===9?y.body:y.nodeName==="HTML"?y.ownerDocument.body:y).insertBefore(p,b):(b=y.nodeType===9?y.body:y.nodeName==="HTML"?y.ownerDocument.body:y,b.appendChild(p),y=y._reactRootContainer,y!=null||b.onclick!==null||(b.onclick=Ip));else if(N!==4&&(N===27&&vx(p.type)&&(y=p.stateNode,b=null),p=p.child,p!==null))for(oz(p,b,y),p=p.sibling;p!==null;)oz(p,b,y),p=p.sibling}function PO(p,b,y){var N=p.tag;if(N===5||N===6)p=p.stateNode,b?y.insertBefore(p,b):y.appendChild(p);else if(N!==4&&(N===27&&vx(p.type)&&(y=p.stateNode),p=p.child,p!==null))for(PO(p,b,y),p=p.sibling;p!==null;)PO(p,b,y),p=p.sibling}function jue(p){var b=p.stateNode,y=p.memoizedProps;try{for(var N=p.type,A=b.attributes;A.length;)b.removeAttributeNode(A[0]);hl(b,N,y),b[Ds]=p,b[yr]=y}catch(M){tr(p,p.return,M)}}var Wp=!1,Xo=!1,az=!1,Fue=typeof WeakSet=="function"?WeakSet:Set,ja=null;function Tje(p,b){if(p=p.containerInfo,Lz=n5,p=Qce(p),eV(p)){if("selectionStart"in p)var y={start:p.selectionStart,end:p.selectionEnd};else e:{y=(y=p.ownerDocument)&&y.defaultView||window;var N=y.getSelection&&y.getSelection();if(N&&N.rangeCount!==0){y=N.anchorNode;var A=N.anchorOffset,M=N.focusNode;N=N.focusOffset;try{y.nodeType,M.nodeType}catch{y=null;break e}var q=0,ee=-1,me=-1,Be=0,et=0,at=p,Ue=null;t:for(;;){for(var Ye;at!==y||A!==0&&at.nodeType!==3||(ee=q+A),at!==M||N!==0&&at.nodeType!==3||(me=q+N),at.nodeType===3&&(q+=at.nodeValue.length),(Ye=at.firstChild)!==null;)Ue=at,at=Ye;for(;;){if(at===p)break t;if(Ue===y&&++Be===A&&(ee=q),Ue===M&&++et===N&&(me=q),(Ye=at.nextSibling)!==null)break;at=Ue,Ue=at.parentNode}at=Ye}y=ee===-1||me===-1?null:{start:ee,end:me}}else y=null}y=y||{start:0,end:0}}else y=null;for(Dz={focusedElem:p,selectionRange:y},n5=!1,ja=b;ja!==null;)if(b=ja,p=b.child,(b.subtreeFlags&1028)!==0&&p!==null)p.return=b,ja=p;else for(;ja!==null;){switch(b=ja,M=b.alternate,p=b.flags,b.tag){case 0:if((p&4)!==0&&(p=b.updateQueue,p=p!==null?p.events:null,p!==null))for(y=0;y title"))),hl(M,N,y),M[Ds]=p,Bn(M),N=M;break e;case"link":var q=Uhe("link","href",A).get(N+(y.href||""));if(q){for(var ee=0;eeur&&(q=ur,ur=Pn,Pn=q);var De=Gce(ee,Pn),ke=Gce(ee,ur);if(De&&ke&&(Ye.rangeCount!==1||Ye.anchorNode!==De.node||Ye.anchorOffset!==De.offset||Ye.focusNode!==ke.node||Ye.focusOffset!==ke.offset)){var Fe=at.createRange();Fe.setStart(De.node,De.offset),Ye.removeAllRanges(),Pn>ur?(Ye.addRange(Fe),Ye.extend(ke.node,ke.offset)):(Fe.setEnd(ke.node,ke.offset),Ye.addRange(Fe))}}}}for(at=[],Ye=ee;Ye=Ye.parentNode;)Ye.nodeType===1&&at.push({element:Ye,left:Ye.scrollLeft,top:Ye.scrollTop});for(typeof ee.focus=="function"&&ee.focus(),ee=0;eey?32:y,z.T=null,y=fz,fz=null;var M=mx,q=qp;if(va=0,_S=mx=null,qp=0,(Ts&6)!==0)throw Error(n(331));var ee=Ts;if(Ts|=4,Yue(M.current),que(M,M.current,q,y),Ts=ee,nT(0,!1),Ei&&typeof Ei.onPostCommitFiberRoot=="function")try{Ei.onPostCommitFiberRoot(Js,M)}catch{}return!0}finally{G.p=A,z.T=N,ghe(p,b)}}function phe(p,b,y){b=Vu(y,b),b=KV(p.stateNode,b,2),p=cx(p,b,2),p!==null&&(Ii(p,2),zg(p))}function tr(p,b,y){if(p.tag===3)phe(p,p,y);else for(;b!==null;){if(b.tag===3){phe(b,p,y);break}else if(b.tag===1){var N=b.stateNode;if(typeof b.type.getDerivedStateFromError=="function"||typeof N.componentDidCatch=="function"&&(px===null||!px.has(N))){p=Vu(y,p),y=mue(2),N=cx(b,y,2),N!==null&&(bue(y,N,b,p),Ii(N,2),zg(N));break}}b=b.return}}function xz(p,b,y){var N=p.pingCache;if(N===null){N=p.pingCache=new Rje;var A=new Set;N.set(b,A)}else A=N.get(b),A===void 0&&(A=new Set,N.set(b,A));A.has(y)||(dz=!0,A.add(y),p=Fje.bind(null,p,b,y),b.then(p,p))}function Fje(p,b,y){var N=p.pingCache;N!==null&&N.delete(b),p.pingedLanes|=p.suspendedLanes&y,p.warmLanes&=~y,wr===p&&($i&y)===y&&(vo===4||vo===3&&($i&62914560)===$i&&300>Fs()-FO?(Ts&2)===0&&yS(p,0):uz|=y,vS===$i&&(vS=0)),zg(p)}function mhe(p,b){b===0&&(b=Ci()),p=m0(p,b),p!==null&&(Ii(p,b),zg(p))}function Bje(p){var b=p.memoizedState,y=0;b!==null&&(y=b.retryLane),mhe(p,y)}function Hje(p,b){var y=0;switch(p.tag){case 31:case 13:var N=p.stateNode,A=p.memoizedState;A!==null&&(y=A.retryLane);break;case 19:N=p.stateNode;break;case 22:N=p.stateNode._retryCache;break;default:throw Error(n(314))}N!==null&&N.delete(b),mhe(p,y)}function Wje(p,b){return En(p,b)}var $O=null,CS=null,vz=!1,qO=!1,_z=!1,xx=0;function zg(p){p!==CS&&p.next===null&&(CS===null?$O=CS=p:CS=CS.next=p),qO=!0,vz||(vz=!0,zje())}function nT(p,b){if(!_z&&qO){_z=!0;do for(var y=!1,N=$O;N!==null;){if(p!==0){var A=N.pendingLanes;if(A===0)var M=0;else{var q=N.suspendedLanes,ee=N.pingedLanes;M=(1<<31-ii(42|p)+1)-1,M&=A&~(q&~ee),M=M&201326741?M&201326741|1:M?M|2:0}M!==0&&(y=!0,_he(N,M))}else M=$i,M=on(N,N===wr?M:0,N.cancelPendingCommit!==null||N.timeoutHandle!==-1),(M&3)===0||Nn(N,M)||(y=!0,_he(N,M));N=N.next}while(y);_z=!1}}function Vje(){bhe()}function bhe(){qO=vz=!1;var p=0;xx!==0&&Jje()&&(p=xx);for(var b=Fs(),y=null,N=$O;N!==null;){var A=N.next,M=xhe(N,b);M===0?(N.next=null,y===null?$O=A:y.next=A,A===null&&(CS=y)):(y=N,(p!==0||(M&3)!==0)&&(qO=!0)),N=A}va!==0&&va!==5||nT(p),xx!==0&&(xx=0)}function xhe(p,b){for(var y=p.suspendedLanes,N=p.pingedLanes,A=p.expirationTimes,M=p.pendingLanes&-62914561;0ee)break;var et=me.transferSize,at=me.initiatorType;et&&Lhe(at)&&(me=me.responseEnd,q+=et*(me"u"?null:document;function Hhe(p,b,y){var N=SS;if(N&&typeof b=="string"&&b){var A=Hu(b);A='link[rel="'+p+'"][href="'+A+'"]',typeof y=="string"&&(A+='[crossorigin="'+y+'"]'),Bhe.has(A)||(Bhe.add(A),p={rel:p,crossOrigin:y,href:b},N.querySelector(A)===null&&(b=N.createElement("link"),hl(b,"link",p),Bn(b),N.head.appendChild(b)))}}function lFe(p){Kp.D(p),Hhe("dns-prefetch",p,null)}function cFe(p,b){Kp.C(p,b),Hhe("preconnect",p,b)}function dFe(p,b,y){Kp.L(p,b,y);var N=SS;if(N&&p&&b){var A='link[rel="preload"][as="'+Hu(b)+'"]';b==="image"&&y&&y.imageSrcSet?(A+='[imagesrcset="'+Hu(y.imageSrcSet)+'"]',typeof y.imageSizes=="string"&&(A+='[imagesizes="'+Hu(y.imageSizes)+'"]')):A+='[href="'+Hu(p)+'"]';var M=A;switch(b){case"style":M=kS(p);break;case"script":M=NS(p)}Gu.has(M)||(p=h({rel:"preload",href:b==="image"&&y&&y.imageSrcSet?void 0:p,as:b},y),Gu.set(M,p),N.querySelector(A)!==null||b==="style"&&N.querySelector(oT(M))||b==="script"&&N.querySelector(aT(M))||(b=N.createElement("link"),hl(b,"link",p),Bn(b),N.head.appendChild(b)))}}function uFe(p,b){Kp.m(p,b);var y=SS;if(y&&p){var N=b&&typeof b.as=="string"?b.as:"script",A='link[rel="modulepreload"][as="'+Hu(N)+'"][href="'+Hu(p)+'"]',M=A;switch(N){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":M=NS(p)}if(!Gu.has(M)&&(p=h({rel:"modulepreload",href:p},b),Gu.set(M,p),y.querySelector(A)===null)){switch(N){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(y.querySelector(aT(M)))return}N=y.createElement("link"),hl(N,"link",p),Bn(N),y.head.appendChild(N)}}}function hFe(p,b,y){Kp.S(p,b,y);var N=SS;if(N&&p){var A=Tn(N).hoistableStyles,M=kS(p);b=b||"default";var q=A.get(M);if(!q){var ee={loading:0,preload:null};if(q=N.querySelector(oT(M)))ee.loading=5;else{p=h({rel:"stylesheet",href:p,"data-precedence":b},y),(y=Gu.get(M))&&Oz(p,y);var me=q=N.createElement("link");Bn(me),hl(me,"link",p),me._p=new Promise(function(Be,et){me.onload=Be,me.onerror=et}),me.addEventListener("load",function(){ee.loading|=1}),me.addEventListener("error",function(){ee.loading|=2}),ee.loading|=4,XO(q,b,N)}q={type:"stylesheet",instance:q,count:1,state:ee},A.set(M,q)}}}function gFe(p,b){Kp.X(p,b);var y=SS;if(y&&p){var N=Tn(y).hoistableScripts,A=NS(p),M=N.get(A);M||(M=y.querySelector(aT(A)),M||(p=h({src:p,async:!0},b),(b=Gu.get(A))&&jz(p,b),M=y.createElement("script"),Bn(M),hl(M,"link",p),y.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},N.set(A,M))}}function fFe(p,b){Kp.M(p,b);var y=SS;if(y&&p){var N=Tn(y).hoistableScripts,A=NS(p),M=N.get(A);M||(M=y.querySelector(aT(A)),M||(p=h({src:p,async:!0,type:"module"},b),(b=Gu.get(A))&&jz(p,b),M=y.createElement("script"),Bn(M),hl(M,"link",p),y.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},N.set(A,M))}}function Whe(p,b,y,N){var A=(A=Te.current)?QO(A):null;if(!A)throw Error(n(446));switch(p){case"meta":case"title":return null;case"style":return typeof y.precedence=="string"&&typeof y.href=="string"?(b=kS(y.href),y=Tn(A).hoistableStyles,N=y.get(b),N||(N={type:"style",instance:null,count:0,state:null},y.set(b,N)),N):{type:"void",instance:null,count:0,state:null};case"link":if(y.rel==="stylesheet"&&typeof y.href=="string"&&typeof y.precedence=="string"){p=kS(y.href);var M=Tn(A).hoistableStyles,q=M.get(p);if(q||(A=A.ownerDocument||A,q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},M.set(p,q),(M=A.querySelector(oT(p)))&&!M._p&&(q.instance=M,q.state.loading=5),Gu.has(p)||(y={rel:"preload",as:"style",href:y.href,crossOrigin:y.crossOrigin,integrity:y.integrity,media:y.media,hrefLang:y.hrefLang,referrerPolicy:y.referrerPolicy},Gu.set(p,y),M||pFe(A,p,y,q.state))),b&&N===null)throw Error(n(528,""));return q}if(b&&N!==null)throw Error(n(529,""));return null;case"script":return b=y.async,y=y.src,typeof y=="string"&&b&&typeof b!="function"&&typeof b!="symbol"?(b=NS(y),y=Tn(A).hoistableScripts,N=y.get(b),N||(N={type:"script",instance:null,count:0,state:null},y.set(b,N)),N):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,p))}}function kS(p){return'href="'+Hu(p)+'"'}function oT(p){return'link[rel="stylesheet"]['+p+"]"}function Vhe(p){return h({},p,{"data-precedence":p.precedence,precedence:null})}function pFe(p,b,y,N){p.querySelector('link[rel="preload"][as="style"]['+b+"]")?N.loading=1:(b=p.createElement("link"),N.preload=b,b.addEventListener("load",function(){return N.loading|=1}),b.addEventListener("error",function(){return N.loading|=2}),hl(b,"link",y),Bn(b),p.head.appendChild(b))}function NS(p){return'[src="'+Hu(p)+'"]'}function aT(p){return"script[async]"+p}function zhe(p,b,y){if(b.count++,b.instance===null)switch(b.type){case"style":var N=p.querySelector('style[data-href~="'+Hu(y.href)+'"]');if(N)return b.instance=N,Bn(N),N;var A=h({},y,{"data-href":y.href,"data-precedence":y.precedence,href:null,precedence:null});return N=(p.ownerDocument||p).createElement("style"),Bn(N),hl(N,"style",A),XO(N,y.precedence,p),b.instance=N;case"stylesheet":A=kS(y.href);var M=p.querySelector(oT(A));if(M)return b.state.loading|=4,b.instance=M,Bn(M),M;N=Vhe(y),(A=Gu.get(A))&&Oz(N,A),M=(p.ownerDocument||p).createElement("link"),Bn(M);var q=M;return q._p=new Promise(function(ee,me){q.onload=ee,q.onerror=me}),hl(M,"link",N),b.state.loading|=4,XO(M,y.precedence,p),b.instance=M;case"script":return M=NS(y.src),(A=p.querySelector(aT(M)))?(b.instance=A,Bn(A),A):(N=y,(A=Gu.get(M))&&(N=h({},y),jz(N,A)),p=p.ownerDocument||p,A=p.createElement("script"),Bn(A),hl(A,"link",N),p.head.appendChild(A),b.instance=A);case"void":return null;default:throw Error(n(443,b.type))}else b.type==="stylesheet"&&(b.state.loading&4)===0&&(N=b.instance,b.state.loading|=4,XO(N,y.precedence,p));return b.instance}function XO(p,b,y){for(var N=y.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=N.length?N[N.length-1]:null,M=A,q=0;q title"):null)}function mFe(p,b,y){if(y===1||b.itemProp!=null)return!1;switch(p){case"meta":case"title":return!0;case"style":if(typeof b.precedence!="string"||typeof b.href!="string"||b.href==="")break;return!0;case"link":if(typeof b.rel!="string"||typeof b.href!="string"||b.href===""||b.onLoad||b.onError)break;switch(b.rel){case"stylesheet":return p=b.disabled,typeof b.precedence=="string"&&p==null;default:return!0}case"script":if(b.async&&typeof b.async!="function"&&typeof b.async!="symbol"&&!b.onLoad&&!b.onError&&b.src&&typeof b.src=="string")return!0}return!1}function qhe(p){return!(p.type==="stylesheet"&&(p.state.loading&3)===0)}function bFe(p,b,y,N){if(y.type==="stylesheet"&&(typeof N.media!="string"||matchMedia(N.media).matches!==!1)&&(y.state.loading&4)===0){if(y.instance===null){var A=kS(N.href),M=b.querySelector(oT(A));if(M){b=M._p,b!==null&&typeof b=="object"&&typeof b.then=="function"&&(p.count++,p=JO.bind(p),b.then(p,p)),y.state.loading|=4,y.instance=M,Bn(M);return}M=b.ownerDocument||b,N=Vhe(N),(A=Gu.get(A))&&Oz(N,A),M=M.createElement("link"),Bn(M);var q=M;q._p=new Promise(function(ee,me){q.onload=ee,q.onerror=me}),hl(M,"link",N),y.instance=M}p.stylesheets===null&&(p.stylesheets=new Map),p.stylesheets.set(y,b),(b=y.state.preload)&&(y.state.loading&3)===0&&(p.count++,y=JO.bind(p),b.addEventListener("load",y),b.addEventListener("error",y))}}var Fz=0;function xFe(p,b){return p.stylesheets&&p.count===0&&t5(p,p.stylesheets),0Fz?50:800)+b);return p.unsuspend=y,function(){p.unsuspend=null,clearTimeout(N),clearTimeout(A)}}:null}function JO(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)t5(this,this.stylesheets);else if(this.unsuspend){var p=this.unsuspend;this.unsuspend=null,p()}}}var e5=null;function t5(p,b){p.stylesheets=null,p.unsuspend!==null&&(p.count++,e5=new Map,b.forEach(vFe,p),e5=null,JO.call(p))}function vFe(p,b){if(!(b.state.loading&4)){var y=e5.get(p);if(y)var N=y.get(null);else{y=new Map,e5.set(p,y);for(var A=p.querySelectorAll("link[data-precedence],style[data-precedence]"),M=0;M"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(e){console.error(e)}}return i(),Gz.exports=jFe(),Gz.exports}var BFe=FFe(),hg=DCe();const TCe=t7(hg);/**
- * @remix-run/router v1.23.2
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function uA(){return uA=Object.assign?Object.assign.bind():function(i){for(var e=1;e"u")throw new Error(e)}function yie(i,e){if(!i){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function WFe(){return Math.random().toString(36).substr(2,8)}function xge(i,e){return{usr:i.state,key:i.key,idx:e}}function LK(i,e,t,n){return t===void 0&&(t=null),uA({pathname:typeof i=="string"?i:i.pathname,search:"",hash:""},typeof e=="string"?DL(e):e,{state:t,key:e&&e.key||n||WFe()})}function pj(i){let{pathname:e="/",search:t="",hash:n=""}=i;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function DL(i){let e={};if(i){let t=i.indexOf("#");t>=0&&(e.hash=i.substr(t),i=i.substr(0,t));let n=i.indexOf("?");n>=0&&(e.search=i.substr(n),i=i.substr(0,n)),i&&(e.pathname=i)}return e}function VFe(i,e,t,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:r=!1}=n,o=s.history,a=_v.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(uA({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function h(){a=_v.Pop;let v=u(),_=v==null?null:v-c;c=v,l&&l({action:a,location:x.location,delta:_})}function g(v,_){a=_v.Push;let w=LK(x.location,v,_);c=u()+1;let k=xge(w,c),C=x.createHref(w);try{o.pushState(k,"",C)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(C)}r&&l&&l({action:a,location:x.location,delta:1})}function f(v,_){a=_v.Replace;let w=LK(x.location,v,_);c=u();let k=xge(w,c),C=x.createHref(w);o.replaceState(k,"",C),r&&l&&l({action:a,location:x.location,delta:0})}function m(v){let _=s.location.origin!=="null"?s.location.origin:s.location.href,w=typeof v=="string"?v:pj(v);return w=w.replace(/ $/,"%20"),co(_,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,_)}let x={get action(){return a},get location(){return i(s,o)},listen(v){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(bge,h),l=v,()=>{s.removeEventListener(bge,h),l=null}},createHref(v){return e(s,v)},createURL:m,encodeLocation(v){let _=m(v);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:g,replace:f,go(v){return o.go(v)}};return x}var vge;(function(i){i.data="data",i.deferred="deferred",i.redirect="redirect",i.error="error"})(vge||(vge={}));function zFe(i,e,t){return t===void 0&&(t="/"),UFe(i,e,t)}function UFe(i,e,t,n){let s=typeof e=="string"?DL(e):e,r=TE(s.pathname||"/",t);if(r==null)return null;let o=ICe(i);$Fe(o);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?r.path||"":a,caseSensitive:r.caseSensitive===!0,childrenIndex:o,route:r};l.relativePath.startsWith("/")&&(co(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=Wv([n,l.relativePath]),u=t.concat(l);r.children&&r.children.length>0&&(co(r.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),ICe(r.children,e,u,c)),!(r.path==null&&!r.index)&&e.push({path:c,score:ZFe(c,r.index),routesMeta:u})};return i.forEach((r,o)=>{var a;if(r.path===""||!((a=r.path)!=null&&a.includes("?")))s(r,o);else for(let l of ACe(r.path))s(r,o,l)}),e}function ACe(i){let e=i.split("/");if(e.length===0)return[];let[t,...n]=e,s=t.endsWith("?"),r=t.replace(/\?$/,"");if(n.length===0)return s?[r,""]:[r];let o=ACe(n.join("/")),a=[];return a.push(...o.map(l=>l===""?r:[r,l].join("/"))),s&&a.push(...o),a.map(l=>i.startsWith("/")&&l===""?"/":l)}function $Fe(i){i.sort((e,t)=>e.score!==t.score?t.score-e.score:JFe(e.routesMeta.map(n=>n.childrenIndex),t.routesMeta.map(n=>n.childrenIndex)))}const qFe=/^:[\w-]+$/,KFe=3,GFe=2,YFe=1,QFe=10,XFe=-2,_ge=i=>i==="*";function ZFe(i,e){let t=i.split("/"),n=t.length;return t.some(_ge)&&(n+=XFe),e&&(n+=GFe),t.filter(s=>!_ge(s)).reduce((s,r)=>s+(qFe.test(r)?KFe:r===""?YFe:QFe),n)}function JFe(i,e){return i.length===e.length&&i.slice(0,-1).every((n,s)=>n===e[s])?i[i.length-1]-e[e.length-1]:0}function e6e(i,e,t){let{routesMeta:n}=i,s={},r="/",o=[];for(let a=0;a{let{paramName:g,isOptional:f}=u;if(g==="*"){let x=a[h]||"";o=r.slice(0,r.length-x.length).replace(/(.)\/+$/,"$1")}const m=a[h];return f&&!m?c[g]=void 0:c[g]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:r,pathnameBase:o,pattern:i}}function t6e(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),yie(i==="*"||!i.endsWith("*")||i.endsWith("/*"),'Route path "'+i+'" will be treated as if it were '+('"'+i.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+i.replace(/\*$/,"/*")+'".'));let n=[],s="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return i.endsWith("*")?(n.push({paramName:"*"}),s+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?s+="\\/*$":i!==""&&i!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),n]}function n6e(i){try{return i.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return yie(!1,'The URL path "'+i+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),i}}function TE(i,e){if(e==="/")return i;if(!i.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,n=i.charAt(t);return n&&n!=="/"?null:i.slice(t)||"/"}const i6e=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,s6e=i=>i6e.test(i);function r6e(i,e){e===void 0&&(e="/");let{pathname:t,search:n="",hash:s=""}=typeof i=="string"?DL(i):i,r;if(t)if(s6e(t))r=t;else{if(t.includes("//")){let o=t;t=t.replace(/\/\/+/g,"/"),yie(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+t))}t.startsWith("/")?r=yge(t.substring(1),"/"):r=yge(t,e)}else r=e;return{pathname:r,search:l6e(n),hash:c6e(s)}}function yge(i,e){let t=e.replace(/\/+$/,"").split("/");return i.split("/").forEach(s=>{s===".."?t.length>1&&t.pop():s!=="."&&t.push(s)}),t.length>1?t.join("/"):"/"}function Zz(i,e,t,n){return"Cannot include a '"+i+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function o6e(i){return i.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function wie(i,e){let t=o6e(i);return e?t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase):t.map(n=>n.pathnameBase)}function Cie(i,e,t,n){n===void 0&&(n=!1);let s;typeof i=="string"?s=DL(i):(s=uA({},i),co(!s.pathname||!s.pathname.includes("?"),Zz("?","pathname","search",s)),co(!s.pathname||!s.pathname.includes("#"),Zz("#","pathname","hash",s)),co(!s.search||!s.search.includes("#"),Zz("#","search","hash",s)));let r=i===""||s.pathname==="",o=r?"/":s.pathname,a;if(o==null)a=t;else{let h=e.length-1;if(!n&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),h-=1;s.pathname=g.join("/")}a=h>=0?e[h]:"/"}let l=r6e(s,a),c=o&&o!=="/"&&o.endsWith("/"),u=(r||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Wv=i=>i.join("/").replace(/\/\/+/g,"/"),a6e=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),l6e=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,c6e=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i;function d6e(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}const RCe=["post","put","patch","delete"];new Set(RCe);const u6e=["get",...RCe];new Set(u6e);/**
- * React Router v6.30.3
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function hA(){return hA=Object.assign?Object.assign.bind():function(i){for(var e=1;e{a.current=!0}),L.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){n.go(c);return}let h=Cie(c,JSON.parse(o),r,u.relative==="path");i==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Wv([e,h.pathname])),(u.replace?n.replace:n.push)(h,u.state,u)},[e,n,o,r,i])}const f6e=L.createContext(null);function p6e(i){let e=L.useContext(pp).outlet;return e&&L.createElement(f6e.Provider,{value:i},e)}function K_(){let{matches:i}=L.useContext(pp),e=i[i.length-1];return e?e.params:{}}function r7(i,e){let{relative:t}=e===void 0?{}:e,{future:n}=L.useContext(Wb),{matches:s}=L.useContext(pp),{pathname:r}=mp(),o=JSON.stringify(wie(s,n.v7_relativeSplatPath));return L.useMemo(()=>Cie(i,JSON.parse(o),r,t==="path"),[i,o,r,t])}function m6e(i,e){return b6e(i,e)}function b6e(i,e,t,n){TL()||co(!1);let{navigator:s}=L.useContext(Wb),{matches:r}=L.useContext(pp),o=r[r.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=mp(),u;if(e){var h;let v=typeof e=="string"?DL(e):e;l==="/"||(h=v.pathname)!=null&&h.startsWith(l)||co(!1),u=v}else u=c;let g=u.pathname||"/",f=g;if(l!=="/"){let v=l.replace(/^\//,"").split("/");f="/"+g.replace(/^\//,"").split("/").slice(v.length).join("/")}let m=zFe(i,{pathname:f}),x=w6e(m&&m.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:Wv([l,s.encodeLocation?s.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:Wv([l,s.encodeLocation?s.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),r,t,n);return e&&x?L.createElement(s7.Provider,{value:{location:hA({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:_v.Pop}},x):x}function x6e(){let i=N6e(),e=d6e(i)?i.status+" "+i.statusText:i instanceof Error?i.message:JSON.stringify(i),t=i instanceof Error?i.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},e),t?L.createElement("pre",{style:s},t):null,null)}const v6e=L.createElement(x6e,null);class _6e extends L.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?L.createElement(pp.Provider,{value:this.props.routeContext},L.createElement(PCe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function y6e(i){let{routeContext:e,match:t,children:n}=i,s=L.useContext(i7);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),L.createElement(pp.Provider,{value:e},n)}function w6e(i,e,t,n){var s;if(e===void 0&&(e=[]),t===void 0&&(t=null),n===void 0&&(n=null),i==null){var r;if(!t)return null;if(t.errors)i=t.matches;else if((r=n)!=null&&r.v7_partialHydration&&e.length===0&&!t.initialized&&t.matches.length>0)i=t.matches;else return null}let o=i,a=(s=t)==null?void 0:s.errors;if(a!=null){let u=o.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);u>=0||co(!1),o=o.slice(0,Math.min(o.length,u+1))}let l=!1,c=-1;if(t&&n&&n.v7_partialHydration)for(let u=0;u=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((u,h,g)=>{let f,m=!1,x=null,v=null;t&&(f=a&&h.route.id?a[h.route.id]:void 0,x=h.route.errorElement||v6e,l&&(c<0&&g===0?(L6e("route-fallback"),m=!0,v=null):c===g&&(m=!0,v=h.route.hydrateFallbackElement||null)));let _=e.concat(o.slice(0,g+1)),w=()=>{let k;return f?k=x:m?k=v:h.route.Component?k=L.createElement(h.route.Component,null):h.route.element?k=h.route.element:k=u,L.createElement(y6e,{match:h,routeContext:{outlet:u,matches:_,isDataRoute:t!=null},children:k})};return t&&(h.route.ErrorBoundary||h.route.errorElement||g===0)?L.createElement(_6e,{location:t.location,revalidation:t.revalidation,component:x,error:f,children:w(),routeContext:{outlet:null,matches:_,isDataRoute:!0}}):w()},null)}var jCe=(function(i){return i.UseBlocker="useBlocker",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i})(jCe||{}),FCe=(function(i){return i.UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i.UseRouteId="useRouteId",i})(FCe||{});function C6e(i){let e=L.useContext(i7);return e||co(!1),e}function S6e(i){let e=L.useContext(MCe);return e||co(!1),e}function k6e(i){let e=L.useContext(pp);return e||co(!1),e}function BCe(i){let e=k6e(),t=e.matches[e.matches.length-1];return t.route.id||co(!1),t.route.id}function N6e(){var i;let e=L.useContext(PCe),t=S6e(),n=BCe();return e!==void 0?e:(i=t.errors)==null?void 0:i[n]}function E6e(){let{router:i}=C6e(jCe.UseNavigateStable),e=BCe(FCe.UseNavigateStable),t=L.useRef(!1);return OCe(()=>{t.current=!0}),L.useCallback(function(s,r){r===void 0&&(r={}),t.current&&(typeof s=="number"?i.navigate(s):i.navigate(s,hA({fromRouteId:e},r)))},[i,e])}const wge={};function L6e(i,e,t){wge[i]||(wge[i]=!0)}function D6e(i,e){i==null||i.v7_startTransition,i==null||i.v7_relativeSplatPath}function fT(i){let{to:e,replace:t,state:n,relative:s}=i;TL()||co(!1);let{future:r,static:o}=L.useContext(Wb),{matches:a}=L.useContext(pp),{pathname:l}=mp(),c=il(),u=Cie(e,wie(a,r.v7_relativeSplatPath),l,s==="path"),h=JSON.stringify(u);return L.useEffect(()=>c(JSON.parse(h),{replace:t,state:n,relative:s}),[c,h,s,t,n]),null}function T6e(i){return p6e(i.context)}function Li(i){co(!1)}function I6e(i){let{basename:e="/",children:t=null,location:n,navigationType:s=_v.Pop,navigator:r,static:o=!1,future:a}=i;TL()&&co(!1);let l=e.replace(/^\/*/,"/"),c=L.useMemo(()=>({basename:l,navigator:r,static:o,future:hA({v7_relativeSplatPath:!1},a)}),[l,a,r,o]);typeof n=="string"&&(n=DL(n));let{pathname:u="/",search:h="",hash:g="",state:f=null,key:m="default"}=n,x=L.useMemo(()=>{let v=TE(u,l);return v==null?null:{location:{pathname:v,search:h,hash:g,state:f,key:m},navigationType:s}},[l,u,h,g,f,m,s]);return x==null?null:L.createElement(Wb.Provider,{value:c},L.createElement(s7.Provider,{children:t,value:x}))}function A6e(i){let{children:e,location:t}=i;return m6e(TK(e),t)}new Promise(()=>{});function TK(i,e){e===void 0&&(e=[]);let t=[];return L.Children.forEach(i,(n,s)=>{if(!L.isValidElement(n))return;let r=[...e,s];if(n.type===L.Fragment){t.push.apply(t,TK(n.props.children,r));return}n.type!==Li&&co(!1),!n.props.index||!n.props.children||co(!1);let o={id:n.props.id||r.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=TK(n.props.children,r)),t.push(o)}),t}/**
- * React Router DOM v6.30.3
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function mj(){return mj=Object.assign?Object.assign.bind():function(i){for(var e=1;e=0)&&(t[s]=i[s]);return t}function R6e(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function M6e(i,e){return i.button===0&&(!e||e==="_self")&&!R6e(i)}function IK(i){return i===void 0&&(i=""),new URLSearchParams(typeof i=="string"||Array.isArray(i)||i instanceof URLSearchParams?i:Object.keys(i).reduce((e,t)=>{let n=i[t];return e.concat(Array.isArray(n)?n.map(s=>[t,s]):[[t,n]])},[]))}function P6e(i,e){let t=IK(i);return e&&e.forEach((n,s)=>{t.has(s)||e.getAll(s).forEach(r=>{t.append(s,r)})}),t}const O6e=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],j6e=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],F6e="6";try{window.__reactRouterVersion=F6e}catch{}const B6e=L.createContext({isTransitioning:!1}),H6e="startTransition",Cge=n7[H6e];function W6e(i){let{basename:e,children:t,future:n,window:s}=i,r=L.useRef();r.current==null&&(r.current=HFe({window:s,v5Compat:!0}));let o=r.current,[a,l]=L.useState({action:o.action,location:o.location}),{v7_startTransition:c}=n||{},u=L.useCallback(h=>{c&&Cge?Cge(()=>l(h)):l(h)},[l,c]);return L.useLayoutEffect(()=>o.listen(u),[o,u]),L.useEffect(()=>D6e(n),[n]),L.createElement(I6e,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o,future:n})}const V6e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",z6e=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kn=L.forwardRef(function(e,t){let{onClick:n,relative:s,reloadDocument:r,replace:o,state:a,target:l,to:c,preventScrollReset:u,viewTransition:h}=e,g=HCe(e,O6e),{basename:f}=L.useContext(Wb),m,x=!1;if(typeof c=="string"&&z6e.test(c)&&(m=c,V6e))try{let k=new URL(window.location.href),C=c.startsWith("//")?new URL(k.protocol+c):new URL(c),E=TE(C.pathname,f);C.origin===k.origin&&E!=null?c=E+C.search+C.hash:x=!0}catch{}let v=h6e(c,{relative:s}),_=q6e(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:s,viewTransition:h});function w(k){n&&n(k),k.defaultPrevented||_(k)}return L.createElement("a",mj({},g,{href:m||v,onClick:x||r?n:w,ref:t,target:l}))}),U6e=L.forwardRef(function(e,t){let{"aria-current":n="page",caseSensitive:s=!1,className:r="",end:o=!1,style:a,to:l,viewTransition:c,children:u}=e,h=HCe(e,j6e),g=r7(l,{relative:h.relative}),f=mp(),m=L.useContext(MCe),{navigator:x,basename:v}=L.useContext(Wb),_=m!=null&&K6e(g)&&c===!0,w=x.encodeLocation?x.encodeLocation(g).pathname:g.pathname,k=f.pathname,C=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;s||(k=k.toLowerCase(),C=C?C.toLowerCase():null,w=w.toLowerCase()),C&&v&&(C=TE(C,v)||C);const E=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let D=k===w||!o&&k.startsWith(w)&&k.charAt(E)==="/",T=C!=null&&(C===w||!o&&C.startsWith(w)&&C.charAt(w.length)==="/"),I={isActive:D,isPending:T,isTransitioning:_},R=D?n:void 0,P;typeof r=="function"?P=r(I):P=[r,D?"active":null,T?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let j=typeof a=="function"?a(I):a;return L.createElement(Kn,mj({},h,{"aria-current":R,className:P,ref:t,style:j,to:l,viewTransition:c}),typeof u=="function"?u(I):u)});var AK;(function(i){i.UseScrollRestoration="useScrollRestoration",i.UseSubmit="useSubmit",i.UseSubmitFetcher="useSubmitFetcher",i.UseFetcher="useFetcher",i.useViewTransitionState="useViewTransitionState"})(AK||(AK={}));var Sge;(function(i){i.UseFetcher="useFetcher",i.UseFetchers="useFetchers",i.UseScrollRestoration="useScrollRestoration"})(Sge||(Sge={}));function $6e(i){let e=L.useContext(i7);return e||co(!1),e}function q6e(i,e){let{target:t,replace:n,state:s,preventScrollReset:r,relative:o,viewTransition:a}=e===void 0?{}:e,l=il(),c=mp(),u=r7(i,{relative:o});return L.useCallback(h=>{if(M6e(h,t)){h.preventDefault();let g=n!==void 0?n:pj(c)===pj(u);l(i,{replace:g,state:s,preventScrollReset:r,relative:o,viewTransition:a})}},[c,l,u,n,s,t,i,r,o,a])}function G_(i){let e=L.useRef(IK(i)),t=L.useRef(!1),n=mp(),s=L.useMemo(()=>P6e(n.search,t.current?null:e.current),[n.search]),r=il(),o=L.useCallback((a,l)=>{const c=IK(typeof a=="function"?a(s):a);t.current=!0,r("?"+c,l)},[r,s]);return[s,o]}function K6e(i,e){e===void 0&&(e={});let t=L.useContext(B6e);t==null&&co(!1);let{basename:n}=$6e(AK.useViewTransitionState),s=r7(i,{relative:e.relative});if(!t.isTransitioning)return!1;let r=TE(t.currentLocation.pathname,n)||t.currentLocation.pathname,o=TE(t.nextLocation.pathname,n)||t.nextLocation.pathname;return DK(s.pathname,o)!=null||DK(s.pathname,r)!=null}var bC=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(i){return this.listeners.add(i),this.onSubscribe(),()=>{this.listeners.delete(i),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},G6e={setTimeout:(i,e)=>setTimeout(i,e),clearTimeout:i=>clearTimeout(i),setInterval:(i,e)=>setInterval(i,e),clearInterval:i=>clearInterval(i)},dv,vie,gCe,Y6e=(gCe=class{constructor(){Ht(this,dv,G6e);Ht(this,vie,!1)}setTimeoutProvider(i){yt(this,dv,i)}setTimeout(i,e){return oe(this,dv).setTimeout(i,e)}clearTimeout(i){oe(this,dv).clearTimeout(i)}setInterval(i,e){return oe(this,dv).setInterval(i,e)}clearInterval(i){oe(this,dv).clearInterval(i)}},dv=new WeakMap,vie=new WeakMap,gCe),Py=new Y6e;function Q6e(i){setTimeout(i,0)}var Nw=typeof window>"u"||"Deno"in globalThis;function zl(){}function X6e(i,e){return typeof i=="function"?i(e):i}function RK(i){return typeof i=="number"&&i>=0&&i!==1/0}function WCe(i,e){return Math.max(i+(e||0)-Date.now(),0)}function Vv(i,e){return typeof i=="function"?i(e):i}function oh(i,e){return typeof i=="function"?i(e):i}function kge(i,e){const{type:t="all",exact:n,fetchStatus:s,predicate:r,queryKey:o,stale:a}=i;if(o){if(n){if(e.queryHash!==Sie(o,e.options))return!1}else if(!gA(e.queryKey,o))return!1}if(t!=="all"){const l=e.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||r&&!r(e))}function Nge(i,e){const{exact:t,status:n,predicate:s,mutationKey:r}=i;if(r){if(!e.options.mutationKey)return!1;if(t){if(Ew(e.options.mutationKey)!==Ew(r))return!1}else if(!gA(e.options.mutationKey,r))return!1}return!(n&&e.state.status!==n||s&&!s(e))}function Sie(i,e){return((e==null?void 0:e.queryKeyHashFn)||Ew)(i)}function Ew(i){return JSON.stringify(i,(e,t)=>MK(t)?Object.keys(t).sort().reduce((n,s)=>(n[s]=t[s],n),{}):t)}function gA(i,e){return i===e?!0:typeof i!=typeof e?!1:i&&e&&typeof i=="object"&&typeof e=="object"?Object.keys(e).every(t=>gA(i[t],e[t])):!1}var Z6e=Object.prototype.hasOwnProperty;function kie(i,e,t=0){if(i===e)return i;if(t>500)return e;const n=Ege(i)&&Ege(e);if(!n&&!(MK(i)&&MK(e)))return e;const r=(n?i:Object.keys(i)).length,o=n?e:Object.keys(e),a=o.length,l=n?new Array(a):{};let c=0;for(let u=0;u{Py.setTimeout(e,i)})}function PK(i,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(i,e):t.structuralSharing!==!1?kie(i,e):e}function Nie(i){return i}function e8e(i,e,t=0){const n=[...i,e];return t&&n.length>t?n.slice(1):n}function t8e(i,e,t=0){const n=[e,...i];return t&&n.length>t?n.slice(0,-1):n}var Eie=Symbol();function VCe(i,e){return!i.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!i.queryFn||i.queryFn===Eie?()=>Promise.reject(new Error(`Missing queryFn: '${i.queryHash}'`)):i.queryFn}function Lie(i,e){return typeof i=="function"?i(...e):!!i}function n8e(i,e,t){let n=!1,s;return Object.defineProperty(i,"signal",{enumerable:!0,get:()=>(s??(s=e()),n||(n=!0,s.aborted?t():s.addEventListener("abort",t,{once:!0})),s)}),i}var e1,uv,XN,fCe,i8e=(fCe=class extends bC{constructor(){super();Ht(this,e1);Ht(this,uv);Ht(this,XN);yt(this,XN,e=>{if(!Nw&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){oe(this,uv)||this.setEventListener(oe(this,XN))}onUnsubscribe(){var e;this.hasListeners()||((e=oe(this,uv))==null||e.call(this),yt(this,uv,void 0))}setEventListener(e){var t;yt(this,XN,e),(t=oe(this,uv))==null||t.call(this),yt(this,uv,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){oe(this,e1)!==e&&(yt(this,e1,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return typeof oe(this,e1)=="boolean"?oe(this,e1):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},e1=new WeakMap,uv=new WeakMap,XN=new WeakMap,fCe),Die=new i8e;function OK(){let i,e;const t=new Promise((s,r)=>{i=s,e=r});t.status="pending",t.catch(()=>{});function n(s){Object.assign(t,s),delete t.resolve,delete t.reject}return t.resolve=s=>{n({status:"fulfilled",value:s}),i(s)},t.reject=s=>{n({status:"rejected",reason:s}),e(s)},t}var s8e=Q6e;function r8e(){let i=[],e=0,t=a=>{a()},n=a=>{a()},s=s8e;const r=a=>{e?i.push(a):s(()=>{t(a)})},o=()=>{const a=i;i=[],a.length&&s(()=>{n(()=>{a.forEach(l=>{t(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{r(()=>{a(...l)})},schedule:r,setNotifyFunction:a=>{t=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var ko=r8e(),ZN,hv,JN,pCe,o8e=(pCe=class extends bC{constructor(){super();Ht(this,ZN,!0);Ht(this,hv);Ht(this,JN);yt(this,JN,e=>{if(!Nw&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}})}onSubscribe(){oe(this,hv)||this.setEventListener(oe(this,JN))}onUnsubscribe(){var e;this.hasListeners()||((e=oe(this,hv))==null||e.call(this),yt(this,hv,void 0))}setEventListener(e){var t;yt(this,JN,e),(t=oe(this,hv))==null||t.call(this),yt(this,hv,e(this.setOnline.bind(this)))}setOnline(e){oe(this,ZN)!==e&&(yt(this,ZN,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return oe(this,ZN)}},ZN=new WeakMap,hv=new WeakMap,JN=new WeakMap,pCe),bj=new o8e;function a8e(i){return Math.min(1e3*2**i,3e4)}function zCe(i){return(i??"online")==="online"?bj.isOnline():!0}var jK=class extends Error{constructor(i){super("CancelledError"),this.revert=i==null?void 0:i.revert,this.silent=i==null?void 0:i.silent}};function UCe(i){let e=!1,t=0,n;const s=OK(),r=()=>s.status!=="pending",o=x=>{var v;if(!r()){const _=new jK(x);g(_),(v=i.onCancel)==null||v.call(i,_)}},a=()=>{e=!0},l=()=>{e=!1},c=()=>Die.isFocused()&&(i.networkMode==="always"||bj.isOnline())&&i.canRun(),u=()=>zCe(i.networkMode)&&i.canRun(),h=x=>{r()||(n==null||n(),s.resolve(x))},g=x=>{r()||(n==null||n(),s.reject(x))},f=()=>new Promise(x=>{var v;n=_=>{(r()||c())&&x(_)},(v=i.onPause)==null||v.call(i)}).then(()=>{var x;n=void 0,r()||(x=i.onContinue)==null||x.call(i)}),m=()=>{if(r())return;let x;const v=t===0?i.initialPromise:void 0;try{x=v??i.fn()}catch(_){x=Promise.reject(_)}Promise.resolve(x).then(h).catch(_=>{var D;if(r())return;const w=i.retry??(Nw?0:3),k=i.retryDelay??a8e,C=typeof k=="function"?k(t,_):k,E=w===!0||typeof w=="number"&&tc()?void 0:f()).then(()=>{e?g(_):m()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?m():f().then(m),s)}}var t1,mCe,$Ce=(mCe=class{constructor(){Ht(this,t1)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),RK(this.gcTime)&&yt(this,t1,Py.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(i){this.gcTime=Math.max(this.gcTime||0,i??(Nw?1/0:300*1e3))}clearGcTimeout(){oe(this,t1)&&(Py.clearTimeout(oe(this,t1)),yt(this,t1,void 0))}},t1=new WeakMap,mCe),n1,eE,sh,i1,Va,SM,s1,Xh,lm,bCe,l8e=(bCe=class extends $Ce{constructor(e){super();Ht(this,Xh);Ht(this,n1);Ht(this,eE);Ht(this,sh);Ht(this,i1);Ht(this,Va);Ht(this,SM);Ht(this,s1);yt(this,s1,!1),yt(this,SM,e.defaultOptions),this.setOptions(e.options),this.observers=[],yt(this,i1,e.client),yt(this,sh,oe(this,i1).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,yt(this,n1,Tge(this.options)),this.state=e.state??oe(this,n1),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=oe(this,Va))==null?void 0:e.promise}setOptions(e){if(this.options={...oe(this,SM),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Tge(this.options);t.data!==void 0&&(this.setState(Dge(t.data,t.dataUpdatedAt)),yt(this,n1,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&oe(this,sh).remove(this)}setData(e,t){const n=PK(this.state.data,e,this.options);return st(this,Xh,lm).call(this,{data:n,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),n}setState(e,t){st(this,Xh,lm).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var n,s;const t=(n=oe(this,Va))==null?void 0:n.promise;return(s=oe(this,Va))==null||s.cancel(e),t?t.then(zl).catch(zl):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(oe(this,n1))}isActive(){return this.observers.some(e=>oh(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Eie||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Vv(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!WCe(this.state.dataUpdatedAt,e)}onFocus(){var t;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(t=oe(this,Va))==null||t.continue()}onOnline(){var t;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(t=oe(this,Va))==null||t.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),oe(this,sh).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(oe(this,Va)&&(oe(this,s1)?oe(this,Va).cancel({revert:!0}):oe(this,Va).cancelRetry()),this.scheduleGc()),oe(this,sh).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||st(this,Xh,lm).call(this,{type:"invalidate"})}async fetch(e,t){var l,c,u,h,g,f,m,x,v,_,w,k;if(this.state.fetchStatus!=="idle"&&((l=oe(this,Va))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(oe(this,Va))return oe(this,Va).continueRetry(),oe(this,Va).promise}if(e&&this.setOptions(e),!this.options.queryFn){const C=this.observers.find(E=>E.options.queryFn);C&&this.setOptions(C.options)}const n=new AbortController,s=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(yt(this,s1,!0),n.signal)})},r=()=>{const C=VCe(this.options,t),D=(()=>{const T={client:oe(this,i1),queryKey:this.queryKey,meta:this.meta};return s(T),T})();return yt(this,s1,!1),this.options.persister?this.options.persister(C,D,this):C(D)},a=(()=>{const C={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:oe(this,i1),state:this.state,fetchFn:r};return s(C),C})();(c=this.options.behavior)==null||c.onFetch(a,this),yt(this,eE,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&st(this,Xh,lm).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta}),yt(this,Va,UCe({initialPromise:t==null?void 0:t.initialPromise,fn:a.fetchFn,onCancel:C=>{C instanceof jK&&C.revert&&this.setState({...oe(this,eE),fetchStatus:"idle"}),n.abort()},onFail:(C,E)=>{st(this,Xh,lm).call(this,{type:"failed",failureCount:C,error:E})},onPause:()=>{st(this,Xh,lm).call(this,{type:"pause"})},onContinue:()=>{st(this,Xh,lm).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const C=await oe(this,Va).start();if(C===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(C),(f=(g=oe(this,sh).config).onSuccess)==null||f.call(g,C,this),(x=(m=oe(this,sh).config).onSettled)==null||x.call(m,C,this.state.error,this),C}catch(C){if(C instanceof jK){if(C.silent)return oe(this,Va).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw st(this,Xh,lm).call(this,{type:"error",error:C}),(_=(v=oe(this,sh).config).onError)==null||_.call(v,C,this),(k=(w=oe(this,sh).config).onSettled)==null||k.call(w,this.state.data,C,this),C}finally{this.scheduleGc()}}},n1=new WeakMap,eE=new WeakMap,sh=new WeakMap,i1=new WeakMap,Va=new WeakMap,SM=new WeakMap,s1=new WeakMap,Xh=new WeakSet,lm=function(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...qCe(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...Dge(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return yt(this,eE,e.manual?s:void 0),s;case"error":const r=e.error;return{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),ko.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),oe(this,sh).notify({query:this,type:"updated",action:e})})},bCe);function qCe(i,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zCe(e.networkMode)?"fetching":"paused",...i===void 0&&{error:null,status:"pending"}}}function Dge(i,e){return{data:i,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Tge(i){const e=typeof i.initialData=="function"?i.initialData():i.initialData,t=e!==void 0,n=t?typeof i.initialDataUpdatedAt=="function"?i.initialDataUpdatedAt():i.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var hd,Ji,kM,vc,r1,tE,Am,gv,NM,nE,iE,o1,a1,fv,sE,Ys,h2,FK,BK,HK,WK,VK,zK,UK,KCe,xCe,o7=(xCe=class extends bC{constructor(e,t){super();Ht(this,Ys);Ht(this,hd);Ht(this,Ji);Ht(this,kM);Ht(this,vc);Ht(this,r1);Ht(this,tE);Ht(this,Am);Ht(this,gv);Ht(this,NM);Ht(this,nE);Ht(this,iE);Ht(this,o1);Ht(this,a1);Ht(this,fv);Ht(this,sE,new Set);this.options=t,yt(this,hd,e),yt(this,gv,null),yt(this,Am,OK()),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(oe(this,Ji).addObserver(this),Ige(oe(this,Ji),this.options)?st(this,Ys,h2).call(this):this.updateResult(),st(this,Ys,WK).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $K(oe(this,Ji),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $K(oe(this,Ji),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,st(this,Ys,VK).call(this),st(this,Ys,zK).call(this),oe(this,Ji).removeObserver(this)}setOptions(e){const t=this.options,n=oe(this,Ji);if(this.options=oe(this,hd).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof oh(this.options.enabled,oe(this,Ji))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");st(this,Ys,UK).call(this),oe(this,Ji).setOptions(this.options),t._defaulted&&!fA(this.options,t)&&oe(this,hd).getQueryCache().notify({type:"observerOptionsUpdated",query:oe(this,Ji),observer:this});const s=this.hasListeners();s&&Age(oe(this,Ji),n,this.options,t)&&st(this,Ys,h2).call(this),this.updateResult(),s&&(oe(this,Ji)!==n||oh(this.options.enabled,oe(this,Ji))!==oh(t.enabled,oe(this,Ji))||Vv(this.options.staleTime,oe(this,Ji))!==Vv(t.staleTime,oe(this,Ji)))&&st(this,Ys,FK).call(this);const r=st(this,Ys,BK).call(this);s&&(oe(this,Ji)!==n||oh(this.options.enabled,oe(this,Ji))!==oh(t.enabled,oe(this,Ji))||r!==oe(this,fv))&&st(this,Ys,HK).call(this,r)}getOptimisticResult(e){const t=oe(this,hd).getQueryCache().build(oe(this,hd),e),n=this.createResult(t,e);return d8e(this,n)&&(yt(this,vc,n),yt(this,tE,this.options),yt(this,r1,oe(this,Ji).state)),n}getCurrentResult(){return oe(this,vc)}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t==null||t(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&oe(this,Am).status==="pending"&&oe(this,Am).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){oe(this,sE).add(e)}getCurrentQuery(){return oe(this,Ji)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=oe(this,hd).defaultQueryOptions(e),n=oe(this,hd).getQueryCache().build(oe(this,hd),t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return st(this,Ys,h2).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),oe(this,vc)))}createResult(e,t){var R;const n=oe(this,Ji),s=this.options,r=oe(this,vc),o=oe(this,r1),a=oe(this,tE),c=e!==n?e.state:oe(this,kM),{state:u}=e;let h={...u},g=!1,f;if(t._optimisticResults){const P=this.hasListeners(),j=!P&&Ige(e,t),B=P&&Age(e,n,t,s);(j||B)&&(h={...h,...qCe(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:v}=h;f=h.data;let _=!1;if(t.placeholderData!==void 0&&f===void 0&&v==="pending"){let P;r!=null&&r.isPlaceholderData&&t.placeholderData===(a==null?void 0:a.placeholderData)?(P=r.data,_=!0):P=typeof t.placeholderData=="function"?t.placeholderData((R=oe(this,iE))==null?void 0:R.state.data,oe(this,iE)):t.placeholderData,P!==void 0&&(v="success",f=PK(r==null?void 0:r.data,P,t),g=!0)}if(t.select&&f!==void 0&&!_)if(r&&f===(o==null?void 0:o.data)&&t.select===oe(this,NM))f=oe(this,nE);else try{yt(this,NM,t.select),f=t.select(f),f=PK(r==null?void 0:r.data,f,t),yt(this,nE,f),yt(this,gv,null)}catch(P){yt(this,gv,P)}oe(this,gv)&&(m=oe(this,gv),f=oe(this,nE),x=Date.now(),v="error");const w=h.fetchStatus==="fetching",k=v==="pending",C=v==="error",E=k&&w,D=f!==void 0,I={status:v,fetchStatus:h.fetchStatus,isPending:k,isSuccess:v==="success",isError:C,isInitialLoading:E,isLoading:E,data:f,dataUpdatedAt:h.dataUpdatedAt,error:m,errorUpdatedAt:x,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!k,isLoadingError:C&&!D,isPaused:h.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:C&&D,isStale:Tie(e,t),refetch:this.refetch,promise:oe(this,Am),isEnabled:oh(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=I.data!==void 0,j=I.status==="error"&&!P,B=K=>{j?K.reject(I.error):P&&K.resolve(I.data)},U=()=>{const K=yt(this,Am,I.promise=OK());B(K)},$=oe(this,Am);switch($.status){case"pending":e.queryHash===n.queryHash&&B($);break;case"fulfilled":(j||I.data!==$.value)&&U();break;case"rejected":(!j||I.error!==$.reason)&&U();break}}return I}updateResult(){const e=oe(this,vc),t=this.createResult(oe(this,Ji),this.options);if(yt(this,r1,oe(this,Ji).state),yt(this,tE,this.options),oe(this,r1).data!==void 0&&yt(this,iE,oe(this,Ji)),fA(t,e))return;yt(this,vc,t);const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,r=typeof s=="function"?s():s;if(r==="all"||!r&&!oe(this,sE).size)return!0;const o=new Set(r??oe(this,sE));return this.options.throwOnError&&o.add("error"),Object.keys(oe(this,vc)).some(a=>{const l=a;return oe(this,vc)[l]!==e[l]&&o.has(l)})};st(this,Ys,KCe).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&st(this,Ys,WK).call(this)}},hd=new WeakMap,Ji=new WeakMap,kM=new WeakMap,vc=new WeakMap,r1=new WeakMap,tE=new WeakMap,Am=new WeakMap,gv=new WeakMap,NM=new WeakMap,nE=new WeakMap,iE=new WeakMap,o1=new WeakMap,a1=new WeakMap,fv=new WeakMap,sE=new WeakMap,Ys=new WeakSet,h2=function(e){st(this,Ys,UK).call(this);let t=oe(this,Ji).fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch(zl)),t},FK=function(){st(this,Ys,VK).call(this);const e=Vv(this.options.staleTime,oe(this,Ji));if(Nw||oe(this,vc).isStale||!RK(e))return;const n=WCe(oe(this,vc).dataUpdatedAt,e)+1;yt(this,o1,Py.setTimeout(()=>{oe(this,vc).isStale||this.updateResult()},n))},BK=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(oe(this,Ji)):this.options.refetchInterval)??!1},HK=function(e){st(this,Ys,zK).call(this),yt(this,fv,e),!(Nw||oh(this.options.enabled,oe(this,Ji))===!1||!RK(oe(this,fv))||oe(this,fv)===0)&&yt(this,a1,Py.setInterval(()=>{(this.options.refetchIntervalInBackground||Die.isFocused())&&st(this,Ys,h2).call(this)},oe(this,fv)))},WK=function(){st(this,Ys,FK).call(this),st(this,Ys,HK).call(this,st(this,Ys,BK).call(this))},VK=function(){oe(this,o1)&&(Py.clearTimeout(oe(this,o1)),yt(this,o1,void 0))},zK=function(){oe(this,a1)&&(Py.clearInterval(oe(this,a1)),yt(this,a1,void 0))},UK=function(){const e=oe(this,hd).getQueryCache().build(oe(this,hd),this.options);if(e===oe(this,Ji))return;const t=oe(this,Ji);yt(this,Ji,e),yt(this,kM,e.state),this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))},KCe=function(e){ko.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(oe(this,vc))}),oe(this,hd).getQueryCache().notify({query:oe(this,Ji),type:"observerResultsUpdated"})})},xCe);function c8e(i,e){return oh(e.enabled,i)!==!1&&i.state.data===void 0&&!(i.state.status==="error"&&e.retryOnMount===!1)}function Ige(i,e){return c8e(i,e)||i.state.data!==void 0&&$K(i,e,e.refetchOnMount)}function $K(i,e,t){if(oh(e.enabled,i)!==!1&&Vv(e.staleTime,i)!=="static"){const n=typeof t=="function"?t(i):t;return n==="always"||n!==!1&&Tie(i,e)}return!1}function Age(i,e,t,n){return(i!==e||oh(n.enabled,i)===!1)&&(!t.suspense||i.state.status!=="error")&&Tie(i,t)}function Tie(i,e){return oh(e.enabled,i)!==!1&&i.isStaleByTime(Vv(e.staleTime,i))}function d8e(i,e){return!fA(i.getCurrentResult(),e)}function xj(i){return{onFetch:(e,t)=>{var u,h,g,f,m;const n=e.options,s=(g=(h=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:h.fetchMore)==null?void 0:g.direction,r=((f=e.state.data)==null?void 0:f.pages)||[],o=((m=e.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let x=!1;const v=k=>{n8e(k,()=>e.signal,()=>x=!0)},_=VCe(e.options,e.fetchOptions),w=async(k,C,E)=>{if(x)return Promise.reject();if(C==null&&k.pages.length)return Promise.resolve(k);const T=(()=>{const j={client:e.client,queryKey:e.queryKey,pageParam:C,direction:E?"backward":"forward",meta:e.options.meta};return v(j),j})(),I=await _(T),{maxPages:R}=e.options,P=E?t8e:e8e;return{pages:P(k.pages,I,R),pageParams:P(k.pageParams,C,R)}};if(s&&r.length){const k=s==="backward",C=k?GCe:qK,E={pages:r,pageParams:o},D=C(n,E);a=await w(E,D,k)}else{const k=i??r.length;do{const C=l===0?o[0]??n.initialPageParam:qK(n,a);if(l>0&&C==null)break;a=await w(a,C),l++}while(l{var x,v;return(v=(x=e.options).persister)==null?void 0:v.call(x,c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t)}:e.fetchFn=c}}}function qK(i,{pages:e,pageParams:t}){const n=e.length-1;return e.length>0?i.getNextPageParam(e[n],e,t[n],t):void 0}function GCe(i,{pages:e,pageParams:t}){var n;return e.length>0?(n=i.getPreviousPageParam)==null?void 0:n.call(i,e[0],e,t[0],t):void 0}function u8e(i,e){return e?qK(i,e)!=null:!1}function h8e(i,e){return!e||!i.getPreviousPageParam?!1:GCe(i,e)!=null}var g8e=class extends o7{constructor(i,e){super(i,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(i){super.setOptions({...i,behavior:xj()})}getOptimisticResult(i){return i.behavior=xj(),super.getOptimisticResult(i)}fetchNextPage(i){return this.fetch({...i,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(i){return this.fetch({...i,meta:{fetchMore:{direction:"backward"}}})}createResult(i,e){var m,x;const{state:t}=i,n=super.createResult(i,e),{isFetching:s,isRefetching:r,isError:o,isRefetchError:a}=n,l=(x=(m=t.fetchMeta)==null?void 0:m.fetchMore)==null?void 0:x.direction,c=o&&l==="forward",u=s&&l==="forward",h=o&&l==="backward",g=s&&l==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:u8e(e,t.data),hasPreviousPage:h8e(e,t.data),isFetchNextPageError:c,isFetchingNextPage:u,isFetchPreviousPageError:h,isFetchingPreviousPage:g,isRefetchError:a&&!c&&!h,isRefetching:r&&!u&&!g}}},EM,xf,Vl,l1,vf,Rx,vCe,f8e=(vCe=class extends $Ce{constructor(e){super();Ht(this,vf);Ht(this,EM);Ht(this,xf);Ht(this,Vl);Ht(this,l1);yt(this,EM,e.client),this.mutationId=e.mutationId,yt(this,Vl,e.mutationCache),yt(this,xf,[]),this.state=e.state||YCe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){oe(this,xf).includes(e)||(oe(this,xf).push(e),this.clearGcTimeout(),oe(this,Vl).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){yt(this,xf,oe(this,xf).filter(t=>t!==e)),this.scheduleGc(),oe(this,Vl).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){oe(this,xf).length||(this.state.status==="pending"?this.scheduleGc():oe(this,Vl).remove(this))}continue(){var e;return((e=oe(this,l1))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,l,c,u,h,g,f,m,x,v,_,w,k,C,E,D,T;const t=()=>{st(this,vf,Rx).call(this,{type:"continue"})},n={client:oe(this,EM),meta:this.options.meta,mutationKey:this.options.mutationKey};yt(this,l1,UCe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(I,R)=>{st(this,vf,Rx).call(this,{type:"failed",failureCount:I,error:R})},onPause:()=>{st(this,vf,Rx).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>oe(this,Vl).canRun(this)}));const s=this.state.status==="pending",r=!oe(this,l1).canStart();try{if(s)t();else{st(this,vf,Rx).call(this,{type:"pending",variables:e,isPaused:r}),oe(this,Vl).config.onMutate&&await oe(this,Vl).config.onMutate(e,this,n);const R=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e,n));R!==this.state.context&&st(this,vf,Rx).call(this,{type:"pending",context:R,variables:e,isPaused:r})}const I=await oe(this,l1).start();return await((c=(l=oe(this,Vl).config).onSuccess)==null?void 0:c.call(l,I,e,this.state.context,this,n)),await((h=(u=this.options).onSuccess)==null?void 0:h.call(u,I,e,this.state.context,n)),await((f=(g=oe(this,Vl).config).onSettled)==null?void 0:f.call(g,I,null,this.state.variables,this.state.context,this,n)),await((x=(m=this.options).onSettled)==null?void 0:x.call(m,I,null,e,this.state.context,n)),st(this,vf,Rx).call(this,{type:"success",data:I}),I}catch(I){try{await((_=(v=oe(this,Vl).config).onError)==null?void 0:_.call(v,I,e,this.state.context,this,n))}catch(R){Promise.reject(R)}try{await((k=(w=this.options).onError)==null?void 0:k.call(w,I,e,this.state.context,n))}catch(R){Promise.reject(R)}try{await((E=(C=oe(this,Vl).config).onSettled)==null?void 0:E.call(C,void 0,I,this.state.variables,this.state.context,this,n))}catch(R){Promise.reject(R)}try{await((T=(D=this.options).onSettled)==null?void 0:T.call(D,void 0,I,e,this.state.context,n))}catch(R){Promise.reject(R)}throw st(this,vf,Rx).call(this,{type:"error",error:I}),I}finally{oe(this,Vl).runNext(this)}}},EM=new WeakMap,xf=new WeakMap,Vl=new WeakMap,l1=new WeakMap,vf=new WeakSet,Rx=function(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),ko.batch(()=>{oe(this,xf).forEach(n=>{n.onMutationUpdate(e)}),oe(this,Vl).notify({mutation:this,type:"updated",action:e})})},vCe);function YCe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Rm,Zh,LM,_Ce,p8e=(_Ce=class extends bC{constructor(e={}){super();Ht(this,Rm);Ht(this,Zh);Ht(this,LM);this.config=e,yt(this,Rm,new Set),yt(this,Zh,new Map),yt(this,LM,0)}build(e,t,n){const s=new f8e({client:e,mutationCache:this,mutationId:++c5(this,LM)._,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){oe(this,Rm).add(e);const t=d5(e);if(typeof t=="string"){const n=oe(this,Zh).get(t);n?n.push(e):oe(this,Zh).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(oe(this,Rm).delete(e)){const t=d5(e);if(typeof t=="string"){const n=oe(this,Zh).get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&oe(this,Zh).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=d5(e);if(typeof t=="string"){const n=oe(this,Zh).get(t),s=n==null?void 0:n.find(r=>r.state.status==="pending");return!s||s===e}else return!0}runNext(e){var n;const t=d5(e);if(typeof t=="string"){const s=(n=oe(this,Zh).get(t))==null?void 0:n.find(r=>r!==e&&r.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ko.batch(()=>{oe(this,Rm).forEach(e=>{this.notify({type:"removed",mutation:e})}),oe(this,Rm).clear(),oe(this,Zh).clear()})}getAll(){return Array.from(oe(this,Rm))}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Nge(t,n))}findAll(e={}){return this.getAll().filter(t=>Nge(e,t))}notify(e){ko.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return ko.batch(()=>Promise.all(e.map(t=>t.continue().catch(zl))))}},Rm=new WeakMap,Zh=new WeakMap,LM=new WeakMap,_Ce);function d5(i){var e;return(e=i.options.scope)==null?void 0:e.id}var Mm,pv,gd,Pm,xb,p4,KK,yCe,m8e=(yCe=class extends bC{constructor(t,n){super();Ht(this,xb);Ht(this,Mm);Ht(this,pv);Ht(this,gd);Ht(this,Pm);yt(this,Mm,t),this.setOptions(n),this.bindMethods(),st(this,xb,p4).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var s;const n=this.options;this.options=oe(this,Mm).defaultMutationOptions(t),fA(this.options,n)||oe(this,Mm).getMutationCache().notify({type:"observerOptionsUpdated",mutation:oe(this,gd),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Ew(n.mutationKey)!==Ew(this.options.mutationKey)?this.reset():((s=oe(this,gd))==null?void 0:s.state.status)==="pending"&&oe(this,gd).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=oe(this,gd))==null||t.removeObserver(this)}onMutationUpdate(t){st(this,xb,p4).call(this),st(this,xb,KK).call(this,t)}getCurrentResult(){return oe(this,pv)}reset(){var t;(t=oe(this,gd))==null||t.removeObserver(this),yt(this,gd,void 0),st(this,xb,p4).call(this),st(this,xb,KK).call(this)}mutate(t,n){var s;return yt(this,Pm,n),(s=oe(this,gd))==null||s.removeObserver(this),yt(this,gd,oe(this,Mm).getMutationCache().build(oe(this,Mm),this.options)),oe(this,gd).addObserver(this),oe(this,gd).execute(t)}},Mm=new WeakMap,pv=new WeakMap,gd=new WeakMap,Pm=new WeakMap,xb=new WeakSet,p4=function(){var n;const t=((n=oe(this,gd))==null?void 0:n.state)??YCe();yt(this,pv,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},KK=function(t){ko.batch(()=>{var n,s,r,o,a,l,c,u;if(oe(this,Pm)&&this.hasListeners()){const h=oe(this,pv).variables,g=oe(this,pv).context,f={client:oe(this,Mm),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(s=(n=oe(this,Pm)).onSuccess)==null||s.call(n,t.data,h,g,f)}catch(m){Promise.reject(m)}try{(o=(r=oe(this,Pm)).onSettled)==null||o.call(r,t.data,null,h,g,f)}catch(m){Promise.reject(m)}}else if((t==null?void 0:t.type)==="error"){try{(l=(a=oe(this,Pm)).onError)==null||l.call(a,t.error,h,g,f)}catch(m){Promise.reject(m)}try{(u=(c=oe(this,Pm)).onSettled)==null||u.call(c,void 0,t.error,h,g,f)}catch(m){Promise.reject(m)}}}this.listeners.forEach(h=>{h(oe(this,pv))})})},yCe);function Rge(i,e){const t=new Set(e);return i.filter(n=>!t.has(n))}function b8e(i,e,t){const n=i.slice(0);return n[e]=t,n}var rE,iu,oE,aE,rh,mv,DM,TM,IM,AM,Al,GK,YK,QK,XK,ZK,wCe,x8e=(wCe=class extends bC{constructor(e,t,n){super();Ht(this,Al);Ht(this,rE);Ht(this,iu);Ht(this,oE);Ht(this,aE);Ht(this,rh);Ht(this,mv);Ht(this,DM);Ht(this,TM);Ht(this,IM);Ht(this,AM,[]);yt(this,rE,e),yt(this,aE,n),yt(this,oE,[]),yt(this,rh,[]),yt(this,iu,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&oe(this,rh).forEach(e=>{e.subscribe(t=>{st(this,Al,XK).call(this,e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,oe(this,rh).forEach(e=>{e.destroy()})}setQueries(e,t){yt(this,oE,e),yt(this,aE,t),ko.batch(()=>{const n=oe(this,rh),s=st(this,Al,QK).call(this,oe(this,oE));s.forEach(h=>h.observer.setOptions(h.defaultedQueryOptions));const r=s.map(h=>h.observer),o=r.map(h=>h.getCurrentResult()),a=n.length!==r.length,l=r.some((h,g)=>h!==n[g]),c=a||l,u=c?!0:o.some((h,g)=>{const f=oe(this,iu)[g];return!f||!fA(h,f)});!c&&!u||(c&&(yt(this,AM,s),yt(this,rh,r)),yt(this,iu,o),this.hasListeners()&&(c&&(Rge(n,r).forEach(h=>{h.destroy()}),Rge(r,n).forEach(h=>{h.subscribe(g=>{st(this,Al,XK).call(this,h,g)})})),st(this,Al,ZK).call(this)))})}getCurrentResult(){return oe(this,iu)}getQueries(){return oe(this,rh).map(e=>e.getCurrentQuery())}getObservers(){return oe(this,rh)}getOptimisticResult(e,t){const n=st(this,Al,QK).call(this,e),s=n.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),r=n.map(o=>o.defaultedQueryOptions.queryHash);return[s,o=>st(this,Al,YK).call(this,o??s,t,r),()=>st(this,Al,GK).call(this,s,n)]}},rE=new WeakMap,iu=new WeakMap,oE=new WeakMap,aE=new WeakMap,rh=new WeakMap,mv=new WeakMap,DM=new WeakMap,TM=new WeakMap,IM=new WeakMap,AM=new WeakMap,Al=new WeakSet,GK=function(e,t){return t.map((n,s)=>{const r=e[s];return n.defaultedQueryOptions.notifyOnChangeProps?r:n.observer.trackResult(r,o=>{t.forEach(a=>{a.observer.trackProp(o)})})})},YK=function(e,t,n){if(t){const s=oe(this,IM),r=n!==void 0&&s!==void 0&&(s.length!==n.length||n.some((o,a)=>o!==s[a]));return(!oe(this,mv)||oe(this,iu)!==oe(this,TM)||r||t!==oe(this,DM))&&(yt(this,DM,t),yt(this,TM,oe(this,iu)),n!==void 0&&yt(this,IM,n),yt(this,mv,kie(oe(this,mv),t(e)))),oe(this,mv)}return e},QK=function(e){const t=new Map;oe(this,rh).forEach(s=>{const r=s.options.queryHash;if(!r)return;const o=t.get(r);o?o.push(s):t.set(r,[s])});const n=[];return e.forEach(s=>{var l;const r=oe(this,rE).defaultQueryOptions(s),a=((l=t.get(r.queryHash))==null?void 0:l.shift())??new o7(oe(this,rE),r);n.push({defaultedQueryOptions:r,observer:a})}),n},XK=function(e,t){const n=oe(this,rh).indexOf(e);n!==-1&&(yt(this,iu,b8e(oe(this,iu),n,t)),st(this,Al,ZK).call(this))},ZK=function(){var e;if(this.hasListeners()){const t=oe(this,mv),n=st(this,Al,GK).call(this,oe(this,iu),oe(this,AM)),s=st(this,Al,YK).call(this,n,(e=oe(this,aE))==null?void 0:e.combine);t!==s&&ko.batch(()=>{this.listeners.forEach(r=>{r(oe(this,iu))})})}},wCe),_f,CCe,v8e=(CCe=class extends bC{constructor(e={}){super();Ht(this,_f);this.config=e,yt(this,_f,new Map)}build(e,t,n){const s=t.queryKey,r=t.queryHash??Sie(s,t);let o=this.get(r);return o||(o=new l8e({client:e,queryKey:s,queryHash:r,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){oe(this,_f).has(e.queryHash)||(oe(this,_f).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=oe(this,_f).get(e.queryHash);t&&(e.destroy(),t===e&&oe(this,_f).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ko.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return oe(this,_f).get(e)}getAll(){return[...oe(this,_f).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>kge(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>kge(e,n)):t}notify(e){ko.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ko.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ko.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},_f=new WeakMap,CCe),yo,bv,xv,lE,cE,vv,dE,uE,SCe,_8e=(SCe=class{constructor(i={}){Ht(this,yo);Ht(this,bv);Ht(this,xv);Ht(this,lE);Ht(this,cE);Ht(this,vv);Ht(this,dE);Ht(this,uE);yt(this,yo,i.queryCache||new v8e),yt(this,bv,i.mutationCache||new p8e),yt(this,xv,i.defaultOptions||{}),yt(this,lE,new Map),yt(this,cE,new Map),yt(this,vv,0)}mount(){c5(this,vv)._++,oe(this,vv)===1&&(yt(this,dE,Die.subscribe(async i=>{i&&(await this.resumePausedMutations(),oe(this,yo).onFocus())})),yt(this,uE,bj.subscribe(async i=>{i&&(await this.resumePausedMutations(),oe(this,yo).onOnline())})))}unmount(){var i,e;c5(this,vv)._--,oe(this,vv)===0&&((i=oe(this,dE))==null||i.call(this),yt(this,dE,void 0),(e=oe(this,uE))==null||e.call(this),yt(this,uE,void 0))}isFetching(i){return oe(this,yo).findAll({...i,fetchStatus:"fetching"}).length}isMutating(i){return oe(this,bv).findAll({...i,status:"pending"}).length}getQueryData(i){var t;const e=this.defaultQueryOptions({queryKey:i});return(t=oe(this,yo).get(e.queryHash))==null?void 0:t.state.data}ensureQueryData(i){const e=this.defaultQueryOptions(i),t=oe(this,yo).build(this,e),n=t.state.data;return n===void 0?this.fetchQuery(i):(i.revalidateIfStale&&t.isStaleByTime(Vv(e.staleTime,t))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(i){return oe(this,yo).findAll(i).map(({queryKey:e,state:t})=>{const n=t.data;return[e,n]})}setQueryData(i,e,t){const n=this.defaultQueryOptions({queryKey:i}),s=oe(this,yo).get(n.queryHash),r=s==null?void 0:s.state.data,o=X6e(e,r);if(o!==void 0)return oe(this,yo).build(this,n).setData(o,{...t,manual:!0})}setQueriesData(i,e,t){return ko.batch(()=>oe(this,yo).findAll(i).map(({queryKey:n})=>[n,this.setQueryData(n,e,t)]))}getQueryState(i){var t;const e=this.defaultQueryOptions({queryKey:i});return(t=oe(this,yo).get(e.queryHash))==null?void 0:t.state}removeQueries(i){const e=oe(this,yo);ko.batch(()=>{e.findAll(i).forEach(t=>{e.remove(t)})})}resetQueries(i,e){const t=oe(this,yo);return ko.batch(()=>(t.findAll(i).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...i},e)))}cancelQueries(i,e={}){const t={revert:!0,...e},n=ko.batch(()=>oe(this,yo).findAll(i).map(s=>s.cancel(t)));return Promise.all(n).then(zl).catch(zl)}invalidateQueries(i,e={}){return ko.batch(()=>(oe(this,yo).findAll(i).forEach(t=>{t.invalidate()}),(i==null?void 0:i.refetchType)==="none"?Promise.resolve():this.refetchQueries({...i,type:(i==null?void 0:i.refetchType)??(i==null?void 0:i.type)??"active"},e)))}refetchQueries(i,e={}){const t={...e,cancelRefetch:e.cancelRefetch??!0},n=ko.batch(()=>oe(this,yo).findAll(i).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let r=s.fetch(void 0,t);return t.throwOnError||(r=r.catch(zl)),s.state.fetchStatus==="paused"?Promise.resolve():r}));return Promise.all(n).then(zl)}fetchQuery(i){const e=this.defaultQueryOptions(i);e.retry===void 0&&(e.retry=!1);const t=oe(this,yo).build(this,e);return t.isStaleByTime(Vv(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(i){return this.fetchQuery(i).then(zl).catch(zl)}fetchInfiniteQuery(i){return i.behavior=xj(i.pages),this.fetchQuery(i)}prefetchInfiniteQuery(i){return this.fetchInfiniteQuery(i).then(zl).catch(zl)}ensureInfiniteQueryData(i){return i.behavior=xj(i.pages),this.ensureQueryData(i)}resumePausedMutations(){return bj.isOnline()?oe(this,bv).resumePausedMutations():Promise.resolve()}getQueryCache(){return oe(this,yo)}getMutationCache(){return oe(this,bv)}getDefaultOptions(){return oe(this,xv)}setDefaultOptions(i){yt(this,xv,i)}setQueryDefaults(i,e){oe(this,lE).set(Ew(i),{queryKey:i,defaultOptions:e})}getQueryDefaults(i){const e=[...oe(this,lE).values()],t={};return e.forEach(n=>{gA(i,n.queryKey)&&Object.assign(t,n.defaultOptions)}),t}setMutationDefaults(i,e){oe(this,cE).set(Ew(i),{mutationKey:i,defaultOptions:e})}getMutationDefaults(i){const e=[...oe(this,cE).values()],t={};return e.forEach(n=>{gA(i,n.mutationKey)&&Object.assign(t,n.defaultOptions)}),t}defaultQueryOptions(i){if(i._defaulted)return i;const e={...oe(this,xv).queries,...this.getQueryDefaults(i.queryKey),...i,_defaulted:!0};return e.queryHash||(e.queryHash=Sie(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Eie&&(e.enabled=!1),e}defaultMutationOptions(i){return i!=null&&i._defaulted?i:{...oe(this,xv).mutations,...(i==null?void 0:i.mutationKey)&&this.getMutationDefaults(i.mutationKey),...i,_defaulted:!0}}clear(){oe(this,yo).clear(),oe(this,bv).clear()}},yo=new WeakMap,bv=new WeakMap,xv=new WeakMap,lE=new WeakMap,cE=new WeakMap,vv=new WeakMap,dE=new WeakMap,uE=new WeakMap,SCe),QCe=L.createContext(void 0),cn=i=>{const e=L.useContext(QCe);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},y8e=({client:i,children:e})=>(L.useEffect(()=>(i.mount(),()=>{i.unmount()}),[i]),d.jsx(QCe.Provider,{value:i,children:e})),XCe=L.createContext(!1),ZCe=()=>L.useContext(XCe);XCe.Provider;function w8e(){let i=!1;return{clearReset:()=>{i=!1},reset:()=>{i=!0},isReset:()=>i}}var C8e=L.createContext(w8e()),JCe=()=>L.useContext(C8e),eSe=(i,e,t)=>{const n=t!=null&&t.state.error&&typeof i.throwOnError=="function"?Lie(i.throwOnError,[t.state.error,t]):i.throwOnError;(i.suspense||i.experimental_prefetchInRender||n)&&(e.isReset()||(i.retryOnMount=!1))},tSe=i=>{L.useEffect(()=>{i.clearReset()},[i])},nSe=({result:i,errorResetBoundary:e,throwOnError:t,query:n,suspense:s})=>i.isError&&!e.isReset()&&!i.isFetching&&n&&(s&&i.data===void 0||Lie(t,[i.error,n])),iSe=i=>{if(i.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),n=i.staleTime;i.staleTime=typeof n=="function"?(...s)=>t(n(...s)):t(n),typeof i.gcTime=="number"&&(i.gcTime=Math.max(i.gcTime,1e3))}},S8e=(i,e)=>i.isLoading&&i.isFetching&&!e,JK=(i,e)=>(i==null?void 0:i.suspense)&&e.isPending,eG=(i,e,t)=>e.fetchOptimistic(i).catch(()=>{t.clearReset()});function k8e({queries:i,...e},t){const n=cn(),s=ZCe(),r=JCe(),o=L.useMemo(()=>i.map(x=>{const v=n.defaultQueryOptions(x);return v._optimisticResults=s?"isRestoring":"optimistic",v}),[i,n,s]);o.forEach(x=>{iSe(x);const v=n.getQueryCache().get(x.queryHash);eSe(x,r,v)}),tSe(r);const[a]=L.useState(()=>new x8e(n,o,e)),[l,c,u]=a.getOptimisticResult(o,e.combine),h=!s&&e.subscribed!==!1;L.useSyncExternalStore(L.useCallback(x=>h?a.subscribe(ko.batchCalls(x)):zl,[a,h]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),L.useEffect(()=>{a.setQueries(o,e)},[o,e,a]);const f=l.some((x,v)=>JK(o[v],x))?l.flatMap((x,v)=>{const _=o[v];if(_&&JK(_,x)){const w=new o7(n,_);return eG(_,w,r)}return[]}):[];if(f.length>0)throw Promise.all(f);const m=l.find((x,v)=>{const _=o[v];return _&&nSe({result:x,errorResetBoundary:r,throwOnError:_.throwOnError,query:n.getQueryCache().get(_.queryHash),suspense:_.suspense})});if(m!=null&&m.error)throw m.error;return c(u())}function sSe(i,e,t){var g,f,m,x;const n=ZCe(),s=JCe(),r=cn(),o=r.defaultQueryOptions(i);(f=(g=r.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||f.call(g,o);const a=r.getQueryCache().get(o.queryHash);o._optimisticResults=n?"isRestoring":"optimistic",iSe(o),eSe(o,s,a),tSe(s);const l=!r.getQueryCache().get(o.queryHash),[c]=L.useState(()=>new e(r,o)),u=c.getOptimisticResult(o),h=!n&&i.subscribed!==!1;if(L.useSyncExternalStore(L.useCallback(v=>{const _=h?c.subscribe(ko.batchCalls(v)):zl;return c.updateResult(),_},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),L.useEffect(()=>{c.setOptions(o)},[o,c]),JK(o,u))throw eG(o,c,s);if(nSe({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw u.error;if((x=(m=r.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||x.call(m,o,u),o.experimental_prefetchInRender&&!Nw&&S8e(u,n)){const v=l?eG(o,c,s):a==null?void 0:a.promise;v==null||v.catch(zl).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function hn(i,e){return sSe(i,o7)}function Kt(i,e){const t=cn(),[n]=L.useState(()=>new m8e(t,i));L.useEffect(()=>{n.setOptions(i)},[n,i]);const s=L.useSyncExternalStore(L.useCallback(o=>n.subscribe(ko.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),r=L.useCallback((o,a)=>{n.mutate(o,a).catch(zl)},[n]);if(s.error&&Lie(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:r,mutateAsync:s.mutate}}function rSe(i,e){return sSe(i,g8e)}function N8e(i){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",e.appendChild(t),t.styleSheet?t.styleSheet.cssText=i:t.appendChild(document.createTextNode(i))}const E8e=i=>{switch(i){case"success":return T8e;case"info":return A8e;case"warning":return I8e;case"error":return R8e;default:return null}},L8e=Array(12).fill(0),D8e=({visible:i,className:e})=>ft.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":i},ft.createElement("div",{className:"sonner-spinner"},L8e.map((t,n)=>ft.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),T8e=ft.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ft.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),I8e=ft.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ft.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),A8e=ft.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ft.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),R8e=ft.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ft.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),M8e=ft.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ft.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ft.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),P8e=()=>{const[i,e]=ft.useState(document.hidden);return ft.useEffect(()=>{const t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),i};let tG=1;class O8e{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;const{message:n,...s}=e,r=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:tG++,o=this.toasts.find(l=>l.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),o?this.toasts=this.toasts.map(l=>l.id===r?(this.publish({...l,...e,id:r,title:n}),{...l,...e,id:r,dismissible:a,title:n}):l):this.addToast({title:n,...s,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let r=n!==void 0,o;const a=s.then(async c=>{if(o=["resolve",c],ft.isValidElement(c))r=!1,this.create({id:n,type:"default",message:c});else if(F8e(c)&&!c.ok){r=!1;const h=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,g=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description,m=typeof h=="object"&&!ft.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:g,...m})}else if(c instanceof Error){r=!1;const h=typeof t.error=="function"?await t.error(c):t.error,g=typeof t.description=="function"?await t.description(c):t.description,m=typeof h=="object"&&!ft.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:g,...m})}else if(t.success!==void 0){r=!1;const h=typeof t.success=="function"?await t.success(c):t.success,g=typeof t.description=="function"?await t.description(c):t.description,m=typeof h=="object"&&!ft.isValidElement(h)?h:{message:h};this.create({id:n,type:"success",description:g,...m})}}).catch(async c=>{if(o=["reject",c],t.error!==void 0){r=!1;const u=typeof t.error=="function"?await t.error(c):t.error,h=typeof t.description=="function"?await t.description(c):t.description,f=typeof u=="object"&&!ft.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:h,...f})}}).finally(()=>{r&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),l=()=>new Promise((c,u)=>a.then(()=>o[0]==="reject"?u(o[1]):c(o[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{const n=(t==null?void 0:t.id)||tG++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const pd=new O8e,j8e=(i,e)=>{const t=(e==null?void 0:e.id)||tG++;return pd.addToast({title:i,...e,id:t}),t},F8e=i=>i&&typeof i=="object"&&"ok"in i&&typeof i.ok=="boolean"&&"status"in i&&typeof i.status=="number",B8e=j8e,H8e=()=>pd.toasts,W8e=()=>pd.getActiveToasts(),ze=Object.assign(B8e,{success:pd.success,info:pd.info,warning:pd.warning,error:pd.error,custom:pd.custom,message:pd.message,promise:pd.promise,dismiss:pd.dismiss,loading:pd.loading},{getHistory:H8e,getToasts:W8e});N8e("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function u5(i){return i.label!==void 0}const V8e=3,z8e="24px",U8e="16px",Mge=4e3,$8e=356,q8e=14,K8e=45,G8e=200;function Ug(...i){return i.filter(Boolean).join(" ")}function Y8e(i){const[e,t]=i.split("-"),n=[];return e&&n.push(e),t&&n.push(t),n}const Q8e=i=>{var e,t,n,s,r,o,a,l,c;const{invert:u,toast:h,unstyled:g,interacting:f,setHeights:m,visibleToasts:x,heights:v,index:_,toasts:w,expanded:k,removeToast:C,defaultRichColors:E,closeButton:D,style:T,cancelButtonStyle:I,actionButtonStyle:R,className:P="",descriptionClassName:j="",duration:B,position:U,gap:$,expandByDefault:K,classNames:z,icons:G,closeButtonAriaLabel:ne="Close toast"}=i,[te,H]=ft.useState(null),[Q,Y]=ft.useState(null),[V,ue]=ft.useState(!1),[he,Te]=ft.useState(!1),[nt,ge]=ft.useState(!1),[_e,$e]=ft.useState(!1),[Ke,ht]=ft.useState(!1),[Ct,Ft]=ft.useState(0),[Ve,tt]=ft.useState(0),qt=ft.useRef(h.duration||B||Mge),It=ft.useRef(null),Zt=ft.useRef(null),En=_===0,Xi=_+1<=x,zi=h.type,Tr=h.dismissible!==!1,Fs=h.className||"",qo=h.descriptionClassName||"",Ge=ft.useMemo(()=>v.findIndex(on=>on.toastId===h.id)||0,[v,h.id]),mt=ft.useMemo(()=>{var on;return(on=h.closeButton)!=null?on:D},[h.closeButton,D]),tn=ft.useMemo(()=>h.duration||B||Mge,[h.duration,B]),Ln=ft.useRef(0),Un=ft.useRef(0),vs=ft.useRef(0),_r=ft.useRef(null),[Js,Ei]=U.split("-"),wi=ft.useMemo(()=>v.reduce((on,Nn,vn)=>vn>=Ge?on:on+Nn.height,0),[v,Ge]),ii=P8e(),Ko=h.invert||u,Vr=zi==="loading";Un.current=ft.useMemo(()=>Ge*$+wi,[Ge,wi]),ft.useEffect(()=>{qt.current=tn},[tn]),ft.useEffect(()=>{ue(!0)},[]),ft.useEffect(()=>{const on=Zt.current;if(on){const Nn=on.getBoundingClientRect().height;return tt(Nn),m(vn=>[{toastId:h.id,height:Nn,position:h.position},...vn]),()=>m(vn=>vn.filter(Ci=>Ci.toastId!==h.id))}},[m,h.id]),ft.useLayoutEffect(()=>{if(!V)return;const on=Zt.current,Nn=on.style.height;on.style.height="auto";const vn=on.getBoundingClientRect().height;on.style.height=Nn,tt(vn),m(Ci=>Ci.find(Ii=>Ii.toastId===h.id)?Ci.map(Ii=>Ii.toastId===h.id?{...Ii,height:vn}:Ii):[{toastId:h.id,height:vn,position:h.position},...Ci])},[V,h.title,h.description,m,h.id,h.jsx,h.action,h.cancel]);const ba=ft.useCallback(()=>{Te(!0),Ft(Un.current),m(on=>on.filter(Nn=>Nn.toastId!==h.id)),setTimeout(()=>{C(h)},G8e)},[h,C,m,Un]);ft.useEffect(()=>{if(h.promise&&zi==="loading"||h.duration===1/0||h.type==="loading")return;let on;return k||f||ii?(()=>{if(vs.current{qt.current!==1/0&&(Ln.current=new Date().getTime(),on=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),ba()},qt.current))})(),()=>clearTimeout(on)},[k,f,h,zi,ii,ba]),ft.useEffect(()=>{h.delete&&(ba(),h.onDismiss==null||h.onDismiss.call(h,h))},[ba,h.delete]);function ll(){var on;if(G!=null&&G.loading){var Nn;return ft.createElement("div",{className:Ug(z==null?void 0:z.loader,h==null||(Nn=h.classNames)==null?void 0:Nn.loader,"sonner-loader"),"data-visible":zi==="loading"},G.loading)}return ft.createElement(D8e,{className:Ug(z==null?void 0:z.loader,h==null||(on=h.classNames)==null?void 0:on.loader),visible:zi==="loading"})}const qc=h.icon||(G==null?void 0:G[zi])||E8e(zi);var _s,ys;return ft.createElement("li",{tabIndex:0,ref:Zt,className:Ug(P,Fs,z==null?void 0:z.toast,h==null||(e=h.classNames)==null?void 0:e.toast,z==null?void 0:z.default,z==null?void 0:z[zi],h==null||(t=h.classNames)==null?void 0:t[zi]),"data-sonner-toast":"","data-rich-colors":(_s=h.richColors)!=null?_s:E,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":V,"data-promise":!!h.promise,"data-swiped":Ke,"data-removed":he,"data-visible":Xi,"data-y-position":Js,"data-x-position":Ei,"data-index":_,"data-front":En,"data-swiping":nt,"data-dismissible":Tr,"data-type":zi,"data-invert":Ko,"data-swipe-out":_e,"data-swipe-direction":Q,"data-expanded":!!(k||K&&V),"data-testid":h.testId,style:{"--index":_,"--toasts-before":_,"--z-index":w.length-_,"--offset":`${he?Ct:Un.current}px`,"--initial-height":K?"auto":`${Ve}px`,...T,...h.style},onDragEnd:()=>{ge(!1),H(null),_r.current=null},onPointerDown:on=>{on.button!==2&&(Vr||!Tr||(It.current=new Date,Ft(Un.current),on.target.setPointerCapture(on.pointerId),on.target.tagName!=="BUTTON"&&(ge(!0),_r.current={x:on.clientX,y:on.clientY})))},onPointerUp:()=>{var on,Nn,vn;if(_e||!Tr)return;_r.current=null;const Ci=Number(((on=Zt.current)==null?void 0:on.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),zr=Number(((Nn=Zt.current)==null?void 0:Nn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ii=new Date().getTime()-((vn=It.current)==null?void 0:vn.getTime()),Si=te==="x"?Ci:zr,bo=Math.abs(Si)/Ii;if(Math.abs(Si)>=K8e||bo>.11){Ft(Un.current),h.onDismiss==null||h.onDismiss.call(h,h),Y(te==="x"?Ci>0?"right":"left":zr>0?"down":"up"),ba(),$e(!0);return}else{var Bs,Ai;(Bs=Zt.current)==null||Bs.style.setProperty("--swipe-amount-x","0px"),(Ai=Zt.current)==null||Ai.style.setProperty("--swipe-amount-y","0px")}ht(!1),ge(!1),H(null)},onPointerMove:on=>{var Nn,vn,Ci;if(!_r.current||!Tr||((Nn=window.getSelection())==null?void 0:Nn.toString().length)>0)return;const Ii=on.clientY-_r.current.y,Si=on.clientX-_r.current.x;var bo;const Bs=(bo=i.swipeDirections)!=null?bo:Y8e(U);!te&&(Math.abs(Si)>1||Math.abs(Ii)>1)&&H(Math.abs(Si)>Math.abs(Ii)?"x":"y");let Ai={x:0,y:0};const ws=lr=>1/(1.5+Math.abs(lr)/20);if(te==="y"){if(Bs.includes("top")||Bs.includes("bottom"))if(Bs.includes("top")&&Ii<0||Bs.includes("bottom")&&Ii>0)Ai.y=Ii;else{const lr=Ii*ws(Ii);Ai.y=Math.abs(lr)0)Ai.x=Si;else{const lr=Si*ws(Si);Ai.x=Math.abs(lr)0||Math.abs(Ai.y)>0)&&ht(!0),(vn=Zt.current)==null||vn.style.setProperty("--swipe-amount-x",`${Ai.x}px`),(Ci=Zt.current)==null||Ci.style.setProperty("--swipe-amount-y",`${Ai.y}px`)}},mt&&!h.jsx&&zi!=="loading"?ft.createElement("button",{"aria-label":ne,"data-disabled":Vr,"data-close-button":!0,onClick:Vr||!Tr?()=>{}:()=>{ba(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Ug(z==null?void 0:z.closeButton,h==null||(n=h.classNames)==null?void 0:n.closeButton)},(ys=G==null?void 0:G.close)!=null?ys:M8e):null,(zi||h.icon||h.promise)&&h.icon!==null&&((G==null?void 0:G[zi])!==null||h.icon)?ft.createElement("div",{"data-icon":"",className:Ug(z==null?void 0:z.icon,h==null||(s=h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||ll():null,h.type!=="loading"?qc:null):null,ft.createElement("div",{"data-content":"",className:Ug(z==null?void 0:z.content,h==null||(r=h.classNames)==null?void 0:r.content)},ft.createElement("div",{"data-title":"",className:Ug(z==null?void 0:z.title,h==null||(o=h.classNames)==null?void 0:o.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?ft.createElement("div",{"data-description":"",className:Ug(j,qo,z==null?void 0:z.description,h==null||(a=h.classNames)==null?void 0:a.description)},typeof h.description=="function"?h.description():h.description):null),ft.isValidElement(h.cancel)?h.cancel:h.cancel&&u5(h.cancel)?ft.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||I,onClick:on=>{u5(h.cancel)&&Tr&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,on),ba())},className:Ug(z==null?void 0:z.cancelButton,h==null||(l=h.classNames)==null?void 0:l.cancelButton)},h.cancel.label):null,ft.isValidElement(h.action)?h.action:h.action&&u5(h.action)?ft.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||R,onClick:on=>{u5(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,on),!on.defaultPrevented&&ba())},className:Ug(z==null?void 0:z.actionButton,h==null||(c=h.classNames)==null?void 0:c.actionButton)},h.action.label):null)};function Pge(){if(typeof window>"u"||typeof document>"u")return"ltr";const i=document.documentElement.getAttribute("dir");return i==="auto"||!i?window.getComputedStyle(document.documentElement).direction:i}function X8e(i,e){const t={};return[i,e].forEach((n,s)=>{const r=s===1,o=r?"--mobile-offset":"--offset",a=r?U8e:z8e;function l(c){["top","right","bottom","left"].forEach(u=>{t[`${o}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?t[`${o}-${c}`]=a:t[`${o}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):l(a)}),t}const Z8e=ft.forwardRef(function(e,t){const{id:n,invert:s,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:l,className:c,offset:u,mobileOffset:h,theme:g="light",richColors:f,duration:m,style:x,visibleToasts:v=V8e,toastOptions:_,dir:w=Pge(),gap:k=q8e,icons:C,containerAriaLabel:E="Notifications"}=e,[D,T]=ft.useState([]),I=ft.useMemo(()=>n?D.filter(V=>V.toasterId===n):D.filter(V=>!V.toasterId),[D,n]),R=ft.useMemo(()=>Array.from(new Set([r].concat(I.filter(V=>V.position).map(V=>V.position)))),[I,r]),[P,j]=ft.useState([]),[B,U]=ft.useState(!1),[$,K]=ft.useState(!1),[z,G]=ft.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ne=ft.useRef(null),te=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=ft.useRef(null),Q=ft.useRef(!1),Y=ft.useCallback(V=>{T(ue=>{var he;return(he=ue.find(Te=>Te.id===V.id))!=null&&he.delete||pd.dismiss(V.id),ue.filter(({id:Te})=>Te!==V.id)})},[]);return ft.useEffect(()=>pd.subscribe(V=>{if(V.dismiss){requestAnimationFrame(()=>{T(ue=>ue.map(he=>he.id===V.id?{...he,delete:!0}:he))});return}setTimeout(()=>{TCe.flushSync(()=>{T(ue=>{const he=ue.findIndex(Te=>Te.id===V.id);return he!==-1?[...ue.slice(0,he),{...ue[he],...V},...ue.slice(he+1)]:[V,...ue]})})})}),[D]),ft.useEffect(()=>{if(g!=="system"){G(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;const V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:ue})=>{G(ue?"dark":"light")})}catch{V.addListener(({matches:he})=>{try{G(he?"dark":"light")}catch(Te){console.error(Te)}})}},[g]),ft.useEffect(()=>{D.length<=1&&U(!1)},[D]),ft.useEffect(()=>{const V=ue=>{var he;if(o.every(ge=>ue[ge]||ue.code===ge)){var nt;U(!0),(nt=ne.current)==null||nt.focus()}ue.code==="Escape"&&(document.activeElement===ne.current||(he=ne.current)!=null&&he.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[o]),ft.useEffect(()=>{if(ne.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,Q.current=!1)}},[ne.current]),ft.createElement("section",{ref:t,"aria-label":`${E} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((V,ue)=>{var he;const[Te,nt]=V.split("-");return I.length?ft.createElement("ol",{key:V,dir:w==="auto"?Pge():w,tabIndex:-1,ref:ne,className:c,"data-sonner-toaster":!0,"data-sonner-theme":z,"data-y-position":Te,"data-x-position":nt,style:{"--front-toast-height":`${((he=P[0])==null?void 0:he.height)||0}px`,"--width":`${$8e}px`,"--gap":`${k}px`,...x,...X8e(u,h)},onBlur:ge=>{Q.current&&!ge.currentTarget.contains(ge.relatedTarget)&&(Q.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:ge=>{ge.target instanceof HTMLElement&&ge.target.dataset.dismissible==="false"||Q.current||(Q.current=!0,H.current=ge.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{$||U(!1)},onDragEnd:()=>U(!1),onPointerDown:ge=>{ge.target instanceof HTMLElement&&ge.target.dataset.dismissible==="false"||K(!0)},onPointerUp:()=>K(!1)},I.filter(ge=>!ge.position&&ue===0||ge.position===V).map((ge,_e)=>{var $e,Ke;return ft.createElement(Q8e,{key:ge.id,icons:C,index:_e,toast:ge,defaultRichColors:f,duration:($e=_==null?void 0:_.duration)!=null?$e:m,className:_==null?void 0:_.className,descriptionClassName:_==null?void 0:_.descriptionClassName,invert:s,visibleToasts:v,closeButton:(Ke=_==null?void 0:_.closeButton)!=null?Ke:l,interacting:$,position:V,style:_==null?void 0:_.style,unstyled:_==null?void 0:_.unstyled,classNames:_==null?void 0:_.classNames,cancelButtonStyle:_==null?void 0:_.cancelButtonStyle,actionButtonStyle:_==null?void 0:_.actionButtonStyle,closeButtonAriaLabel:_==null?void 0:_.closeButtonAriaLabel,removeToast:Y,toasts:I.filter(ht=>ht.position==ge.position),heights:P.filter(ht=>ht.position==ge.position),setHeights:j,expandByDefault:a,gap:k,expanded:B,swipeDirections:e.swipeDirections})})):null}))}),oSe=L.createContext({theme:"system",setTheme:()=>null,resolvedTheme:"light"});function J8e(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function e9e({children:i,defaultTheme:e="system",storageKey:t="eddi-theme"}){const[n,s]=L.useState(()=>localStorage.getItem(t)||e),[r,o]=L.useState(J8e);L.useEffect(()=>{const u=window.matchMedia("(prefers-color-scheme: dark)"),h=g=>o(g.matches?"dark":"light");return u.addEventListener("change",h),()=>u.removeEventListener("change",h)},[]);const a=n==="system"?r:n;L.useEffect(()=>{const u=window.document.documentElement;u.classList.remove("light","dark"),u.classList.add(a)},[a]);const l=L.useCallback(u=>{localStorage.setItem(t,u),s(u)},[t]),c=L.useMemo(()=>({theme:n,resolvedTheme:a,setTheme:l}),[n,a,l]);return d.jsx(oSe.Provider,{value:c,children:i})}function RM(){const i=L.useContext(oSe);if(i===void 0)throw new Error("useTheme must be used within a ThemeProvider");return i}const t9e="application/json";var Om,fd,hE,gE,yf,fE,ir,Jh,Bt,m4,aSe,lSe,cSe,dSe,nG,uSe,iG,hSe,gSe,b4,g2,sG,Mx,fSe,rG,Px,x4,f2,Jg,oG;class n9e{constructor(e){Ht(this,Bt);Ht(this,Om,[]);Ht(this,fd);Ht(this,hE,!0);Ht(this,gE);Ht(this,yf,st(this,Bt,oG).call(this,console.info));Ht(this,fE,st(this,Bt,oG).call(this,console.warn));Ht(this,ir,{enable:!0,callbackList:[],interval:5});Ht(this,Jh);kt(this,"didInitialize",!1);kt(this,"authenticated",!1);kt(this,"loginRequired",!1);kt(this,"responseMode","fragment");kt(this,"responseType","code");kt(this,"flow","standard");kt(this,"timeSkew",null);kt(this,"redirectUri");kt(this,"silentCheckSsoRedirectUri");kt(this,"silentCheckSsoFallback",!0);kt(this,"pkceMethod","S256");kt(this,"enableLogging",!1);kt(this,"logoutMethod","GET");kt(this,"scope");kt(this,"messageReceiveTimeout",1e4);kt(this,"idToken");kt(this,"idTokenParsed");kt(this,"token");kt(this,"tokenParsed");kt(this,"refreshToken");kt(this,"refreshTokenParsed");kt(this,"clientId");kt(this,"sessionId");kt(this,"subject");kt(this,"authServerUrl");kt(this,"realm");kt(this,"realmAccess");kt(this,"resourceAccess");kt(this,"profile");kt(this,"userInfo");kt(this,"endpoints");kt(this,"tokenTimeoutHandle");kt(this,"onAuthSuccess");kt(this,"onAuthError");kt(this,"onAuthRefreshSuccess");kt(this,"onAuthRefreshError");kt(this,"onTokenExpired");kt(this,"onAuthLogout");kt(this,"onReady");kt(this,"onActionUpdate");kt(this,"init",async(e={})=>{var n;if(this.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");this.didInitialize=!0,yt(this,gE,c9e());const t=["default","cordova","cordova-native"];if(typeof e.adapter=="string"&&t.includes(e.adapter)?yt(this,fd,st(this,Bt,m4).call(this,e.adapter)):typeof e.adapter=="object"?yt(this,fd,e.adapter):"Cordova"in window||"cordova"in window?yt(this,fd,st(this,Bt,m4).call(this,"cordova")):yt(this,fd,st(this,Bt,m4).call(this,"default")),typeof e.useNonce<"u"&&yt(this,hE,e.useNonce),typeof e.checkLoginIframe<"u"&&(oe(this,ir).enable=e.checkLoginIframe),e.checkLoginIframeInterval&&(oe(this,ir).interval=e.checkLoginIframeInterval),e.onLoad==="login-required"&&(this.loginRequired=!0),e.responseMode)if(e.responseMode==="query"||e.responseMode==="fragment")this.responseMode=e.responseMode;else throw new Error("Invalid value for responseMode");if(e.flow){switch(e.flow){case"standard":this.responseType="code";break;case"implicit":this.responseType="id_token token";break;case"hybrid":this.responseType="code id_token token";break;default:throw new Error("Invalid value for flow")}this.flow=e.flow}if(typeof e.timeSkew=="number"&&(this.timeSkew=e.timeSkew),e.redirectUri&&(this.redirectUri=e.redirectUri),e.silentCheckSsoRedirectUri&&(this.silentCheckSsoRedirectUri=e.silentCheckSsoRedirectUri),typeof e.silentCheckSsoFallback=="boolean"&&(this.silentCheckSsoFallback=e.silentCheckSsoFallback),typeof e.pkceMethod<"u"){if(e.pkceMethod!=="S256"&&e.pkceMethod!==!1)throw new TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${e.pkceMethod}.`);this.pkceMethod=e.pkceMethod}return typeof e.enableLogging=="boolean"&&(this.enableLogging=e.enableLogging),e.logoutMethod==="POST"&&(this.logoutMethod="POST"),typeof e.scope=="string"&&(this.scope=e.scope),typeof e.messageReceiveTimeout=="number"&&e.messageReceiveTimeout>0&&(this.messageReceiveTimeout=e.messageReceiveTimeout),await st(this,Bt,dSe).call(this),await st(this,Bt,hSe).call(this),await st(this,Bt,gSe).call(this,e),(n=this.onReady)==null||n.call(this,this.authenticated),this.authenticated});kt(this,"login",e=>oe(this,fd).login(e));kt(this,"createLoginUrl",async e=>{const t=Oge(),n=Oge(),s=oe(this,fd).redirectUri(e),r={state:t,nonce:n,redirectUri:s,loginOptions:e};e!=null&&e.prompt&&(r.prompt=e.prompt);const o=(e==null?void 0:e.action)==="register"?this.endpoints.register():this.endpoints.authorize();let a=(e==null?void 0:e.scope)||this.scope;const l=a?a.split(" "):[];l.includes("openid")||l.unshift("openid"),a=l.join(" ");const c=new URLSearchParams([["client_id",this.clientId],["redirect_uri",s],["state",t],["response_mode",this.responseMode],["response_type",this.responseType],["scope",a]]);if(oe(this,hE)&&c.append("nonce",n),e!=null&&e.prompt&&c.append("prompt",e.prompt),typeof(e==null?void 0:e.maxAge)=="number"&&c.append("max_age",e.maxAge.toString()),e!=null&&e.loginHint&&c.append("login_hint",e.loginHint),e!=null&&e.idpHint&&c.append("kc_idp_hint",e.idpHint),e!=null&&e.action&&e.action!=="register"&&c.append("kc_action",e.action),e!=null&&e.locale&&c.append("ui_locales",e.locale),e!=null&&e.acr&&c.append("claims",i9e(e.acr)),e!=null&&e.acrValues&&c.append("acr_values",e.acrValues),this.pkceMethod)try{const u=s9e(96),h=await r9e(this.pkceMethod,u);r.pkceCodeVerifier=u,c.append("code_challenge",h),c.append("code_challenge_method",this.pkceMethod)}catch(u){throw new Error("Failed to generate PKCE challenge.",{cause:u})}return oe(this,gE).add(r),`${o}?${c.toString()}`});kt(this,"logout",e=>oe(this,fd).logout(e));kt(this,"createLogoutUrl",e=>{const t=(e==null?void 0:e.logoutMethod)??this.logoutMethod,n=this.endpoints.logout();if(t==="POST")return n;const s=new URLSearchParams([["client_id",this.clientId],["post_logout_redirect_uri",oe(this,fd).redirectUri(e)]]);return this.idToken&&s.append("id_token_hint",this.idToken),`${n}?${s.toString()}`});kt(this,"register",e=>oe(this,fd).register(e));kt(this,"createRegisterUrl",e=>this.createLoginUrl({...e,action:"register"}));kt(this,"createAccountUrl",e=>{const t=st(this,Bt,Jg).call(this);if(!t)throw new Error("Unable to create account URL, make sure the adapter is not configured using a generic OIDC provider.");const n=new URLSearchParams([["referrer",this.clientId],["referrer_uri",oe(this,fd).redirectUri(e)]]);return`${t}/account?${n.toString()}`});kt(this,"accountManagement",()=>oe(this,fd).accountManagement());kt(this,"hasRealmRole",e=>{const t=this.realmAccess;return!!t&&t.roles.indexOf(e)>=0});kt(this,"hasResourceRole",(e,t)=>{if(!this.resourceAccess)return!1;const n=this.resourceAccess[t||this.clientId];return!!n&&n.roles.indexOf(e)>=0});kt(this,"loadUserProfile",async()=>{const e=st(this,Bt,Jg).call(this);if(!e)throw new Error("Unable to load user profile, make sure the adapter is not configured using a generic OIDC provider.");const t=`${e}/account`,n=await IE(t,{headers:[jge(this.token)]});return this.profile=n});kt(this,"loadUserInfo",async()=>{const e=this.endpoints.userinfo(),t=await IE(e,{headers:[jge(this.token)]});return this.userInfo=t});kt(this,"isTokenExpired",e=>{if(!this.tokenParsed||!this.refreshToken&&this.flow!=="implicit")throw new Error("Not authenticated");if(this.timeSkew==null)return oe(this,yf).call(this,"[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;if(typeof this.tokenParsed.exp!="number")return!1;let t=this.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+this.timeSkew;if(e){if(isNaN(e))throw new Error("Invalid minValidity");t-=e}return t<0});kt(this,"updateToken",async e=>{var o,a;if(!this.refreshToken)throw new Error("Unable to update token, no refresh token available.");e=e||5,oe(this,ir).enable&&await st(this,Bt,g2).call(this);let t=!1;if(e===-1?(t=!0,oe(this,yf).call(this,"[KEYCLOAK] Refreshing token: forced refresh")):(!this.tokenParsed||this.isTokenExpired(e))&&(t=!0,oe(this,yf).call(this,"[KEYCLOAK] Refreshing token: token expired")),!t)return!1;const{promise:n,resolve:s,reject:r}=Promise.withResolvers();if(oe(this,Om).push({resolve:s,reject:r}),oe(this,Om).length===1){const l=this.endpoints.token();let c=new Date().getTime();try{const u=await v9e(l,this.refreshToken,this.clientId);oe(this,yf).call(this,"[KEYCLOAK] Token refreshed"),c=(c+new Date().getTime())/2,st(this,Bt,f2).call(this,u.access_token,u.refresh_token,u.id_token,c),(o=this.onAuthRefreshSuccess)==null||o.call(this);for(let h=oe(this,Om).pop();h!=null;h=oe(this,Om).pop())h.resolve(!0)}catch(u){oe(this,fE).call(this,"[KEYCLOAK] Failed to refresh token"),u instanceof xSe&&u.response.status===400&&this.clearToken(),(a=this.onAuthRefreshError)==null||a.call(this);for(let h=oe(this,Om).pop();h!=null;h=oe(this,Om).pop())h.reject(u)}}return await n});kt(this,"clearToken",()=>{var e;this.token&&(st(this,Bt,f2).call(this),(e=this.onAuthLogout)==null||e.call(this),this.loginRequired&&this.login())});if(typeof e!="string"&&!uG(e))throw new Error("The 'Keycloak' constructor must be provided with a configuration object, or a URL to a JSON configuration file.");if(uG(e)){const t="oidcProvider"in e?["clientId"]:["url","realm","clientId"];for(const n of t)if(!(n in e))throw new Error(`The configuration object is missing the required '${n}' property.`)}globalThis.isSecureContext||oe(this,fE).call(this,`[KEYCLOAK] Keycloak JS must be used in a 'secure context' to function properly as it relies on browser APIs that are otherwise not available.
-Continuing to run your application insecurely will lead to unexpected behavior and breakage.
-
-For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts`),yt(this,Jh,e)}}Om=new WeakMap,fd=new WeakMap,hE=new WeakMap,gE=new WeakMap,yf=new WeakMap,fE=new WeakMap,ir=new WeakMap,Jh=new WeakMap,Bt=new WeakSet,m4=function(e){if(e==="default")return st(this,Bt,aSe).call(this);if(e==="cordova")return oe(this,ir).enable=!1,st(this,Bt,lSe).call(this);if(e==="cordova-native")return oe(this,ir).enable=!1,st(this,Bt,cSe).call(this);throw new Error("invalid adapter type: "+e)},aSe=function(){const e=t=>(t==null?void 0:t.redirectUri)||this.redirectUri||globalThis.location.href;return{login:async t=>(window.location.assign(await this.createLoginUrl(t)),await new Promise(()=>{})),logout:async t=>{if(((t==null?void 0:t.logoutMethod)??this.logoutMethod)==="GET"){window.location.replace(this.createLogoutUrl(t));return}const s=document.createElement("form");s.setAttribute("method","POST"),s.setAttribute("action",this.createLogoutUrl(t)),s.style.display="none";const r={id_token_hint:this.idToken,client_id:this.clientId,post_logout_redirect_uri:e(t)};for(const[o,a]of Object.entries(r)){const l=document.createElement("input");l.setAttribute("type","hidden"),l.setAttribute("name",o),l.setAttribute("value",a),s.appendChild(l)}document.body.appendChild(s),s.submit()},register:async t=>(window.location.assign(await this.createRegisterUrl(t)),await new Promise(()=>{})),accountManagement:async()=>{const t=this.createAccountUrl();if(typeof t<"u")window.location.href=t;else throw new Error("Not supported by the OIDC server");return await new Promise(()=>{})},redirectUri:e}},lSe=function(){const e=(o,a,l)=>window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(o,a,l):window.open(o,a,l),t=o=>o&&o.cordovaOptions?Object.keys(o.cordovaOptions).reduce((a,l)=>(a[l]=o.cordovaOptions[l],a),{}):{},n=o=>Object.keys(o).reduce((a,l)=>(a.push(l+"="+o[l]),a),[]).join(","),s=o=>{const a=t(o);return a.location="no",o&&o.prompt==="none"&&(a.hidden="yes"),n(a)},r=()=>this.redirectUri||"http://localhost";return{login:async o=>{const a=s(o),l=await this.createLoginUrl(o),c=e(l,"_blank",a);let u=!1,h=!1;function g(){h=!0,c.close()}return await new Promise((f,m)=>{c.addEventListener("loadstart",async x=>{if(x.url.indexOf(r())===0){const v=st(this,Bt,Mx).call(this,x.url);try{await st(this,Bt,Px).call(this,v),f()}catch(_){m(_)}g(),u=!0}}),c.addEventListener("loaderror",async x=>{if(!u)if(x.url.indexOf(r())===0){const v=st(this,Bt,Mx).call(this,x.url);try{await st(this,Bt,Px).call(this,v),f()}catch(_){m(_)}g(),u=!0}else m(new Error("Unable to process login.")),g()}),c.addEventListener("exit",function(x){h||m(new Error("User closed the login window."))})})},logout:async o=>{const a=this.createLogoutUrl(o),l=e(a,"_blank","location=no,hidden=yes,clearcache=yes");let c=!1;l.addEventListener("loadstart",u=>{u.url.indexOf(r())===0&&l.close()}),l.addEventListener("loaderror",u=>{u.url.indexOf(r())===0||(c=!0),l.close()}),await new Promise((u,h)=>{l.addEventListener("exit",()=>{c?h(new Error("User closed the login window.")):(this.clearToken(),u())})})},register:async o=>{const a=await this.createRegisterUrl(),l=s(o),c=e(a,"_blank",l);await new Promise((h,g)=>{c.addEventListener("loadstart",async f=>{if(f.url.indexOf(r())===0){c.close();const m=st(this,Bt,Mx).call(this,f.url);try{await st(this,Bt,Px).call(this,m),h()}catch(x){g(x)}}})})},accountManagement:async()=>{const o=this.createAccountUrl();if(typeof o<"u"){const a=e(o,"_blank","location=no");a.addEventListener("loadstart",function(l){l.url.indexOf(r())===0&&a.close()})}else throw new Error("Not supported by the OIDC server")},redirectUri:()=>r()}},cSe=function(){return{login:async e=>{const t=await this.createLoginUrl(e);await new Promise((n,s)=>{universalLinks.subscribe("keycloak",async r=>{universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();const o=st(this,Bt,Mx).call(this,r.url);try{await st(this,Bt,Px).call(this,o),n()}catch(a){s(a)}}),window.cordova.plugins.browsertab.openUrl(t)})},logout:async e=>{const t=this.createLogoutUrl(e);await new Promise(n=>{universalLinks.subscribe("keycloak",()=>{universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),this.clearToken(),n()}),window.cordova.plugins.browsertab.openUrl(t)})},register:async e=>{const t=await this.createRegisterUrl(e);await new Promise((n,s)=>{universalLinks.subscribe("keycloak",async r=>{universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();const o=st(this,Bt,Mx).call(this,r.url);try{await st(this,Bt,Px).call(this,o),n()}catch(a){s(a)}}),window.cordova.plugins.browsertab.openUrl(t)})},accountManagement:async()=>{const e=this.createAccountUrl();if(typeof e<"u")window.cordova.plugins.browsertab.openUrl(e);else throw new Error("Not supported by the OIDC server")},redirectUri:e=>e&&e.redirectUri?e.redirectUri:this.redirectUri?this.redirectUri:"http://localhost"}},dSe=async function(){if(typeof oe(this,Jh)=="string"){const e=await m9e(oe(this,Jh));this.authServerUrl=e["auth-server-url"],this.realm=e.realm,this.clientId=e.resource,st(this,Bt,nG).call(this)}else this.clientId=oe(this,Jh).clientId,"oidcProvider"in oe(this,Jh)?await st(this,Bt,uSe).call(this,oe(this,Jh).oidcProvider):(this.authServerUrl=oe(this,Jh).url,this.realm=oe(this,Jh).realm,st(this,Bt,nG).call(this))},nG=function(){this.endpoints={authorize:()=>st(this,Bt,Jg).call(this)+"/protocol/openid-connect/auth",token:()=>st(this,Bt,Jg).call(this)+"/protocol/openid-connect/token",logout:()=>st(this,Bt,Jg).call(this)+"/protocol/openid-connect/logout",checkSessionIframe:()=>st(this,Bt,Jg).call(this)+"/protocol/openid-connect/login-status-iframe.html",thirdPartyCookiesIframe:()=>st(this,Bt,Jg).call(this)+"/protocol/openid-connect/3p-cookies/step1.html",register:()=>st(this,Bt,Jg).call(this)+"/protocol/openid-connect/registrations",userinfo:()=>st(this,Bt,Jg).call(this)+"/protocol/openid-connect/userinfo"}},uSe=async function(e){if(typeof e=="string"){const t=`${Fge(e)}/.well-known/openid-configuration`,n=await b9e(t);st(this,Bt,iG).call(this,n)}else st(this,Bt,iG).call(this,e)},iG=function(e){this.endpoints={authorize(){return e.authorization_endpoint},token(){return e.token_endpoint},logout(){if(!e.end_session_endpoint)throw new Error("Not supported by the OIDC server");return e.end_session_endpoint},checkSessionIframe(){if(!e.check_session_iframe)throw new Error("Not supported by the OIDC server");return e.check_session_iframe},register(){throw new Error('Redirection to "Register user" page not supported in standard OIDC mode')},userinfo(){if(!e.userinfo_endpoint)throw new Error("Not supported by the OIDC server");return e.userinfo_endpoint}}},hSe=async function(){if(!oe(this,ir).enable&&!this.silentCheckSsoRedirectUri||typeof this.endpoints.thirdPartyCookiesIframe!="function")return;const e=document.createElement("iframe");e.setAttribute("src",this.endpoints.thirdPartyCookiesIframe()),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-3p-check-iframe"),e.style.display="none",document.body.appendChild(e);const t=new Promise(n=>{const s=r=>{e.contentWindow===r.source&&(r.data!=="supported"&&r.data!=="unsupported"||(r.data==="unsupported"&&(oe(this,fE).call(this,`[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
-
- - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).
- - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).
-
-For more information see: https://www.keycloak.org/securing-apps/javascript-adapter#_modern_browsers`),oe(this,ir).enable=!1,this.silentCheckSsoFallback&&(this.silentCheckSsoRedirectUri=void 0)),document.body.removeChild(e),window.removeEventListener("message",s),n()))};window.addEventListener("message",s,!1)});return await l9e(t,this.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")},gSe=async function(e){var r,o,a;const t=st(this,Bt,Mx).call(this,window.location.href);if(t!=null&&t.newUrl&&window.history.replaceState(window.history.state,"",t.newUrl),t&&t.valid){await st(this,Bt,b4).call(this),await st(this,Bt,Px).call(this,t);return}const n=async l=>{const c={};l||(c.prompt="none"),e.locale&&(c.locale=e.locale),await this.login(c)},s=async()=>{switch(e.onLoad){case"check-sso":oe(this,ir).enable?(await st(this,Bt,b4).call(this),await st(this,Bt,g2).call(this)||(this.silentCheckSsoRedirectUri?await st(this,Bt,sG).call(this):await n(!1))):this.silentCheckSsoRedirectUri?await st(this,Bt,sG).call(this):await n(!1);break;case"login-required":await n(!0);break;default:throw new Error("Invalid value for onLoad")}};if(e.token&&e.refreshToken)if(st(this,Bt,f2).call(this,e.token,e.refreshToken,e.idToken),oe(this,ir).enable)await st(this,Bt,b4).call(this),await st(this,Bt,g2).call(this)&&((r=this.onAuthSuccess)==null||r.call(this),st(this,Bt,x4).call(this));else try{await this.updateToken(-1),(o=this.onAuthSuccess)==null||o.call(this)}catch(l){if((a=this.onAuthError)==null||a.call(this),e.onLoad)await s();else throw l}else e.onLoad&&await s()},b4=async function(){if(!oe(this,ir).enable||oe(this,ir).iframe)return;const e=document.createElement("iframe");oe(this,ir).iframe=e,e.setAttribute("src",this.endpoints.checkSessionIframe()),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-session-iframe"),e.style.display="none",document.body.appendChild(e);const t=s=>{var o;if(s.origin!==oe(this,ir).iframeOrigin||((o=oe(this,ir).iframe)==null?void 0:o.contentWindow)!==s.source||!(s.data==="unchanged"||s.data==="changed"||s.data==="error"))return;s.data!=="unchanged"&&this.clearToken();const r=oe(this,ir).callbackList;oe(this,ir).callbackList=[];for(const a of r.reverse())s.data==="error"?a(new Error("Error while checking login iframe")):a(null,s.data==="unchanged")};window.addEventListener("message",t,!1),await new Promise(s=>{e.addEventListener("load",()=>{const r=this.endpoints.authorize();r.startsWith("/")?oe(this,ir).iframeOrigin=globalThis.location.origin:oe(this,ir).iframeOrigin=new URL(r).origin,s()})})},g2=async function(){if(!oe(this,ir).iframe||!oe(this,ir).iframeOrigin)return;const e=`${this.clientId} ${this.sessionId?this.sessionId:""}`,t=oe(this,ir).iframeOrigin;return await new Promise((s,r)=>{var a,l;const o=(c,u)=>c?r(c):s(u);oe(this,ir).callbackList.push(o),oe(this,ir).callbackList.length===1&&((l=(a=oe(this,ir).iframe)==null?void 0:a.contentWindow)==null||l.postMessage(e,t))})},sG=async function(){const e=document.createElement("iframe"),t=await this.createLoginUrl({prompt:"none",redirectUri:this.silentCheckSsoRedirectUri});return e.setAttribute("src",t),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e),await new Promise((n,s)=>{const r=async o=>{if(o.origin!==window.location.origin||e.contentWindow!==o.source)return;const a=st(this,Bt,Mx).call(this,o.data);try{await st(this,Bt,Px).call(this,a),n()}catch(l){s(l)}document.body.removeChild(e),window.removeEventListener("message",r)};window.addEventListener("message",r)})},Mx=function(e){const t=st(this,Bt,fSe).call(this,e);if(!t)return;const n=oe(this,gE).get(t.state);return n&&(t.valid=!0,t.redirectUri=n.redirectUri,t.storedNonce=n.nonce,t.prompt=n.prompt,t.pkceCodeVerifier=n.pkceCodeVerifier,t.loginOptions=n.loginOptions),t},fSe=function(e){let t=[];switch(this.flow){case"standard":t=["code","state","session_state","kc_action_status","kc_action","iss"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","kc_action","iss"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","kc_action","iss"];break}t.push("error"),t.push("error_description"),t.push("error_uri");const n=new URL(e);let s="",r;if(this.responseMode==="query"&&n.searchParams.size>0?(r=st(this,Bt,rG).call(this,n.search,t),n.search=r.paramsString,s=n.toString()):this.responseMode==="fragment"&&n.hash.length>0&&(r=st(this,Bt,rG).call(this,n.hash.substring(1),t),n.hash=r.paramsString,s=n.toString()),r!=null&&r.oauthParams){if(this.flow==="standard"||this.flow==="hybrid"){if((r.oauthParams.code||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=s,r.oauthParams}else if(this.flow==="implicit"&&(r.oauthParams.access_token||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=s,r.oauthParams}},rG=function(e,t){const n=e.split("&"),s={};let r="";for(const o of n.reverse()){const a=new URLSearchParams(o).entries().next().value;if(!a){r="&"+r;continue}const[l,c]=a;t.includes(l)&&!(l in s)?s[l]=c:r=r.length===0?o:o+"&"+r}return{paramsString:r,oauthParams:s}},Px=async function(e){var a,l,c,u;const{code:t,error:n,prompt:s}=e;let r=new Date().getTime();const o=(h,g,f)=>{if(r=(r+new Date().getTime())/2,st(this,Bt,f2).call(this,h,g,f,r),oe(this,hE)&&this.idTokenParsed&&this.idTokenParsed.nonce!==e.storedNonce)throw oe(this,yf).call(this,"[KEYCLOAK] Invalid nonce, clearing token"),this.clearToken(),new Error("Invalid nonce.")};if(e.kc_action_status&&this.onActionUpdate&&this.onActionUpdate(e.kc_action_status,e.kc_action),n){if(s!=="none")if(e.error_description&&e.error_description==="authentication_expired")await this.login(e.loginOptions);else{const h={error:n,error_description:e.error_description};throw(a=this.onAuthError)==null||a.call(this,h),h}return}else this.flow!=="standard"&&(e.access_token||e.id_token)&&(o(e.access_token,void 0,e.id_token),(l=this.onAuthSuccess)==null||l.call(this));if(this.flow!=="implicit"&&t)try{const h=await x9e(this.endpoints.token(),t,this.clientId,e.redirectUri,e.pkceCodeVerifier);o(h.access_token,h.refresh_token,h.id_token),this.flow==="standard"&&((c=this.onAuthSuccess)==null||c.call(this)),st(this,Bt,x4).call(this)}catch(h){throw(u=this.onAuthError)==null||u.call(this),h}},x4=async function(){oe(this,ir).enable&&this.token&&(await y9e(oe(this,ir).interval*1e3),await st(this,Bt,g2).call(this)&&await st(this,Bt,x4).call(this))},f2=function(e,t,n,s){if(this.tokenTimeoutHandle&&(clearTimeout(this.tokenTimeoutHandle),this.tokenTimeoutHandle=void 0),t?(this.refreshToken=t,this.refreshTokenParsed=Jz(t)):(delete this.refreshToken,delete this.refreshTokenParsed),n?(this.idToken=n,this.idTokenParsed=Jz(n)):(delete this.idToken,delete this.idTokenParsed),e){if(this.token=e,this.tokenParsed=Jz(e),this.sessionId=this.tokenParsed.sid,this.authenticated=!0,this.subject=this.tokenParsed.sub,this.realmAccess=this.tokenParsed.realm_access,this.resourceAccess=this.tokenParsed.resource_access,s&&(this.timeSkew=Math.floor(s/1e3)-this.tokenParsed.iat),this.timeSkew!==null&&(oe(this,yf).call(this,"[KEYCLOAK] Estimated time difference between browser and server is "+this.timeSkew+" seconds"),this.onTokenExpired)){const r=(this.tokenParsed.exp-new Date().getTime()/1e3+this.timeSkew)*1e3;oe(this,yf).call(this,"[KEYCLOAK] Token expires in "+Math.round(r/1e3)+" s"),r<=0?this.onTokenExpired():this.tokenTimeoutHandle=window.setTimeout(this.onTokenExpired,r)}}else delete this.token,delete this.tokenParsed,delete this.subject,delete this.realmAccess,delete this.resourceAccess,this.authenticated=!1},Jg=function(){if(!(typeof this.authServerUrl>"u"))return`${Fge(this.authServerUrl)}/realms/${encodeURIComponent(this.realm)}`},oG=function(e){return t=>{this.enableLogging&&e.call(console,t)}};function Oge(){if(typeof crypto>"u"||typeof crypto.randomUUID>"u")throw new Error("Web Crypto API is not available.");return crypto.randomUUID()}function i9e(i){return JSON.stringify({id_token:{acr:i}})}function s9e(i){return o9e(i,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}async function r9e(i,e){if(i!=="S256")throw new TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${i}'.`);const t=new Uint8Array(await g9e(e));return h9e(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function o9e(i,e){const t=a9e(i),n=new Array(i);for(let s=0;s"u"||typeof crypto.getRandomValues>"u")throw new Error("Web Crypto API is not available.");return crypto.getRandomValues(new Uint8Array(i))}function l9e(i,e,t){let n;const s=new Promise(function(r,o){n=window.setTimeout(function(){o(new Error(t))},e)});return Promise.race([i,s]).finally(function(){clearTimeout(n)})}function c9e(){try{return new d9e}catch{return new u9e}}const gN="kc-callback-";var Th,aG,pSe,lG,mSe;class d9e{constructor(){Ht(this,Th);globalThis.localStorage.setItem("kc-test","test"),globalThis.localStorage.removeItem("kc-test")}get(e){if(!e)return null;st(this,Th,aG).call(this);const t=gN+e,n=globalThis.localStorage.getItem(t);return n?(globalThis.localStorage.removeItem(t),JSON.parse(n)):null}add(e){st(this,Th,aG).call(this);const t=gN+e.state,n=JSON.stringify({...e,expires:Date.now()+3600*1e3});try{globalThis.localStorage.setItem(t,n)}catch{st(this,Th,pSe).call(this),globalThis.localStorage.setItem(t,n)}}}Th=new WeakSet,aG=function(){const e=Date.now();for(const[t,n]of st(this,Th,lG).call(this)){const s=st(this,Th,mSe).call(this,n);(s===null||se.startsWith(gN))},mSe=function(e){let t;try{t=JSON.parse(e)}catch{return null}return uG(t)&&"expires"in t&&typeof t.expires=="number"?t.expires:null};var fp,bSe,cG,dG;class u9e{constructor(){Ht(this,fp)}get(e){if(!e)return null;const t=st(this,fp,bSe).call(this,gN+e);return st(this,fp,cG).call(this,gN+e,"",st(this,fp,dG).call(this,-100)),t?JSON.parse(t):null}add(e){st(this,fp,cG).call(this,gN+e.state,JSON.stringify(e),st(this,fp,dG).call(this,60))}}fp=new WeakSet,bSe=function(e){const t=e+"=",n=document.cookie.split(";");for(let s=0;s"u"||typeof crypto.subtle>"u")throw new Error("Web Crypto API is not available.");return await crypto.subtle.digest("SHA-256",t)}function Jz(i){const[,e]=i.split(".");if(typeof e!="string")throw new Error("Unable to decode token, payload not found.");let t;try{t=f9e(e)}catch(n){throw new Error("Unable to decode token, payload is not a valid Base64URL value.",{cause:n})}try{return JSON.parse(t)}catch(n){throw new Error("Unable to decode token, payload is not a valid JSON value.",{cause:n})}}function f9e(i){let e=i.replaceAll("-","+").replaceAll("_","/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("Input is not of the correct length.")}try{return p9e(e)}catch{return atob(e)}}function p9e(i){return decodeURIComponent(atob(i).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function uG(i){return typeof i=="object"&&i!==null}async function m9e(i){return await IE(i)}async function b9e(i){return await IE(i)}async function x9e(i,e,t,n,s){const r=new URLSearchParams([["code",e],["grant_type","authorization_code"],["client_id",t],["redirect_uri",n]]);return s&&r.append("code_verifier",s),await IE(i,{method:"POST",credentials:"include",body:r})}async function v9e(i,e,t){const n=new URLSearchParams([["grant_type","refresh_token"],["refresh_token",e],["client_id",t]]);return await IE(i,{method:"POST",credentials:"include",body:n})}async function IE(i,e={}){const t=new Headers(e.headers);return t.set("Accept",t9e),await(await _9e(i,{...e,headers:t})).json()}async function _9e(i,e){const t=await fetch(i,e);if(!t.ok)throw new xSe("Server responded with an invalid status.",{response:t});return t}function jge(i){if(!i)throw new Error("Unable to build authorization header, token is not set, make sure the user is authenticated.");return["Authorization",`bearer ${i}`]}function Fge(i){return i.endsWith("/")?i.slice(0,-1):i}class xSe extends Error{constructor(t,n){super(t,n);kt(this,"response");this.response=n.response}}const y9e=i=>new Promise(e=>setTimeout(e,i)),eU={url:"http://localhost:8180",realm:"eddi",clientId:"eddi-frontend"};function w9e(){const i=window.__EDDI_AUTH__;return(i==null?void 0:i.method)==="keycloak"?{method:"keycloak",url:i.url||eU.url,realm:i.realm||eU.realm,clientId:i.clientId||eU.clientId}:{method:"none",url:"",realm:"",clientId:""}}const C9e=window.location.origin;function Iie(i){return typeof i=="object"&&i!==null&&"status"in i&&"message"in i}function Vs(i){return Iie(i)?`${i.message} (HTTP ${i.status})`:i instanceof Error?i.message:String(i)}class S9e{constructor(e){kt(this,"baseUrl");kt(this,"headers",{"Content-Type":"application/json"});this.baseUrl=e}setAuthToken(e){this.headers.Authorization=`Bearer ${e}`}clearAuthToken(){delete this.headers.Authorization}getAuthHeader(){const e=this.headers.Authorization;return e?{Authorization:e}:{}}getBaseUrl(){return this.baseUrl}async request(e,t,n,s){const r=`${this.baseUrl}${t}`,o={...this.headers,...s};let a;try{a=await fetch(r,{method:e,headers:o,body:n!==void 0?typeof n=="string"?n:JSON.stringify(n):void 0})}catch(h){throw{status:0,message:h instanceof Error?`Network error: ${h.message}`:"Network error: unable to reach server",url:r}}if(!a.ok){const h={status:a.status,message:a.statusText,url:r};try{const g=await a.json();h.message=g.message||g.errorMessage||g.detail||a.statusText}catch{}throw h}if(a.status===202||a.status===204)return;const l=a.headers.get("Location");if(l&&(a.status===200||a.status===201))try{return{...await a.json(),location:l}}catch{return{location:l}}if(a.headers.get("Content-Length")==="0")return;const u=await a.text();if(u)try{return JSON.parse(u)}catch{throw{status:a.status,message:"Unexpected non-JSON response",url:r}}}get(e){return this.request("GET",e)}post(e,t,n){return this.request("POST",e,t,n)}put(e,t,n){return this.request("PUT",e,t,n)}patch(e,t,n){return this.request("PATCH",e,t,n)}delete(e){return this.request("DELETE",e)}}const Oe=new S9e(C9e),vSe={authenticated:!0,loading:!1,user:null,roles:[],method:"none",login:()=>{},logout:()=>{}},Aie=L.createContext(vSe);function k9e({children:i,configOverride:e}){const t=L.useMemo(()=>e??w9e(),[e]);return t.method==="none"?d.jsx(Aie.Provider,{value:vSe,children:i}):d.jsx(N9e,{config:t,children:i})}function N9e({config:i,children:e}){const[t]=L.useState(()=>new n9e({url:i.url,realm:i.realm,clientId:i.clientId})),[n,s]=L.useState(!1),[r,o]=L.useState(!0),[a,l]=L.useState(null),[c,u]=L.useState([]);L.useEffect(()=>{let m=!0;return(async()=>{var v,_,w,k,C,E,D,T,I,R,P,j;try{t.onTokenExpired=()=>{t.updateToken(30).then(()=>{m&&t.token&&Oe.setAuthToken(t.token)}).catch(()=>{console.warn("[EDDI Auth] Token refresh failed, logging out"),t.logout()})};const B=await t.init({onLoad:"login-required",checkLoginIframe:!1,pkceMethod:"S256",responseMode:"query"});if(!m)return;if(s(B),B&&t.token){Oe.setAuthToken(t.token);try{const $=await t.loadUserInfo();l({username:$.preferred_username??((v=t.tokenParsed)==null?void 0:v.preferred_username)??"",firstName:$.given_name??((_=t.tokenParsed)==null?void 0:_.given_name)??"",lastName:$.family_name??((w=t.tokenParsed)==null?void 0:w.family_name)??"",email:$.email??((k=t.tokenParsed)==null?void 0:k.email)??"",fullName:$.name??((C=t.tokenParsed)==null?void 0:C.name)??""})}catch{l({username:((E=t.tokenParsed)==null?void 0:E.preferred_username)??"",firstName:((D=t.tokenParsed)==null?void 0:D.given_name)??"",lastName:((T=t.tokenParsed)==null?void 0:T.family_name)??"",email:((I=t.tokenParsed)==null?void 0:I.email)??"",fullName:((R=t.tokenParsed)==null?void 0:R.name)??""})}const U=((j=(P=t.tokenParsed)==null?void 0:P.realm_access)==null?void 0:j.roles)??[];u(U)}o(!1)}catch(B){if(!m)return;console.error("[EDDI Auth] Keycloak init failed:",B),o(!1),s(!1)}})(),()=>{m=!1}},[]);const h=L.useCallback(()=>{t.login()},[t]),g=L.useCallback(()=>{Oe.clearAuthToken(),t.logout({redirectUri:window.location.origin})},[t]),f=L.useMemo(()=>({authenticated:n,loading:r,user:a,roles:c,method:"keycloak",login:h,logout:g}),[n,r,a,c,h,g]);return r?d.jsx("div",{className:"flex h-screen items-center justify-center bg-background","data-testid":"auth-loading",children:d.jsxs("div",{className:"flex flex-col items-center gap-4",children:[d.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-muted border-t-primary"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Authenticating…"})]})}):d.jsx(Aie.Provider,{value:f,children:e})}const E9e=(i,e,t,n)=>{var r,o,a,l;const s=[t,{code:e,...n||{}}];if((o=(r=i==null?void 0:i.services)==null?void 0:r.logger)!=null&&o.forward)return i.services.logger.forward(s,"warn","react-i18next::",!0);c1(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(l=(a=i==null?void 0:i.services)==null?void 0:a.logger)!=null&&l.warn?i.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},Bge={},hG=(i,e,t,n)=>{c1(t)&&Bge[t]||(c1(t)&&(Bge[t]=new Date),E9e(i,e,t,n))},_Se=(i,e)=>()=>{if(i.isInitialized)e();else{const t=()=>{setTimeout(()=>{i.off("initialized",t)},0),e()};i.on("initialized",t)}},gG=(i,e,t)=>{i.loadNamespaces(e,_Se(i,t))},Hge=(i,e,t,n)=>{if(c1(t)&&(t=[t]),i.options.preload&&i.options.preload.indexOf(e)>-1)return gG(i,t,n);t.forEach(s=>{i.options.ns.indexOf(s)<0&&i.options.ns.push(s)}),i.loadLanguages(e,_Se(i,n))},L9e=(i,e,t={})=>!e.languages||!e.languages.length?(hG(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(i,{lng:t.lng,precheck:(n,s)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!s(n.isLanguageChangingTo,i))return!1}}),c1=i=>typeof i=="string",D9e=i=>typeof i=="object"&&i!==null,T9e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,I9e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},A9e=i=>I9e[i],R9e=i=>i.replace(T9e,A9e);let fG={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:R9e};const M9e=(i={})=>{fG={...fG,...i}},P9e=()=>fG;let ySe;const O9e=i=>{ySe=i},j9e=()=>ySe,F9e={type:"3rdParty",init(i){M9e(i.options.react),O9e(i)}},B9e=L.createContext();class H9e{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const W9e=(i,e)=>{const t=L.useRef();return L.useEffect(()=>{t.current=i},[i,e]),t.current},wSe=(i,e,t,n)=>i.getFixedT(e,t,n),V9e=(i,e,t,n)=>L.useCallback(wSe(i,e,t,n),[i,e,t,n]),xe=(i,e={})=>{var C,E,D,T;const{i18n:t}=e,{i18n:n,defaultNS:s}=L.useContext(B9e)||{},r=t||n||j9e();if(r&&!r.reportNamespaces&&(r.reportNamespaces=new H9e),!r){hG(r,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const I=(P,j)=>c1(j)?j:D9e(j)&&c1(j.defaultValue)?j.defaultValue:Array.isArray(P)?P[P.length-1]:P,R=[I,{},!1];return R.t=I,R.i18n={},R.ready=!1,R}(C=r.options.react)!=null&&C.wait&&hG(r,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...P9e(),...r.options.react,...e},{useSuspense:a,keyPrefix:l}=o;let c=s||((E=r.options)==null?void 0:E.defaultNS);c=c1(c)?[c]:c||["translation"],(T=(D=r.reportNamespaces).addUsedNamespaces)==null||T.call(D,c);const u=(r.isInitialized||r.initializedStoreOnce)&&c.every(I=>L9e(I,r,o)),h=V9e(r,e.lng||null,o.nsMode==="fallback"?c:c[0],l),g=()=>h,f=()=>wSe(r,e.lng||null,o.nsMode==="fallback"?c:c[0],l),[m,x]=L.useState(g);let v=c.join();e.lng&&(v=`${e.lng}${v}`);const _=W9e(v),w=L.useRef(!0);L.useEffect(()=>{const{bindI18n:I,bindI18nStore:R}=o;w.current=!0,!u&&!a&&(e.lng?Hge(r,e.lng,c,()=>{w.current&&x(f)}):gG(r,c,()=>{w.current&&x(f)})),u&&_&&_!==v&&w.current&&x(f);const P=()=>{w.current&&x(f)};return I&&(r==null||r.on(I,P)),R&&(r==null||r.store.on(R,P)),()=>{w.current=!1,r&&I&&(I==null||I.split(" ").forEach(j=>r.off(j,P))),R&&r&&R.split(" ").forEach(j=>r.store.off(j,P))}},[r,v]),L.useEffect(()=>{w.current&&u&&x(g)},[r,l,u]);const k=[m,r,u];if(k.t=m,k.i18n=r,k.ready=u,u||!u&&!a)return k;throw new Promise(I=>{e.lng?Hge(r,e.lng,c,()=>I()):gG(r,c,()=>I())})};/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const z9e=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),CSe=(...i)=>i.filter((e,t,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===t).join(" ").trim();/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */var U9e={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.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const $9e=L.forwardRef(({color:i="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:n,className:s="",children:r,iconNode:o,...a},l)=>L.createElement("svg",{ref:l,...U9e,width:e,height:e,stroke:i,strokeWidth:n?Number(t)*24/Number(e):t,className:CSe("lucide",s),...a},[...o.map(([c,u])=>L.createElement(c,u)),...Array.isArray(r)?r:[r]]));/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const He=(i,e)=>{const t=L.forwardRef(({className:n,...s},r)=>L.createElement($9e,{ref:r,iconNode:e,className:CSe(`lucide-${z9e(i)}`,n),...s}));return t.displayName=`${i}`,t};/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const q9e=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],AE=He("Activity",q9e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const K9e=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],zf=He("ArrowDown",K9e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const G9e=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],El=He("ArrowLeft",G9e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Y9e=[["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"}]],fN=He("ArrowRightLeft",Y9e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Q9e=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],wg=He("ArrowRight",Q9e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const X9e=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],pN=He("ArrowUpDown",X9e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Z9e=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],zv=He("ArrowUp",Z9e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const J9e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],tU=He("Ban",J9e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const eBe=[["path",{d:"M12 21V7",key:"gj6g52"}],["path",{d:"m16 12 2 2 4-4",key:"mdajum"}],["path",{d:"M22 6V4a1 1 0 0 0-1-1h-5a4 4 0 0 0-4 4 4 4 0 0 0-4-4H3a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h6a3 3 0 0 1 3 3 3 3 0 0 1 3-3h6a1 1 0 0 0 1-1v-1.3",key:"8arnkb"}]],SSe=He("BookOpenCheck",eBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const tBe=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Lw=He("BookOpen",tBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const nBe=[["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"}]],ai=He("Bot",nBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const iBe=[["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"}]],pA=He("Boxes",iBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const sBe=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],rBe=He("Braces",sBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const oBe=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],Nl=He("Brain",oBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const aBe=[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]],vb=He("Cable",aBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const lBe=[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],a7=He("CalendarClock",lBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const cBe=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],l7=He("ChartColumn",cBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const dBe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ns=He("Check",dBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const uBe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Rn=He("ChevronDown",uBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const hBe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],kSe=He("ChevronLeft",hBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const gBe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],hs=He("ChevronRight",gBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const fBe=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Y_=He("ChevronUp",fBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const pBe=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],mBe=He("ChevronsUpDown",pBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const bBe=[["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"}]],Lo=He("CircleAlert",bBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const xBe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],NSe=He("CircleArrowUp",xBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const vBe=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Rie=He("CircleCheckBig",vBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const _Be=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Xl=He("CircleCheck",_Be);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const yBe=[["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"}]],wBe=He("CircleHelp",yBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const CBe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],SBe=He("CircleStop",CBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const kBe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],NBe=He("CircleX",kBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const EBe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],RE=He("Circle",EBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const LBe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Zr=He("Clock",LBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const DBe=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],ESe=He("Cloud",DBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const TBe=[["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"}]],IBe=He("CodeXml",TBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const ABe=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],LSe=He("Code",ABe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const RBe=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],DSe=He("Coins",RBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const MBe=[["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"}]],mo=He("Copy",MBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const PBe=[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]],Mie=He("Cpu",PBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const OBe=[["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"}]],C_=He("Database",OBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const jBe=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],MM=He("DollarSign",jBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const FBe=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Q_=He("Download",FBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const BBe=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],c7=He("EllipsisVertical",BBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const HBe=[["line",{x1:"5",x2:"19",y1:"9",y2:"9",key:"1nwqeh"}],["line",{x1:"5",x2:"19",y1:"15",y2:"15",key:"g8yjpy"}]],WBe=He("Equal",HBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const VBe=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16.2V21h-4.8",key:"1hrera"}],["path",{d:"M21 7.8V3h-4.8",key:"ul1q53"}],["path",{d:"M3 16.2V21h4.8",key:"1x04uo"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 7.8V3h4.8",key:"1ijppm"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],zBe=He("Expand",VBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const UBe=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],To=He("ExternalLink",UBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const $Be=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],_b=He("EyeOff",$Be);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const qBe=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Sh=He("Eye",qBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const KBe=[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]],Pie=He("FileArchive",KBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const GBe=[["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"}]],TSe=He("FileCode2",GBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const YBe=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],bp=He("FileCode",YBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const QBe=[["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:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],Wge=He("FileDown",QBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const XBe=[["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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],ZBe=He("FileJson",XBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const JBe=[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],vj=He("FileOutput",JBe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const e7e=[["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:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],t7e=He("FilePlus",e7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const n7e=[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]],i7e=He("FileSearch",n7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const s7e=[["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"}]],IL=He("FileText",s7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const r7e=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]],o7e=He("Filter",r7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const a7e=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],ME=He("Fingerprint",a7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const l7e=[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]],c7e=He("FolderSearch",l7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const d7e=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Oie=He("Gauge",d7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const u7e=[["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"}]],Vb=He("GitBranch",u7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const h7e=[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]],ISe=He("GitCompareArrows",h7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const g7e=[["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"}]],Su=He("Globe",g7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const f7e=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],p7e=He("GripVertical",f7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const m7e=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],pG=He("Handshake",m7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const b7e=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Zf=He("Hash",b7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const x7e=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],PE=He("History",x7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const v7e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],_d=He("Info",v7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const _7e=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Uv=He("KeyRound",_7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const y7e=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],w7e=He("Keyboard",y7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const C7e=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Uf=He("Layers",C7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const S7e=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],_j=He("LayoutDashboard",S7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const k7e=[["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"}]],N7e=He("LayoutGrid",k7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const E7e=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],L7e=He("Lightbulb",E7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const D7e=[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]],ASe=He("Link2Off",D7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const T7e=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Dw=He("Link2",T7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const I7e=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],A7e=He("Link",I7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const R7e=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]],RSe=He("ListFilter",R7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const M7e=[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"M21 12h-6",key:"bt1uis"}]],P7e=He("ListMinus",M7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const O7e=[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]],j7e=He("ListPlus",O7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const F7e=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],MSe=He("List",F7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const B7e=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ni=He("LoaderCircle",B7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const H7e=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],W7e=He("LockOpen",H7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const V7e=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],d7=He("Lock",V7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const z7e=[["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"}]],PSe=He("LogOut",z7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const U7e=[["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"}]],jie=He("Maximize2",U7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const $7e=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],q7e=He("Menu",$7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const K7e=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],Jf=He("MessageCircle",K7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const G7e=[["path",{d:"M10 7.5 8 10l2 2.5",key:"xb17xw"}],["path",{d:"m14 7.5 2 2.5-2 2.5",key:"5rap1v"}],["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],OSe=He("MessageSquareCode",G7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Y7e=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]],Fie=He("MessageSquarePlus",Y7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Q7e=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M8 12a2 2 0 0 0 2-2V8H8",key:"1jfesj"}],["path",{d:"M14 12a2 2 0 0 0 2-2V8h-2",key:"1dq9mh"}]],jSe=He("MessageSquareQuote",Q7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const X7e=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]],AL=He("MessageSquareText",X7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Z7e=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],Zl=He("MessageSquare",Z7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const J7e=[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]],FSe=He("MessagesSquare",J7e);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const eHe=[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],BSe=He("Minimize2",eHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const tHe=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],nHe=He("Monitor",tHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const iHe=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],HSe=He("Moon",iHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const sHe=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],rHe=He("Package",sHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const oHe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],aHe=He("PanelLeftClose",oHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const lHe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],cHe=He("PanelLeft",lHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const dHe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],WSe=He("PanelRightClose",dHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const uHe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],hHe=He("PanelRightOpen",uHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const gHe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],fHe=He("PanelRight",gHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const pHe=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],mHe=He("Paperclip",pHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const bHe=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],Bie=He("Pause",bHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const xHe=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],vHe=He("PenLine",xHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const _He=[["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"}]],VSe=He("Pencil",_He);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const yHe=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Hie=He("Play",yHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const wHe=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],PM=He("Plug",wHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const CHe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Gt=He("Plus",CHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const SHe=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],OM=He("Puzzle",SHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const kHe=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]],zSe=He("Radio",kHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const NHe=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M7 12h.01",key:"eqddd0"}]],Vge=He("RectangleEllipsis",NHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const EHe=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],LHe=He("Redo2",EHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const DHe=[["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"}]],xi=He("RefreshCw",DHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const THe=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Ih=He("Rocket",THe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const IHe=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],S_=He("RotateCcw",IHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const AHe=[["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"}]],u7=He("Save",AHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const RHe=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]],zge=He("ScanSearch",RHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const MHe=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],USe=He("Scissors",MHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const PHe=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],$v=He("ScrollText",PHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const OHe=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],br=He("Search",OHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const jHe=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],mA=He("Send",jHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const FHe=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],rb=He("Server",FHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const BHe=[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Wie=He("Settings2",BHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const HHe=[["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"}]],xp=He("Settings",HHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const WHe=[["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"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],h7=He("ShieldAlert",WHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const VHe=[["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"}],["path",{d:"m4.243 5.21 14.39 12.472",key:"1c9a7c"}]],Uge=He("ShieldBan",VHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const zHe=[["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"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],bh=He("ShieldCheck",zHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const UHe=[["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"}]],OE=He("Shield",UHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const $He=[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]],$Se=He("SlidersHorizontal",$He);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const qHe=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],Ll=He("Sparkles",qHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const KHe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],qSe=He("Square",KHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const GHe=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],yj=He("Star",GHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const YHe=[["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"}]],QHe=He("Sun",YHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const XHe=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],KSe=He("Tag",XHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const ZHe=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Vie=He("Timer",ZHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const JHe=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]],GSe=He("ToggleLeft",JHe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const eWe=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"16",cy:"12",r:"2",key:"4ma0v8"}]],zie=He("ToggleRight",eWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const tWe=[["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"}]],_n=He("Trash2",tWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const nWe=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],YSe=He("TrendingUp",nWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const iWe=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Vi=He("TriangleAlert",iWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const sWe=[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],$ge=He("Type",sWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const rWe=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Uie=He("Undo2",rWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const oWe=[["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"}]],qv=He("Upload",oWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const aWe=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],lWe=He("UserPlus",aWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const cWe=[["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"}]],$ie=He("User",cWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const dWe=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],ga=He("Users",dWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const uWe=[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]],mG=He("Variable",uWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const hWe=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],RL=He("WandSparkles",hWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const gWe=[["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"}]],Ed=He("Workflow",gWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const fWe=[["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"}]],zb=He("Wrench",fWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const pWe=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],An=He("X",pWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const mWe=[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],bWe=He("ZapOff",mWe);/**
- * @license lucide-react v0.474.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const xWe=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],nc=He("Zap",xWe);function QSe(i){var e,t,n="";if(typeof i=="string"||typeof i=="number")n+=i;else if(typeof i=="object")if(Array.isArray(i)){var s=i.length;for(e=0;e{const t=new Array(i.length+e.length);for(let n=0;n({classGroupId:i,validator:e}),ZSe=(i=new Map,e=null,t)=>({nextPart:i,validators:e,classGroupId:t}),wj="-",qge=[],yWe="arbitrary..",wWe=i=>{const e=SWe(i),{conflictingClassGroups:t,conflictingClassGroupModifiers:n}=i;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return CWe(o);const a=o.split(wj),l=a[0]===""&&a.length>1?1:0;return JSe(a,l,e)},getConflictingClassGroupIds:(o,a)=>{if(a){const l=n[o],c=t[o];return l?c?vWe(c,l):l:c||qge}return t[o]||qge}}},JSe=(i,e,t)=>{if(i.length-e===0)return t.classGroupId;const s=i[e],r=t.nextPart.get(s);if(r){const c=JSe(i,e+1,r);if(c)return c}const o=t.validators;if(o===null)return;const a=e===0?i.join(wj):i.slice(e).join(wj),l=o.length;for(let c=0;ci.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=i.slice(1,-1),t=e.indexOf(":"),n=e.slice(0,t);return n?yWe+n:void 0})(),SWe=i=>{const{theme:e,classGroups:t}=i;return kWe(t,e)},kWe=(i,e)=>{const t=ZSe();for(const n in i){const s=i[n];qie(s,t,n,e)}return t},qie=(i,e,t,n)=>{const s=i.length;for(let r=0;r{if(typeof i=="string"){EWe(i,e,t);return}if(typeof i=="function"){LWe(i,e,t,n);return}DWe(i,e,t,n)},EWe=(i,e,t)=>{const n=i===""?e:eke(e,i);n.classGroupId=t},LWe=(i,e,t,n)=>{if(TWe(i)){qie(i(n),e,t,n);return}e.validators===null&&(e.validators=[]),e.validators.push(_We(t,i))},DWe=(i,e,t,n)=>{const s=Object.entries(i),r=s.length;for(let o=0;o{let t=i;const n=e.split(wj),s=n.length;for(let r=0;r"isThemeGetter"in i&&i.isThemeGetter===!0,IWe=i=>{if(i<1)return{get:()=>{},set:()=>{}};let e=0,t=Object.create(null),n=Object.create(null);const s=(r,o)=>{t[r]=o,e++,e>i&&(e=0,n=t,t=Object.create(null))};return{get(r){let o=t[r];if(o!==void 0)return o;if((o=n[r])!==void 0)return s(r,o),o},set(r,o){r in t?t[r]=o:s(r,o)}}},bG="!",Kge=":",AWe=[],Gge=(i,e,t,n,s)=>({modifiers:i,hasImportantModifier:e,baseClassName:t,maybePostfixModifierPosition:n,isExternal:s}),RWe=i=>{const{prefix:e,experimentalParseClassName:t}=i;let n=s=>{const r=[];let o=0,a=0,l=0,c;const u=s.length;for(let x=0;xl?c-l:void 0;return Gge(r,f,g,m)};if(e){const s=e+Kge,r=n;n=o=>o.startsWith(s)?r(o.slice(s.length)):Gge(AWe,!1,o,void 0,!0)}if(t){const s=n;n=r=>t({className:r,parseClassName:s})}return n},MWe=i=>{const e=new Map;return i.orderSensitiveModifiers.forEach((t,n)=>{e.set(t,1e6+n)}),t=>{const n=[];let s=[];for(let r=0;r0&&(s.sort(),n.push(...s),s=[]),n.push(o)):s.push(o)}return s.length>0&&(s.sort(),n.push(...s)),n}},PWe=i=>({cache:IWe(i.cacheSize),parseClassName:RWe(i),sortModifiers:MWe(i),...wWe(i)}),OWe=/\s+/,jWe=(i,e)=>{const{parseClassName:t,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:r}=e,o=[],a=i.trim().split(OWe);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:h,modifiers:g,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:x}=t(u);if(h){l=u+(l.length>0?" "+l:l);continue}let v=!!x,_=n(v?m.substring(0,x):m);if(!_){if(!v){l=u+(l.length>0?" "+l:l);continue}if(_=n(m),!_){l=u+(l.length>0?" "+l:l);continue}v=!1}const w=g.length===0?"":g.length===1?g[0]:r(g).join(":"),k=f?w+bG:w,C=k+_;if(o.indexOf(C)>-1)continue;o.push(C);const E=s(_,v);for(let D=0;D0?" "+l:l)}return l},FWe=(...i)=>{let e=0,t,n,s="";for(;e{if(typeof i=="string")return i;let e,t="";for(let n=0;n{let t,n,s,r;const o=l=>{const c=e.reduce((u,h)=>h(u),i());return t=PWe(c),n=t.cache.get,s=t.cache.set,r=a,a(l)},a=l=>{const c=n(l);if(c)return c;const u=jWe(l,t);return s(l,u),u};return r=o,(...l)=>r(FWe(...l))},HWe=[],_a=i=>{const e=t=>t[i]||HWe;return e.isThemeGetter=!0,e},nke=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ike=/^\((?:(\w[\w-]*):)?(.+)\)$/i,WWe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,VWe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zWe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,UWe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$We=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qWe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kx=i=>WWe.test(i),ki=i=>!!i&&!Number.isNaN(Number(i)),Nx=i=>!!i&&Number.isInteger(Number(i)),nU=i=>i.endsWith("%")&&ki(i.slice(0,-1)),Gp=i=>VWe.test(i),ske=()=>!0,KWe=i=>zWe.test(i)&&!UWe.test(i),Kie=()=>!1,GWe=i=>$We.test(i),YWe=i=>qWe.test(i),QWe=i=>!an(i)&&!dn(i),XWe=i=>X_(i,ake,Kie),an=i=>nke.test(i),D0=i=>X_(i,lke,KWe),Yge=i=>X_(i,rVe,ki),ZWe=i=>X_(i,dke,ske),JWe=i=>X_(i,cke,Kie),Qge=i=>X_(i,rke,Kie),eVe=i=>X_(i,oke,YWe),h5=i=>X_(i,uke,GWe),dn=i=>ike.test(i),pT=i=>xC(i,lke),tVe=i=>xC(i,cke),Xge=i=>xC(i,rke),nVe=i=>xC(i,ake),iVe=i=>xC(i,oke),g5=i=>xC(i,uke,!0),sVe=i=>xC(i,dke,!0),X_=(i,e,t)=>{const n=nke.exec(i);return n?n[1]?e(n[1]):t(n[2]):!1},xC=(i,e,t=!1)=>{const n=ike.exec(i);return n?n[1]?e(n[1]):t:!1},rke=i=>i==="position"||i==="percentage",oke=i=>i==="image"||i==="url",ake=i=>i==="length"||i==="size"||i==="bg-size",lke=i=>i==="length",rVe=i=>i==="number",cke=i=>i==="family-name",dke=i=>i==="number"||i==="weight",uke=i=>i==="shadow",oVe=()=>{const i=_a("color"),e=_a("font"),t=_a("text"),n=_a("font-weight"),s=_a("tracking"),r=_a("leading"),o=_a("breakpoint"),a=_a("container"),l=_a("spacing"),c=_a("radius"),u=_a("shadow"),h=_a("inset-shadow"),g=_a("text-shadow"),f=_a("drop-shadow"),m=_a("blur"),x=_a("perspective"),v=_a("aspect"),_=_a("ease"),w=_a("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),dn,an],D=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],I=()=>[dn,an,l],R=()=>[kx,"full","auto",...I()],P=()=>[Nx,"none","subgrid",dn,an],j=()=>["auto",{span:["full",Nx,dn,an]},Nx,dn,an],B=()=>[Nx,"auto",dn,an],U=()=>["auto","min","max","fr",dn,an],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...I()],G=()=>[kx,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],ne=()=>[kx,"screen","full","dvw","lvw","svw","min","max","fit",...I()],te=()=>[kx,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],H=()=>[i,dn,an],Q=()=>[...C(),Xge,Qge,{position:[dn,an]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",nVe,XWe,{size:[dn,an]}],ue=()=>[nU,pT,D0],he=()=>["","none","full",c,dn,an],Te=()=>["",ki,pT,D0],nt=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_e=()=>[ki,nU,Xge,Qge],$e=()=>["","none",m,dn,an],Ke=()=>["none",ki,dn,an],ht=()=>["none",ki,dn,an],Ct=()=>[ki,dn,an],Ft=()=>[kx,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gp],breakpoint:[Gp],color:[ske],container:[Gp],"drop-shadow":[Gp],ease:["in","out","in-out"],font:[QWe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Gp],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Gp],shadow:[Gp],spacing:["px",ki],text:[Gp],"text-shadow":[Gp],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",kx,an,dn,v]}],container:["container"],columns:[{columns:[ki,an,dn,a]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{"inset-s":R(),start:R()}],end:[{"inset-e":R(),end:R()}],"inset-bs":[{"inset-bs":R()}],"inset-be":[{"inset-be":R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[Nx,"auto",dn,an]}],basis:[{basis:[kx,"full","auto",a,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ki,kx,"auto","initial","none",an]}],grow:[{grow:["",ki,dn,an]}],shrink:[{shrink:["",ki,dn,an]}],order:[{order:[Nx,"first","last","none",dn,an]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...ne()]}],"min-inline-size":[{"min-inline":["auto",...ne()]}],"max-inline-size":[{"max-inline":["none",...ne()]}],"block-size":[{block:["auto",...te()]}],"min-block-size":[{"min-block":["auto",...te()]}],"max-block-size":[{"max-block":["none",...te()]}],w:[{w:[a,"screen",...G()]}],"min-w":[{"min-w":[a,"screen","none",...G()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",t,pT,D0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,sVe,ZWe]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nU,an]}],"font-family":[{font:[tVe,JWe,e]}],"font-features":[{"font-features":[an]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,dn,an]}],"line-clamp":[{"line-clamp":[ki,"none",dn,Yge]}],leading:[{leading:[r,...I()]}],"list-image":[{"list-image":["none",dn,an]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",dn,an]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...nt(),"wavy"]}],"text-decoration-thickness":[{decoration:[ki,"from-font","auto",dn,D0]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[ki,"auto",dn,an]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",dn,an]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",dn,an]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Q()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Nx,dn,an],radial:["",dn,an],conic:[Nx,dn,an]},iVe,eVe]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:he()}],"rounded-s":[{"rounded-s":he()}],"rounded-e":[{"rounded-e":he()}],"rounded-t":[{"rounded-t":he()}],"rounded-r":[{"rounded-r":he()}],"rounded-b":[{"rounded-b":he()}],"rounded-l":[{"rounded-l":he()}],"rounded-ss":[{"rounded-ss":he()}],"rounded-se":[{"rounded-se":he()}],"rounded-ee":[{"rounded-ee":he()}],"rounded-es":[{"rounded-es":he()}],"rounded-tl":[{"rounded-tl":he()}],"rounded-tr":[{"rounded-tr":he()}],"rounded-br":[{"rounded-br":he()}],"rounded-bl":[{"rounded-bl":he()}],"border-w":[{border:Te()}],"border-w-x":[{"border-x":Te()}],"border-w-y":[{"border-y":Te()}],"border-w-s":[{"border-s":Te()}],"border-w-e":[{"border-e":Te()}],"border-w-bs":[{"border-bs":Te()}],"border-w-be":[{"border-be":Te()}],"border-w-t":[{"border-t":Te()}],"border-w-r":[{"border-r":Te()}],"border-w-b":[{"border-b":Te()}],"border-w-l":[{"border-l":Te()}],"divide-x":[{"divide-x":Te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...nt(),"hidden","none"]}],"divide-style":[{divide:[...nt(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...nt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ki,dn,an]}],"outline-w":[{outline:["",ki,pT,D0]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",u,g5,h5]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",h,g5,h5]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[ki,D0]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Te()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",g,g5,h5]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[ki,dn,an]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ki]}],"mask-image-linear-from-pos":[{"mask-linear-from":_e()}],"mask-image-linear-to-pos":[{"mask-linear-to":_e()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":_e()}],"mask-image-t-to-pos":[{"mask-t-to":_e()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":_e()}],"mask-image-r-to-pos":[{"mask-r-to":_e()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":_e()}],"mask-image-b-to-pos":[{"mask-b-to":_e()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":_e()}],"mask-image-l-to-pos":[{"mask-l-to":_e()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":_e()}],"mask-image-x-to-pos":[{"mask-x-to":_e()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":_e()}],"mask-image-y-to-pos":[{"mask-y-to":_e()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[dn,an]}],"mask-image-radial-from-pos":[{"mask-radial-from":_e()}],"mask-image-radial-to-pos":[{"mask-radial-to":_e()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[ki]}],"mask-image-conic-from-pos":[{"mask-conic-from":_e()}],"mask-image-conic-to-pos":[{"mask-conic-to":_e()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Q()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",dn,an]}],filter:[{filter:["","none",dn,an]}],blur:[{blur:$e()}],brightness:[{brightness:[ki,dn,an]}],contrast:[{contrast:[ki,dn,an]}],"drop-shadow":[{"drop-shadow":["","none",f,g5,h5]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",ki,dn,an]}],"hue-rotate":[{"hue-rotate":[ki,dn,an]}],invert:[{invert:["",ki,dn,an]}],saturate:[{saturate:[ki,dn,an]}],sepia:[{sepia:["",ki,dn,an]}],"backdrop-filter":[{"backdrop-filter":["","none",dn,an]}],"backdrop-blur":[{"backdrop-blur":$e()}],"backdrop-brightness":[{"backdrop-brightness":[ki,dn,an]}],"backdrop-contrast":[{"backdrop-contrast":[ki,dn,an]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ki,dn,an]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ki,dn,an]}],"backdrop-invert":[{"backdrop-invert":["",ki,dn,an]}],"backdrop-opacity":[{"backdrop-opacity":[ki,dn,an]}],"backdrop-saturate":[{"backdrop-saturate":[ki,dn,an]}],"backdrop-sepia":[{"backdrop-sepia":["",ki,dn,an]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",dn,an]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ki,"initial",dn,an]}],ease:[{ease:["linear","initial",_,dn,an]}],delay:[{delay:[ki,dn,an]}],animate:[{animate:["none",w,dn,an]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,dn,an]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Ke()}],"rotate-x":[{"rotate-x":Ke()}],"rotate-y":[{"rotate-y":Ke()}],"rotate-z":[{"rotate-z":Ke()}],scale:[{scale:ht()}],"scale-x":[{"scale-x":ht()}],"scale-y":[{"scale-y":ht()}],"scale-z":[{"scale-z":ht()}],"scale-3d":["scale-3d"],skew:[{skew:Ct()}],"skew-x":[{"skew-x":Ct()}],"skew-y":[{"skew-y":Ct()}],transform:[{transform:[dn,an,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ft()}],"translate-x":[{"translate-x":Ft()}],"translate-y":[{"translate-y":Ft()}],"translate-z":[{"translate-z":Ft()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",dn,an]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",dn,an]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[ki,pT,D0,Yge]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},aVe=BWe(oVe);function be(...i){return aVe(XSe(i))}function Tw(i){const t=Date.now()-i,n=Math.floor(t/1e3),s=Math.floor(n/60),r=Math.floor(s/60),o=Math.floor(r/24);return o>0?`${o}d ago`:r>0?`${r}h ago`:s>0?`${s}m ago`:"just now"}const Zge=["bg-blue-500","bg-emerald-500","bg-amber-500","bg-purple-500","bg-rose-500","bg-cyan-500","bg-indigo-500","bg-orange-500","bg-teal-500","bg-pink-500","bg-lime-500","bg-violet-500"];function g7(i){let e=0;for(let t=0;te[0]).filter(Boolean).slice(0,2).join("").toUpperCase()}function lVe(i){try{const e=new URL(i);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}function jE(i){return!Number.isFinite(i)||i<1?"<1ms":i<1e3?`${Math.round(i)}ms`:`${(i/1e3).toFixed(2)}s`}function hke(){return L.useContext(Aie)}const Jge=i=>{let e;const t=new Set,n=(c,u)=>{const h=typeof c=="function"?c(e):c;if(!Object.is(h,e)){const g=e;e=u??(typeof h!="object"||h===null)?h:Object.assign({},e,h),t.forEach(f=>f(e,g))}},s=()=>e,a={setState:n,getState:s,getInitialState:()=>l,subscribe:c=>(t.add(c),()=>t.delete(c))},l=e=i(n,s,a);return a},cVe=(i=>i?Jge(i):Jge),dVe=i=>i;function uVe(i,e=dVe){const t=ft.useSyncExternalStore(i.subscribe,ft.useCallback(()=>e(i.getState()),[i,e]),ft.useCallback(()=>e(i.getInitialState()),[i,e]));return ft.useDebugValue(t),t}const efe=i=>{const e=cVe(i),t=n=>uVe(e,n);return Object.assign(t,e),t},ML=(i=>i?efe(i):efe),xG=["dashboard","agents","workflows","chat","resources","conversations","groups","logs","secrets","audit","schedules","quotas","coordinator","orphans"],Gie="eddi-onboarding-welcomed",Yie="eddi-tour-offers-dismissed",Qie=i=>`eddi-tour-${i}`;function hVe(i){try{return localStorage.getItem(Qie(i))==="done"}catch{return!1}}function iU(i){try{localStorage.setItem(Qie(i),"done")}catch{}}function tfe(i){try{localStorage.removeItem(Qie(i))}catch{}}function gVe(){try{return localStorage.getItem(Gie)==="true"}catch{return!1}}function fVe(){try{localStorage.setItem(Gie,"true")}catch{}}function pVe(){try{localStorage.removeItem(Gie)}catch{}}function mVe(){try{return localStorage.getItem(Yie)==="true"}catch{return!1}}function bVe(){try{localStorage.setItem(Yie,"true")}catch{}}function xVe(){try{localStorage.removeItem(Yie)}catch{}}const $s=ML((i,e)=>{const t=new Set;for(const n of xG)hVe(n)&&t.add(n);return{showWelcome:!gVe(),activeChapter:null,currentStep:0,offeredChapter:null,completedChapters:t,openWelcome:()=>i({showWelcome:!0}),dismissWelcome:()=>{fVe(),i({showWelcome:!1})},startChapter:n=>{i({activeChapter:n,currentStep:0,offeredChapter:null})},nextStep:()=>{const{currentStep:n,activeChapter:s}=e();s&&i({currentStep:n+1})},prevStep:()=>{i(n=>({currentStep:Math.max(0,n.currentStep-1)}))},skipChapter:()=>{const{activeChapter:n,completedChapters:s}=e();if(n){iU(n);const r=new Set(s);r.add(n),i({activeChapter:null,currentStep:0,completedChapters:r})}},completeChapter:()=>{const{activeChapter:n,completedChapters:s}=e();if(n){iU(n);const r=new Set(s);r.add(n),i({activeChapter:null,currentStep:0,completedChapters:r})}},restartChapter:n=>{tfe(n);const s=new Set(e().completedChapters);s.delete(n),i({activeChapter:n,currentStep:0,offeredChapter:null,completedChapters:s})},acceptOffer:()=>{const{offeredChapter:n}=e();n&&i({activeChapter:n,currentStep:0,offeredChapter:null})},dismissOffer:()=>{const{offeredChapter:n,completedChapters:s}=e();if(n){iU(n);const r=new Set(s);r.add(n),i({offeredChapter:null,completedChapters:r})}},dismissAllOffers:()=>{bVe(),i({offeredChapter:null})},isChapterCompleted:n=>e().completedChapters.has(n),maybeAutoStart:n=>{const{activeChapter:s,completedChapters:r,showWelcome:o,offeredChapter:a}=e();if(!(o||s||r.has(n)||a)){if(n==="dashboard"){i({activeChapter:n,currentStep:0});return}mVe()||i({offeredChapter:n})}},resetAll:()=>{pVe(),xVe();for(const n of xG)tfe(n);i({showWelcome:!0,activeChapter:null,currentStep:0,offeredChapter:null,completedChapters:new Set})}}}),vVe={id:"dashboard",titleKey:"onboarding.tour.dashboard.title",icon:"LayoutDashboard",route:"/manage",steps:[{target:'[data-testid="sidebar"] nav',titleKey:"onboarding.tour.dashboard.step1Title",descriptionKey:"onboarding.tour.dashboard.step1Desc",placement:"right",padding:4},{target:'[data-tour="dashboard-stats"]',titleKey:"onboarding.tour.dashboard.step2Title",descriptionKey:"onboarding.tour.dashboard.step2Desc",placement:"bottom"},{target:'[data-tour="dashboard-actions"]',titleKey:"onboarding.tour.dashboard.step3Title",descriptionKey:"onboarding.tour.dashboard.step3Desc",placement:"bottom"},{target:'[data-tour="topbar-personalize"]',titleKey:"onboarding.tour.dashboard.step4Title",descriptionKey:"onboarding.tour.dashboard.step4Desc",placement:"bottom"}]},_Ve={id:"agents",titleKey:"onboarding.tour.agents.title",icon:"Bot",route:"/manage/agents",steps:[{target:'[data-testid="create-agent-btn"]',titleKey:"onboarding.tour.agents.step1Title",descriptionKey:"onboarding.tour.agents.step1Desc",placement:"bottom"},{target:'[data-testid="import-agent-btn"]',titleKey:"onboarding.tour.agents.step2Title",descriptionKey:"onboarding.tour.agents.step2Desc",placement:"bottom"},{target:'[data-tour="agents-search"]',titleKey:"onboarding.tour.agents.step3Title",descriptionKey:"onboarding.tour.agents.step3Desc",placement:"bottom"},{target:'[data-tour="agents-content"]',titleKey:"onboarding.tour.agents.step4Title",descriptionKey:"onboarding.tour.agents.step4Desc",placement:"top",padding:8}]},yVe={id:"workflows",titleKey:"onboarding.tour.workflows.title",icon:"Workflow",route:"/manage/workflows",steps:[{target:'[data-testid="create-workflow-btn"]',titleKey:"onboarding.tour.workflows.step1Title",descriptionKey:"onboarding.tour.workflows.step1Desc",placement:"bottom"},{target:'[data-tour="workflows-content"]',titleKey:"onboarding.tour.workflows.step2Title",descriptionKey:"onboarding.tour.workflows.step2Desc",placement:"top",padding:8},{target:'[data-tour="workflows-search"]',titleKey:"onboarding.tour.workflows.step3Title",descriptionKey:"onboarding.tour.workflows.step3Desc",placement:"bottom"}]},wVe={id:"chat",titleKey:"onboarding.tour.chat.title",icon:"MessageCircle",route:"/manage/chat",steps:[{target:'[data-testid="agent-selector"]',titleKey:"onboarding.tour.chat.step1Title",descriptionKey:"onboarding.tour.chat.step1Desc",placement:"bottom"},{target:'[data-testid="streaming-toggle"]',titleKey:"onboarding.tour.chat.step2Title",descriptionKey:"onboarding.tour.chat.step2Desc",placement:"bottom"},{target:'[data-testid="history-toggle"]',titleKey:"onboarding.tour.chat.step3Title",descriptionKey:"onboarding.tour.chat.step3Desc",placement:"bottom"},{target:'[data-tour="chat-input-area"]',titleKey:"onboarding.tour.chat.step4Title",descriptionKey:"onboarding.tour.chat.step4Desc",placement:"top"}]},CVe={id:"resources",titleKey:"onboarding.tour.resources.title",icon:"FileCode",route:"/manage/resources",steps:[{target:'[data-testid="resource-types-grid"]',titleKey:"onboarding.tour.resources.step1Title",descriptionKey:"onboarding.tour.resources.step1Desc",placement:"bottom",padding:8},{target:'[data-testid="resource-type-llm"]',titleKey:"onboarding.tour.resources.step2Title",descriptionKey:"onboarding.tour.resources.step2Desc",placement:"bottom"},{target:'[data-testid="resource-type-rules"]',titleKey:"onboarding.tour.resources.step3Title",descriptionKey:"onboarding.tour.resources.step3Desc",placement:"right"}]},SVe={id:"conversations",titleKey:"onboarding.tour.conversations.title",icon:"MessagesSquare",route:"/manage/conversations",steps:[{target:'[data-testid="conversation-search"]',titleKey:"onboarding.tour.conversations.step1Title",descriptionKey:"onboarding.tour.conversations.step1Desc",placement:"bottom"},{target:'[data-tour="conversations-filters"]',titleKey:"onboarding.tour.conversations.step2Title",descriptionKey:"onboarding.tour.conversations.step2Desc",placement:"bottom"},{target:'[data-tour="conversations-content"]',titleKey:"onboarding.tour.conversations.step3Title",descriptionKey:"onboarding.tour.conversations.step3Desc",placement:"top",padding:8}]},kVe={id:"groups",titleKey:"onboarding.tour.groups.title",icon:"Boxes",route:"/manage/groups",steps:[{target:'[data-testid="create-group-btn"]',titleKey:"onboarding.tour.groups.step1Title",descriptionKey:"onboarding.tour.groups.step1Desc",placement:"bottom"},{target:'[data-testid="group-search"]',titleKey:"onboarding.tour.groups.step2Title",descriptionKey:"onboarding.tour.groups.step2Desc",placement:"bottom"},{target:'[data-tour="groups-content"]',titleKey:"onboarding.tour.groups.step3Title",descriptionKey:"onboarding.tour.groups.step3Desc",placement:"top",padding:8}]},NVe={id:"logs",titleKey:"onboarding.tour.logs.title",icon:"ScrollText",route:"/manage/logs",steps:[{target:'[data-tour="logs-tabs"]',titleKey:"onboarding.tour.logs.step1Title",descriptionKey:"onboarding.tour.logs.step1Desc",placement:"bottom"},{target:'[data-tour="logs-filters"]',titleKey:"onboarding.tour.logs.step2Title",descriptionKey:"onboarding.tour.logs.step2Desc",placement:"bottom"},{target:'[data-testid="export-logs-btn"]',titleKey:"onboarding.tour.logs.step3Title",descriptionKey:"onboarding.tour.logs.step3Desc",placement:"bottom"}]},EVe={id:"secrets",titleKey:"onboarding.tour.secrets.title",icon:"KeyRound",route:"/manage/secrets",steps:[{target:'[data-testid="create-secret-button"]',titleKey:"onboarding.tour.secrets.step1Title",descriptionKey:"onboarding.tour.secrets.step1Desc",placement:"bottom"},{target:'[data-testid="tenant-input"]',titleKey:"onboarding.tour.secrets.step2Title",descriptionKey:"onboarding.tour.secrets.step2Desc",placement:"bottom"},{target:'[data-tour="secrets-info"]',titleKey:"onboarding.tour.secrets.step3Title",descriptionKey:"onboarding.tour.secrets.step3Desc",placement:"bottom",padding:4}]},LVe={id:"audit",titleKey:"onboarding.tour.audit.title",icon:"ShieldCheck",route:"/manage/audit",steps:[{target:'[data-tour="audit-mode-toggle"]',titleKey:"onboarding.tour.audit.step1Title",descriptionKey:"onboarding.tour.audit.step1Desc",placement:"bottom"},{target:'[data-testid="search-button"]',titleKey:"onboarding.tour.audit.step2Title",descriptionKey:"onboarding.tour.audit.step2Desc",placement:"bottom"},{target:'[data-testid="export-btn"]',titleKey:"onboarding.tour.audit.step3Title",descriptionKey:"onboarding.tour.audit.step3Desc",placement:"bottom"}]},DVe={id:"schedules",titleKey:"onboarding.tour.schedules.title",icon:"CalendarClock",route:"/manage/schedules",steps:[{target:'[data-testid="create-schedule-btn"]',titleKey:"onboarding.tour.schedules.step1Title",descriptionKey:"onboarding.tour.schedules.step1Desc",placement:"bottom"},{target:'[data-tour="schedules-stats"]',titleKey:"onboarding.tour.schedules.step2Title",descriptionKey:"onboarding.tour.schedules.step2Desc",placement:"bottom",padding:8},{target:'[data-testid="schedules-table-container"]',titleKey:"onboarding.tour.schedules.step3Title",descriptionKey:"onboarding.tour.schedules.step3Desc",placement:"top",padding:8}]},TVe={id:"quotas",titleKey:"onboarding.tour.quotas.title",icon:"SlidersHorizontal",route:"/manage/quotas",steps:[{target:'[data-tour="quotas-config"]',titleKey:"onboarding.tour.quotas.step1Title",descriptionKey:"onboarding.tour.quotas.step1Desc",placement:"right",padding:8},{target:'[data-tour="quotas-usage"]',titleKey:"onboarding.tour.quotas.step2Title",descriptionKey:"onboarding.tour.quotas.step2Desc",placement:"left",padding:8},{target:'[data-testid="quotas-save"]',titleKey:"onboarding.tour.quotas.step3Title",descriptionKey:"onboarding.tour.quotas.step3Desc",placement:"bottom"}]},IVe={id:"coordinator",titleKey:"onboarding.tour.coordinator.title",icon:"Activity",route:"/manage/coordinator",steps:[{target:'[data-testid="coordinator-connection-card"]',titleKey:"onboarding.tour.coordinator.step1Title",descriptionKey:"onboarding.tour.coordinator.step1Desc",placement:"bottom",padding:8},{target:'[data-testid="coordinator-queues"]',titleKey:"onboarding.tour.coordinator.step2Title",descriptionKey:"onboarding.tour.coordinator.step2Desc",placement:"top",padding:8},{target:'[data-testid="coordinator-dead-letters"]',titleKey:"onboarding.tour.coordinator.step3Title",descriptionKey:"onboarding.tour.coordinator.step3Desc",placement:"top",padding:8}]},AVe={id:"orphans",titleKey:"onboarding.tour.orphans.title",icon:"Link2Off",route:"/manage/orphans",steps:[{target:'[data-testid="scan-button"]',titleKey:"onboarding.tour.orphans.step1Title",descriptionKey:"onboarding.tour.orphans.step1Desc",placement:"bottom"},{target:'[data-testid="include-deleted-checkbox"]',titleKey:"onboarding.tour.orphans.step2Title",descriptionKey:"onboarding.tour.orphans.step2Desc",placement:"bottom"},{target:'[data-testid="pre-scan-state"]',titleKey:"onboarding.tour.orphans.step3Title",descriptionKey:"onboarding.tour.orphans.step3Desc",placement:"top",padding:8}]},Xie={dashboard:vVe,agents:_Ve,workflows:yVe,chat:wVe,resources:CVe,conversations:SVe,groups:kVe,logs:NVe,secrets:EVe,audit:LVe,schedules:DVe,quotas:TVe,coordinator:IVe,orphans:AVe};async function RVe(){var i;try{const e=await Oe.get("/openapi?format=json");return((i=e==null?void 0:e.info)==null?void 0:i.version)||"Unknown"}catch(e){return console.error("Failed to fetch EDDI version",e),"Unknown"}}const MVe=[{labelKey:"nav.sectionCore",items:[{path:"/manage",icon:_j,labelKey:"nav.dashboard"},{path:"/manage/agents",icon:ai,labelKey:"nav.agents"},{path:"/manage/workflows",icon:Ed,labelKey:"nav.packages"},{path:"/manage/groups",icon:pA,labelKey:"nav.groups"},{path:"/manage/channels",icon:vb,labelKey:"nav.channels"},{path:"/manage/capabilities",icon:Uf,labelKey:"nav.capabilities"}]},{labelKey:"nav.sectionBuild",items:[{path:"/manage/resources",icon:bp,labelKey:"nav.resources"},{path:"/manage/chat",icon:Jf,labelKey:"nav.chat"},{path:"/manage/triggers",icon:nc,labelKey:"nav.triggers"}]},{labelKey:"nav.sectionMonitor",items:[{path:"/manage/logs",icon:$v,labelKey:"nav.logs"},{path:"/manage/conversations",icon:FSe,labelKey:"nav.conversations"},{path:"/manage/coordinator",icon:AE,labelKey:"nav.coordinator"},{path:"/manage/audit",icon:bh,labelKey:"nav.audit"}]},{labelKey:"nav.sectionAdmin",items:[{path:"/manage/secrets",icon:Uv,labelKey:"nav.secrets"},{path:"/manage/variables",icon:mG,labelKey:"nav.variables"},{path:"/manage/quotas",icon:$Se,labelKey:"nav.quotas"},{path:"/manage/schedules",icon:a7,labelKey:"nav.schedules"},{path:"/manage/userdata",icon:ga,labelKey:"nav.userData"},{path:"/manage/orphans",icon:ASe,labelKey:"nav.orphans"},{path:"/manage/sync",icon:xi,labelKey:"nav.sync"},{path:"/manage/gdpr",icon:h7,labelKey:"nav.gdpr"}]}],PVe=[{href:"/q/swagger-ui",icon:ZBe,labelKey:"nav.openapi",fallback:"OpenAPI"},{href:"https://docs.labs.ai",icon:Lw,labelKey:"nav.docs",fallback:"Documentation"}];function nfe({collapsed:i,onToggle:e}){var m;const{t}=xe(),{method:n,user:s,logout:r}=hke(),o=n==="keycloak"&&s,{data:a,isLoading:l}=hn({queryKey:["eddi-version"],queryFn:RVe,staleTime:1/0,retry:1}),c=o?[s.firstName,s.lastName].filter(Boolean).map(x=>x[0]).join("").toUpperCase()||((m=s.username[0])==null?void 0:m.toUpperCase())||"?":"",u="eddi-sidebar-sections",[h,g]=L.useState(()=>{try{const x=localStorage.getItem(u);return x?new Set(JSON.parse(x)):new Set}catch{return new Set}}),f=L.useCallback(x=>{g(v=>{const _=new Set(v);_.has(x)?_.delete(x):_.add(x);try{localStorage.setItem(u,JSON.stringify([..._]))}catch{}return _})},[]);return d.jsxs("aside",{"data-testid":"sidebar",className:be("flex h-full flex-col border-e border-sidebar-border bg-sidebar transition-all duration-300",i?"w-16":"w-64"),children:[d.jsx("div",{className:"flex h-16 items-center justify-center border-b border-sidebar-border px-4",children:i?d.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"shrink-0","aria-label":"EDDI",children:[d.jsx("rect",{width:"28",height:"28",rx:"6",className:"fill-sidebar-accent"}),d.jsx("text",{x:"5",y:"20",fontFamily:"'Noto Sans', sans-serif",fontWeight:"700",fontSize:"16",className:"fill-sidebar",children:"E."})]}):d.jsx("img",{src:"/logo_eddi.png",alt:"EDDI",className:"h-7 w-auto"})}),d.jsx("nav",{className:"flex-1 overflow-y-auto p-1.5","aria-label":t("nav.mainNavigation","Main navigation"),children:MVe.map((x,v)=>d.jsxs("div",{className:be(v>0&&"mt-2.5"),children:[!i&&d.jsxs("button",{type:"button",onClick:()=>f(v),className:"mb-1 flex w-full items-center gap-1 px-3 text-[11px] font-semibold uppercase tracking-wider text-sidebar-foreground/50 hover:text-sidebar-foreground/80 transition-colors","aria-expanded":!h.has(v),"aria-controls":`sidebar-section-${v}`,children:[d.jsx(hs,{className:be("h-3 w-3 shrink-0 transition-transform duration-200",!h.has(v)&&"rotate-90"),"aria-hidden":"true"}),t(x.labelKey)]}),i&&v>0&&d.jsx("div",{className:"mx-3 mb-2 border-t border-sidebar-border"}),(i?!0:!h.has(v))&&d.jsx("div",{id:`sidebar-section-${v}`,className:"space-y-0.5",children:x.items.map(_=>d.jsxs(U6e,{to:_.path,end:_.path==="/manage",className:({isActive:w})=>be("flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-all","hover:bg-sidebar-accent/10 hover:text-sidebar-accent",w?"border-s-2 border-sidebar-accent bg-sidebar-accent/10 text-sidebar-accent":"border-s-2 border-transparent text-sidebar-foreground",i&&"justify-center px-2"),"aria-label":i?t(_.labelKey):void 0,title:i?t(_.labelKey):void 0,children:[d.jsx(_.icon,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),!i&&d.jsx("span",{children:t(_.labelKey)})]},_.path))})]},x.labelKey))}),d.jsxs("div",{className:"border-t border-sidebar-border p-1.5",children:[!i&&d.jsx("p",{className:"mb-1 px-3 text-[11px] font-semibold uppercase tracking-wider text-sidebar-foreground/50",children:t("nav.sectionExternal","External")}),d.jsx("div",{className:"space-y-0.5",children:PVe.map(x=>d.jsxs("a",{href:x.href,target:"_blank",rel:"noopener noreferrer",className:be("flex items-center gap-3 rounded-lg px-3 py-1.5 text-sm font-medium transition-all","border-s-2 border-transparent text-sidebar-foreground","hover:bg-sidebar-accent/10 hover:text-sidebar-accent",i&&"justify-center px-2"),"aria-label":i?`${t(x.labelKey,x.fallback)} (${t("common.opensNewTab","opens in new tab")})`:void 0,title:i?t(x.labelKey,x.fallback):void 0,children:[d.jsx(x.icon,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),!i&&d.jsxs("span",{className:"flex items-center gap-1.5",children:[t(x.labelKey,x.fallback),d.jsx(To,{className:"h-3 w-3 opacity-50","aria-hidden":"true"}),d.jsxs("span",{className:"sr-only",children:["(",t("common.opensNewTab","opens in new tab"),")"]})]})]},x.href))})]}),o&&d.jsx("div",{className:"border-t border-sidebar-border p-1.5",children:d.jsxs("div",{className:be("flex items-center gap-3 rounded-lg px-3 py-2",i&&"justify-center px-2"),"data-testid":"sidebar-user",children:[d.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-xs font-bold text-sidebar",children:c}),!i&&d.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-between",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"truncate text-sm font-medium text-sidebar-foreground",children:s.fullName||s.username}),s.email&&d.jsx("p",{className:"truncate text-xs text-sidebar-foreground/60",children:s.email})]}),d.jsx("button",{onClick:r,"data-testid":"sidebar-logout",title:t("auth.logout","Logout"),"aria-label":t("auth.logout","Logout"),className:"ms-2 shrink-0 rounded-md p-1.5 text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent/10 hover:text-sidebar-accent",children:d.jsx(PSe,{className:"h-4 w-4","aria-hidden":"true"})})]})]})}),d.jsx(jVe,{collapsed:i}),d.jsxs("div",{className:"border-t border-sidebar-border p-1.5",children:[!i&&d.jsx("p",{className:"mb-1 px-3 text-center text-[10px] text-sidebar-foreground/30",title:a==="Unknown"?"Standalone Demo Mode fallback":void 0,children:l?"Checking version...":a&&a!=="Unknown"?`EDDI ${a}`:"EDDI Demo 6.1.0"}),d.jsx("button",{onClick:e,"data-testid":"sidebar-toggle","aria-label":i?"Expand sidebar":"Collapse sidebar",className:"flex w-full items-center justify-center rounded-lg p-2 text-sidebar-foreground transition-all hover:bg-sidebar-accent/10 hover:text-sidebar-accent active:scale-[0.98]",children:i?d.jsx(cHe,{className:"h-5 w-5"}):d.jsx(aHe,{className:"h-5 w-5"})})]})]})}const OVe={dashboard:"/manage",agents:"/manage/agents",workflows:"/manage/workflows",chat:"/manage/chat",resources:"/manage/resources",conversations:"/manage/conversations",groups:"/manage/groups",logs:"/manage/logs",secrets:"/manage/secrets",audit:"/manage/audit",schedules:"/manage/schedules",quotas:"/manage/quotas",coordinator:"/manage/coordinator",orphans:"/manage/orphans"};function jVe({collapsed:i}){const{t:e}=xe(),t=il(),[n,s]=L.useState(!1),r=L.useRef(null),o=L.useRef(null),a=$s(g=>g.completedChapters),l=$s(g=>g.restartChapter),c=$s(g=>g.resetAll);L.useEffect(()=>{if(!n)return;const g=m=>{r.current&&!r.current.contains(m.target)&&s(!1)},f=m=>{var x;m.key==="Escape"&&(m.preventDefault(),s(!1),(x=o.current)==null||x.focus())};return document.addEventListener("mousedown",g),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",f)}},[n]);const u=g=>{s(!1),t(OVe[g]),setTimeout(()=>l(g),300)};L.useEffect(()=>{n&&requestAnimationFrame(()=>{var f;const g=(f=r.current)==null?void 0:f.querySelector('[role="menuitem"]');g==null||g.focus()})},[n]);const h=L.useCallback(g=>{var _,w;const f=(_=r.current)==null?void 0:_.querySelectorAll('[role="menuitem"]');if(!f||f.length===0)return;const m=Array.from(f),x=m.indexOf(document.activeElement);let v=null;switch(g.key){case"ArrowDown":v=(x+1)%m.length;break;case"ArrowUp":v=(x-1+m.length)%m.length;break;case"Home":v=0;break;case"End":v=m.length-1;break;default:return}g.preventDefault(),(w=m[v])==null||w.focus()},[]);return d.jsxs("div",{ref:r,className:"relative border-t border-sidebar-border p-1.5",children:[d.jsxs("button",{ref:o,onClick:()=>s(g=>!g),className:be("flex w-full items-center rounded-lg px-3 py-2 text-sidebar-foreground transition-all hover:bg-sidebar-accent/10 hover:text-sidebar-accent",i&&"justify-center px-2"),title:e("onboarding.help.title","Help & Tour"),"aria-label":e("onboarding.help.title","Help & Tour"),"aria-haspopup":"true","aria-expanded":n,"data-testid":"sidebar-help",children:[d.jsx(wBe,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),!i&&d.jsx("span",{className:"ms-3 text-sm font-medium",children:e("onboarding.help.title","Help & Tour")})]}),n&&d.jsxs("div",{className:be("absolute z-50 mb-2 w-56 rounded-xl border border-sidebar-border bg-sidebar p-1.5 shadow-xl shadow-black/20",i?"inset-s-14 bottom-0":"inset-s-2 bottom-full"),role:"menu","aria-label":e("onboarding.help.platformTour","Platform Tour"),onKeyDown:h,"data-testid":"help-menu-dropdown",children:[d.jsx("p",{className:"px-3 py-1.5 text-[10px] font-bold uppercase tracking-widest text-sidebar-foreground/40","aria-hidden":"true",children:e("onboarding.help.platformTour","Platform Tour")}),xG.map(g=>{const f=Xie[g],m=a.has(g);return d.jsxs("button",{onClick:()=>u(g),className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-start text-sm text-sidebar-foreground transition-colors hover:bg-sidebar-accent/10 focus:bg-sidebar-accent/10",role:"menuitem",tabIndex:-1,"data-testid":`help-chapter-${g}`,children:[d.jsx("span",{className:"flex-1 truncate",children:e(f.titleKey)}),m?d.jsx(Ns,{className:"h-3.5 w-3.5 text-emerald-500 shrink-0","aria-hidden":"true"}):d.jsx("span",{className:"h-3.5 w-3.5 shrink-0 rounded-full border border-sidebar-foreground/30","aria-hidden":"true"})]},g)}),d.jsx("div",{className:"mt-1 border-t border-sidebar-border pt-1",children:d.jsxs("button",{onClick:()=>{s(!1),c()},className:"flex w-full items-center gap-2 rounded-lg px-3 py-2 text-xs text-sidebar-foreground/50 transition-colors hover:text-sidebar-foreground hover:bg-sidebar-accent/10 focus:bg-sidebar-accent/10",role:"menuitem",tabIndex:-1,"data-testid":"help-reset-all",children:[d.jsx(S_,{className:"h-3.5 w-3.5","aria-hidden":"true"}),e("onboarding.help.resetAll","Reset All Tours")]})})]})]})}async function FVe(){const i=performance.now(),e=await fetch(`${window.location.origin}/administration/logs/instance-id`,{signal:AbortSignal.timeout(5e3),headers:Oe.getAuthHeader()}),t=Math.round(performance.now()-i);if(!e.ok)throw new Error(`HTTP ${e.status}`);return{instanceId:(await e.json()).instanceId,latencyMs:t}}const BVe=["platform","health"];function gke(){const i=hn({queryKey:BVe,queryFn:FVe,refetchInterval:15e3,staleTime:1e4,retry:1}),e=i.dataUpdatedAt||i.errorUpdatedAt,t=i.isLoading?"checking":i.isError?"offline":"online";return L.useMemo(()=>{var n,s;return{status:t,instanceId:((n=i.data)==null?void 0:n.instanceId)??null,latencyMs:t==="online"?((s=i.data)==null?void 0:s.latencyMs)??null:null,lastCheckedAt:e?new Date(e):null}},[t,i.data,e])}function HVe(){const{t:i}=xe(),{status:e,instanceId:t,latencyMs:n,lastCheckedAt:s}=gke(),[r,o]=L.useState(!1),a=L.useRef(null);L.useEffect(()=>{if(!r)return;const g=m=>{a.current&&!a.current.contains(m.target)&&o(!1)},f=m=>{m.key==="Escape"&&o(!1)};return document.addEventListener("mousedown",g),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",f)}},[r]);const[,l]=L.useState(0);L.useEffect(()=>{if(!r)return;const g=setInterval(()=>l(f=>f+1),1e3);return()=>clearInterval(g)},[r]);const c=L.useCallback(()=>{if(!s)return"";const g=Math.round((Date.now()-s.getTime())/1e3);return g<5?i("platform.justNow","just now"):i("platform.secondsAgo","{{count}}s ago",{count:g})},[s,i]),u=e==="online",h=e==="checking";return d.jsxs("div",{ref:a,className:"relative","data-testid":"platform-status",children:[d.jsxs("button",{onClick:()=>o(g=>!g),"aria-expanded":r,"aria-haspopup":"dialog","aria-label":h?i("platform.checking","Checking connection…"):u?i("platform.online","Online"):i("platform.offline","Offline"),className:be("inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium transition-all duration-500",h&&"border-border bg-muted/50 text-muted-foreground",u&&"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",!u&&!h&&"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400"),children:[d.jsx("span",{className:be("inline-block h-2 w-2 rounded-full transition-colors duration-500",h&&"bg-muted-foreground/40 animate-pulse",u&&"bg-emerald-500 animate-pulse",!u&&!h&&"bg-red-500 animate-pulse"),"aria-hidden":"true"}),d.jsx("span",{children:h?"…":u?i("platform.online","Online"):i("platform.offline","Offline")})]}),r&&d.jsxs("div",{className:"absolute inset-s-1/2 top-full z-50 mt-2 w-56 rounded-xl border border-border bg-card p-3 shadow-xl shadow-black/10 transform-[translateX(-50%)] rtl:transform-[translateX(50%)]",role:"dialog","aria-label":i("platform.status","Platform Status"),"data-testid":"platform-status-popover",children:[d.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:i("platform.status","Platform Status")}),d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx("span",{className:be("h-2.5 w-2.5 rounded-full",u?"bg-emerald-500 animate-pulse":h?"bg-muted-foreground/40 animate-pulse":"bg-red-500 animate-pulse")}),d.jsx("span",{className:be("text-sm font-medium",u?"text-emerald-600 dark:text-emerald-400":h?"text-muted-foreground":"text-red-600 dark:text-red-400"),children:h?i("platform.checking","Checking connection…"):u?i("platform.connected","Connected"):i("platform.disconnected","Disconnected")})]}),d.jsxs("div",{className:"space-y-1.5 text-xs",children:[t&&d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:i("platform.instance","Instance")}),d.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-foreground",children:t.length>12?`${t.substring(0,12)}…`:t})]}),n!==null&&d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:i("platform.latency","Latency")}),d.jsxs("span",{className:be("font-medium tabular-nums",n<100?"text-emerald-600 dark:text-emerald-400":n<500?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400"),children:[n,"ms"]})]}),s&&d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:i("platform.lastChecked","Last checked")}),d.jsx("span",{className:"text-foreground/70",children:c()})]})]})]})]})}function WVe(){const i=mp(),{t:e}=xe(),t=i.pathname.replace(/^\/manage\/?/,"").split("/").filter(Boolean),n=[{label:e("nav.dashboard"),to:"/manage"}],s={agents:e("nav.agents"),workflows:e("nav.packages"),conversations:e("nav.conversations"),chat:e("nav.chat"),resources:e("nav.resources"),groups:e("nav.groups","Groups"),coordinator:e("nav.coordinator","Coordinator"),schedules:e("nav.schedules","Schedules"),logs:e("nav.logs","Logs"),orphans:e("nav.orphans","Orphans"),secrets:e("nav.secrets","Secrets"),audit:e("nav.audit","Audit Trail"),quotas:e("nav.quotas","Quotas"),userdata:e("userData.title","User Data"),triggers:e("nav.triggers","Triggers"),capabilities:e("nav.capabilities","Capabilities"),sync:e("nav.sync","Sync"),gdpr:e("nav.gdpr","GDPR"),wizard:e("wizard.title","Agent Wizard"),workflowview:e("nav.packages")};let r="/manage";for(const o of t){r+=`/${o}`;const a=s[o]??(o.match(/^[a-f0-9]{24}$/)?`${o.substring(0,8)}…`:o.replace(/view$/,""));n.push({label:a,to:r})}return n}function VVe({onMenuClick:i,sidebarVisible:e}){var _;const{theme:t,setTheme:n}=RM(),{t:s,i18n:r}=xe(),o=WVe(),{method:a,user:l,logout:c}=hke(),u=a==="keycloak"&&l,[h,g]=L.useState(!1),f=L.useRef(null);L.useEffect(()=>{if(!h)return;const w=C=>{f.current&&!f.current.contains(C.target)&&g(!1)},k=C=>{C.key==="Escape"&&g(!1)};return document.addEventListener("mousedown",w),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",w),document.removeEventListener("keydown",k)}},[h]);const m=[{value:"light",icon:QHe,label:s("theme.light")},{value:"dark",icon:HSe,label:s("theme.dark")},{value:"system",icon:nHe,label:s("theme.system")}],x=[{code:"en",label:s("language.en")},{code:"de",label:s("language.de")},{code:"fr",label:s("language.fr")},{code:"es",label:s("language.es")},{code:"ar",label:s("language.ar")},{code:"zh",label:s("language.zh")},{code:"th",label:s("language.th")},{code:"ja",label:s("language.ja")},{code:"ko",label:s("language.ko")},{code:"pt",label:s("language.pt")},{code:"hi",label:s("language.hi")}],v=u?[l.firstName,l.lastName].filter(Boolean).map(w=>w[0]).join("").toUpperCase()||((_=l.username[0])==null?void 0:_.toUpperCase())||"?":"";return d.jsxs("header",{className:"flex h-16 items-center justify-between border-b border-border bg-card px-4",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:i,"data-testid":"mobile-menu-toggle","aria-label":s("nav.openMenu","Open navigation menu"),className:be("rounded-lg p-2 text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground md:hidden",e&&"hidden"),children:d.jsx(q7e,{className:"h-5 w-5","aria-hidden":"true"})}),d.jsx("nav",{"aria-label":"Breadcrumb",className:"hidden items-center gap-1 text-sm md:flex",children:o.map((w,k)=>d.jsxs("span",{className:"flex items-center gap-1",children:[k>0&&d.jsx(hs,{className:"h-3.5 w-3.5 text-muted-foreground/60"}),k===o.length-1?d.jsx("span",{className:"font-medium text-foreground","aria-current":"page",children:w.label}):d.jsx(Kn,{to:w.to,className:"text-muted-foreground transition-colors hover:text-foreground",children:w.label})]},w.to))})]}),d.jsx(HVe,{}),d.jsxs("div",{className:"flex items-center gap-2","data-tour":"topbar-personalize",children:[d.jsxs("div",{className:"relative flex items-center gap-1",children:[d.jsx(Su,{className:"h-4 w-4 text-muted-foreground"}),d.jsx("select",{value:r.language,onChange:w=>r.changeLanguage(w.target.value),"data-testid":"language-selector",className:"appearance-none rounded-md bg-transparent px-2 py-1.5 text-sm text-foreground outline-none transition-colors hover:bg-secondary focus:ring-2 focus:ring-ring",children:x.map(w=>d.jsx("option",{value:w.code,children:w.label},w.code))})]}),d.jsx("div",{className:"flex items-center rounded-lg bg-secondary p-0.5",children:m.map(w=>d.jsx("button",{onClick:()=>n(w.value),"data-testid":`theme-${w.value}`,title:w.label,"aria-label":w.label,"aria-pressed":t===w.value,className:be("rounded-md p-1.5 transition-colors",t===w.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:d.jsx(w.icon,{className:"h-4 w-4","aria-hidden":"true"})},w.value))}),u&&d.jsxs("div",{className:"relative",ref:f,children:[d.jsx("button",{onClick:()=>g(w=>!w),"data-testid":"user-menu-trigger",className:"flex h-8 w-8 items-center justify-center rounded-full bg-primary text-xs font-bold text-primary-foreground transition-opacity hover:opacity-80",title:l.fullName||l.username,"aria-label":s("auth.userMenu","User menu"),"aria-haspopup":"true","aria-expanded":h,children:v}),h&&d.jsxs("div",{className:"absolute inset-e-0 top-full z-50 mt-2 w-56 rounded-lg border border-border bg-card p-1 shadow-lg","data-testid":"user-menu-dropdown",role:"menu","aria-label":s("auth.userMenu","User menu"),children:[d.jsxs("div",{className:"border-b border-border px-3 py-2.5",children:[d.jsx("p",{className:"text-sm font-medium text-foreground",children:l.fullName||l.username}),l.email&&d.jsx("p",{className:"text-xs text-muted-foreground",children:l.email})]}),d.jsx("div",{className:"py-1",children:d.jsxs("button",{onClick:()=>{g(!1),c()},"data-testid":"user-menu-logout",role:"menuitem",className:"flex w-full items-center gap-2 rounded-md px-3 py-2 text-sm text-foreground transition-colors hover:bg-secondary",children:[d.jsx(PSe,{className:"h-4 w-4"}),s("auth.logout","Logout")]})})]})]})]})]})}const _c=ML(i=>({isOpen:!1,agentId:null,agentName:null,step:"idle",errorMessage:null,open:(e,t)=>i({isOpen:!0,agentId:e,agentName:t??"Agent",step:"idle",errorMessage:null}),close:()=>i({isOpen:!1,agentId:null,agentName:null,step:"idle",errorMessage:null}),setStep:(e,t)=>i({step:e,errorMessage:t??null})}));function zVe(i){const e=i.split("/"),t=e[e.length-1]||i;return t.split("?")[0]??t}async function UVe(i,e){const t=await Oe.post(`/agents/${e}/start`);return zVe(t.location)}function Zie(i,e,t,n=!1){const s=new URLSearchParams({returnDetailed:"false",returnCurrentStepOnly:String(n)});return Oe.get(`/agents/${t}?${s.toString()}`)}async function $Ve(i,e,t,n){const s=new URLSearchParams({returnDetailed:"false",returnCurrentStepOnly:"true"}),r=await fetch(`${Oe.getBaseUrl()}/agents/${t}?${s.toString()}`,{method:"POST",headers:{"Content-Type":"text/plain",...Oe.getAuthHeader()},body:n});if(!r.ok)throw{status:r.status,message:r.statusText,url:r.url};return r.json()}function qVe(i,e,t,n){const s=new URLSearchParams({returnDetailed:"false",returnCurrentStepOnly:"true"});return Oe.post(`/agents/${t}?${s.toString()}`,n)}async function*KVe(i,e,t,n,s){var c;const r=await fetch(`${Oe.getBaseUrl()}/agents/${t}/stream`,{method:"POST",headers:{"Content-Type":"application/json",...Oe.getAuthHeader()},body:JSON.stringify(n),signal:s});if(!r.ok)throw{status:r.status,message:`Streaming failed: ${r.statusText}`,url:r.url};const o=(c=r.body)==null?void 0:c.getReader();if(!o)throw new Error("No readable stream");const a=new TextDecoder;let l="";try{for(;;){const{done:u,value:h}=await o.read();if(u)break;l+=a.decode(h,{stream:!0});const g=l.split(`
-
-`);l=g.pop()??"";for(const f of g){if(!f.trim())continue;let m="token",x="";for(const v of f.split(`
-`))v.startsWith("event:")?m=v.slice(6).trim():v.startsWith("data:")&&(x=v.slice(5).trim());(x||m)&&(yield{type:m,data:x})}}}finally{o.releaseLock()}}function GVe(i){return Oe.post(`/agents/${i}/endConversation`)}function YVe(i,e,t){return Oe.post(`/agents/${t}/undo`)}function QVe(i,e,t){return Oe.post(`/agents/${t}/redo`)}function XVe(i){const e=new URLSearchParams({returnDetailed:"false",returnCurrentStepOnly:"true"});return Oe.post(`/agents/${i}/rerun?${e.toString()}`)}function ZVe(i){if(!i)return{agentId:"",agentVersion:0};try{const e=i.startsWith("eddi://")?i.replace("eddi://","http://"):i,t=new URL(e,"http://dummy"),n=t.pathname.split("/"),s=n[n.length-1]||"",r=parseInt(t.searchParams.get("version")||"0",10);return{agentId:s,agentVersion:isNaN(r)?0:r}}catch{return{agentId:i,agentVersion:0}}}function JVe(i){const e=ZVe(i.agentResource);return{resource:i.resource,name:i.name||i.agentName||"",description:i.description||"",createdOn:i.createdOn,lastModifiedOn:i.lastModifiedOn,agentId:i.agentId||e.agentId,agentVersion:i.agentVersion??e.agentVersion,conversationState:i.conversationState,viewState:i.viewState,conversationStepSize:i.conversationStepSize,environment:i.environment,userId:i.userId}}function Cj(i){var t;const e=(t=i.conversationStep)==null?void 0:t.find(n=>n.key==="input:initial");return e==null?void 0:e.value}function Iw(i){if(!i)return;const e=[],t=i.output;if(Array.isArray(t)){for(const n of t)typeof n=="string"?e.push(n):n!=null&&n.text&&e.push(n.text);if(e.length>0)return e.join(`
-`)}for(const[n,s]of Object.entries(i))if(n.startsWith("output:text:"))if(typeof s=="string")e.push(s);else if(Array.isArray(s))for(const r of s)typeof r=="string"?e.push(r):r!=null&&r.text&&e.push(r.text);else s&&typeof s=="object"&&s.text&&e.push(s.text);return e.length>0?e.join(`
-`):void 0}function eze(i){if(!i)return;const e=i.output;if(Array.isArray(e)){for(const t of e)if(t&&typeof t=="object"&&t.type==="inputField"){const n=t;return{subType:n.subType||"password",placeholder:n.placeholder,label:n.label,defaultValue:n.defaultValue}}}}function Jie(i){if(!i)return[];const e=i.quickReplies;return Array.isArray(e)?e.map(t=>typeof t=="string"?t:t&&typeof t=="object"&&"value"in t?t.value:null).filter(t=>t!==null):[]}function tze(i){var t;const e=(t=i.conversationStep)==null?void 0:t.find(n=>n.key==="actions");return e!=null&&e.value?Array.isArray(e.value)?e.value:typeof e.value=="string"?[e.value]:[]:[]}function dg(i){try{const e=i.startsWith("eddi://")?i.replace("eddi://","http://"):i,n=new URL(e,"http://dummy").pathname.split("/");return n[n.length-1]||i}catch{return i}}async function PL(i=20,e=0,t="",n="",s,r){const o=new URLSearchParams({limit:String(i),index:String(e)});t&&o.set("filter",t),n&&o.set("agentId",n),r&&o.set("conversationState",r);const a=await Oe.get(`/conversationstore/conversations?${o.toString()}`);return(Array.isArray(a)?a:(a==null?void 0:a.value)??[]).map(JVe)}function fke(i,e=!1,t=!1){const n=new URLSearchParams({returnDetailed:String(e),returnCurrentStepOnly:String(t)});return Oe.get(`/conversationstore/conversations/simple/${i}?${n.toString()}`)}function nze(i,e=!1){return Oe.delete(`/conversationstore/conversations/${i}?deletePermanently=${e}`)}function ize(i){return Oe.get(`/agents/${i}?returnDetailed=true`)}const Sj=["production","test"],pke={high:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20",medium:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",low:"bg-rose-500/10 text-rose-600 dark:text-rose-400 border-rose-500/20"};function uo(i){const e=i.startsWith("eddi://")?i.replace("eddi://","http://"):i,t=new URL(e,"http://dummy"),n=t.pathname.split("/").filter(Boolean),s=n[n.length-1]??i,r=parseInt(t.searchParams.get("version")||"1",10),o=isNaN(r)?1:r;return{id:s,version:o}}function OL(i=20,e=0,t=""){const n=new URLSearchParams({limit:String(i),index:String(e)});return t&&n.set("filter",t),Oe.get(`/agentstore/agents/descriptors?${n.toString()}`)}async function sze(i){const t=await Oe.get(`/agentstore/agents/${i}/currentversion`)??1,s=(await Promise.all(Array.from({length:t},(r,o)=>o+1).map(async r=>{try{return await Oe.get(`/agentstore/agents/descriptors?filter=${i}&version=${r}`)}catch{return[]}}))).flat();return s.length===0?Oe.get(`/agentstore/agents/descriptors?filter=${i}`):s}function vC(i,e){const t=e!=null&&e>0?`?version=${e}`:"";return Oe.get(`/agentstore/agents/${i}${t}`)}function rze(i){return Oe.post("/agentstore/agents",i)}function jM(i,e,t){return Oe.put(`/agentstore/agents/${i}?version=${e}`,t)}function mke(i,e,t){const n=new URLSearchParams({version:String(e)});return t!=null&&t.cascade&&n.set("cascade","true"),t!=null&&t.permanent&&n.set("permanent","true"),Oe.delete(`/agentstore/agents/${i}?${n}`)}function oze(i,e,t=!1){return Oe.post(`/agentstore/agents/${i}?version=${e}&deepCopy=${t}`)}function ese(i,e,t){return Oe.post(`/administration/${i}/deploy/${e}?version=${t}`)}function aze(i,e,t){return Oe.post(`/administration/${i}/undeploy/${e}?version=${t}`)}function FM(i,e,t){return Oe.get(`/administration/${i}/deploymentstatus/${e}?version=${t}`)}async function lze(i,e){return(await Promise.allSettled(Sj.map(async n=>{try{const s=await FM(n,i,e);return{environment:n,status:s.status}}catch{return{environment:n,status:"NOT_FOUND"}}}))).map((n,s)=>n.status==="fulfilled"?n.value:{environment:Sj[s],status:"NOT_FOUND"})}const cze=()=>{try{return localStorage.getItem("eddi-debug-open")==="true"}catch{return!1}},ife=i=>{try{localStorage.setItem("eddi-debug-open",String(i))}catch{}},dze=()=>{try{return localStorage.getItem("eddi-show-activity")!=="false"}catch{return!0}},uze=i=>{try{localStorage.setItem("eddi-show-activity",String(i))}catch{}},bu=ML(i=>({turns:[],currentTurnEvents:[],currentTurnStart:0,isDebugOpen:cze(),activeTab:"pipeline",selectedTurnIndex:null,showActivity:dze(),addEvent:e=>i(t=>({currentTurnEvents:[...t.currentTurnEvents,e],currentTurnStart:t.currentTurnStart||e.timestamp})),finalizeTurn:()=>i(e=>{if(e.currentTurnEvents.length===0)return e;const t=e.currentTurnEvents,n=t.reduce((r,o)=>r+(o.durationMs??0),0),s={turnIndex:e.turns.length,events:t,totalDurationMs:n,startTime:e.currentTurnStart};return{turns:[...e.turns,s],currentTurnEvents:[],currentTurnStart:0,selectedTurnIndex:null}}),setDebugOpen:e=>{ife(e),i({isDebugOpen:e})},toggleDebug:()=>i(e=>{const t=!e.isDebugOpen;return ife(t),{isDebugOpen:t}}),setActiveTab:e=>i({activeTab:e}),setSelectedTurn:e=>i({selectedTurnIndex:e}),toggleShowActivity:()=>i(e=>{const t=!e.showActivity;return uze(t),{showActivity:t}}),reset:()=>i({turns:[],currentTurnEvents:[],currentTurnStart:0,selectedTurnIndex:null})})),hze=()=>{try{return localStorage.getItem("eddi-chat-streaming")!=="false"}catch{return!0}},Oi=ML(i=>({messages:[],conversationId:null,selectedAgentId:null,selectedAgentName:null,isProcessing:!1,isThinking:!1,streamingEnabled:hze(),undoAvailable:!1,redoAvailable:!1,quickReplies:[],activeInputField:null,isSecretMode:!1,setSelectedAgent:(e,t)=>i({selectedAgentId:e,selectedAgentName:t,conversationId:null,messages:[]}),setConversationId:e=>i({conversationId:e}),addMessage:e=>i(t=>({messages:[...t.messages,e]})),appendToLastAgentMessage:e=>i(t=>{const n=[...t.messages],s=n[n.length-1];return(s==null?void 0:s.role)==="agent"&&(n[n.length-1]={...s,content:s.content+e}),{messages:n}}),finishStreaming:()=>i(e=>{const t=[...e.messages],n=t[t.length-1];return(n==null?void 0:n.role)==="agent"&&(t[t.length-1]={...n,isStreaming:!1}),{messages:t,isProcessing:!1}}),setProcessing:e=>i({isProcessing:e}),setThinking:e=>i({isThinking:e}),toggleStreaming:()=>i(e=>{const t=!e.streamingEnabled;try{localStorage.setItem("eddi-chat-streaming",String(t))}catch{}return{streamingEnabled:t}}),clearMessages:()=>i({messages:[],conversationId:null,undoAvailable:!1,redoAvailable:!1,quickReplies:[],activeInputField:null,isSecretMode:!1}),setUndoRedo:(e,t)=>i({undoAvailable:e,redoAvailable:t}),setQuickReplies:e=>i({quickReplies:e}),replaceMessages:e=>i({messages:e}),setInputField:e=>i({activeInputField:e}),clearInputField:()=>i({activeInputField:null}),toggleSecretMode:()=>i(e=>({isSecretMode:!e.isSecretMode})),reset:()=>i({messages:[],conversationId:null,selectedAgentId:null,selectedAgentName:null,isProcessing:!1,isThinking:!1,undoAvailable:!1,redoAvailable:!1,quickReplies:[],activeInputField:null,isSecretMode:!1})})),tse=["chat"];function nse(){return hn({queryKey:[...tse,"deployedAgents"],queryFn:async()=>{const i=await OL(500,0,""),e=new Map;for(const s of i){const{id:r,version:o}=uo(s.resource),a=e.get(s.name);(!a||o>a.version)&&e.set(s.name,{...s,id:r,version:o})}const t=Array.from(e.values());return(await Promise.allSettled(t.map(async s=>{const r=await FM("production",s.id,s.version);return{agent:s,status:r}}))).filter(s=>s.status==="fulfilled"&&s.value.status.status==="READY").map(s=>s.value.agent)},staleTime:6e4})}function BM(){const i=Oi;return Kt({mutationFn:async({agentId:e})=>{const t=await UVe("production",e);i.getState().setConversationId(t);const s=(await Zie("production",e,t,!1)).conversationOutputs??[];for(const r of s){const o=Iw(r);o&&i.getState().addMessage({id:`welcome-${Date.now()}-${Math.random()}`,role:"agent",content:o,timestamp:Date.now()});const a=Jie(r);a.length>0&&i.getState().setQuickReplies(a)}return t}})}function ise(){const i=Oi;return Kt({mutationFn:async({message:e,isSecret:t})=>{var a,l;const n=i.getState(),{selectedAgentId:s,conversationId:r,streamingEnabled:o}=n;if(!s||!r)throw new Error("No active conversation");if(n.addMessage({id:`user-${Date.now()}`,role:"user",content:t?"●●●●●●●●":e,timestamp:Date.now()}),n.setProcessing(!0),n.setQuickReplies([]),t&&n.clearInputField(),o){n.addMessage({id:`agent-${Date.now()}`,role:"agent",content:"",timestamp:Date.now(),isStreaming:!0});const c=new AbortController,u=KVe("production",s,r,{input:e},c.signal);try{for await(const h of u)if(gze(h,i)){c.abort();break}}catch(h){if(!(h instanceof DOMException&&h.name==="AbortError"))throw h}i.getState().isProcessing&&i.getState().finishStreaming()}else{const c=`agent-typing-${Date.now()}`;n.addMessage({id:c,role:"agent",content:"",timestamp:Date.now(),isStreaming:!0});let u;t?u=await qVe("production",s,r,{input:e,context:{secretInput:{type:"string",value:"true"}}}):u=await $Ve("production",s,r,e);const h=(l=u.conversationOutputs)==null?void 0:l[(((a=u.conversationOutputs)==null?void 0:a.length)??1)-1],g=Iw(h);i.setState(x=>{const v=x.messages.filter(_=>_.id!==c);return g&&v.push({id:`agent-${Date.now()}`,role:"agent",content:g,timestamp:Date.now()}),{messages:v}});const f=eze(h);f&&n.setInputField(f);const m=Jie(h);n.setQuickReplies(m),n.setProcessing(!1)}},onError:e=>{const t=i.getState(),n=e&&typeof e=="object"&&"message"in e?String(e.message):String(e);t.addMessage({id:`agent-error-${Date.now()}`,role:"agent",content:`
-
-⚠️ Error: ${n}`,timestamp:Date.now()}),t.setProcessing(!1),t.setQuickReplies([])}})}function gze(i,e){var n;const t=bu.getState();switch(i.type){case"token":return e.getState().setThinking(!1),e.getState().appendToLastAgentMessage(i.data),!1;case"done":{t.finalizeTurn();let s=[];if(i.data)try{const r=JSON.parse(i.data);if((n=r.conversationOutputs)!=null&&n.length){const o=r.conversationOutputs[r.conversationOutputs.length-1];s=Jie(o);const a=e.getState().messages,l=a[a.length-1];if((l==null?void 0:l.role)==="agent"&&!l.content.trim()){const c=Iw(o);c&&e.setState(u=>{const h=[...u.messages],g=h[h.length-1];return g&&(h[h.length-1]={id:g.id,role:g.role,content:c,timestamp:g.timestamp,isStreaming:g.isStreaming}),{messages:h}})}}}catch{}return e.getState().setQuickReplies(s),e.getState().finishStreaming(),!0}case"error":return e.getState().appendToLastAgentMessage(`
-
-⚠️ Error: ${i.data}`),e.getState().finishStreaming(),t.finalizeTurn(),!0;case"task_start":{e.getState().setThinking(!0);let s="unknown",r="unknown",o=0;try{const a=JSON.parse(i.data);s=a.taskId??a.id??"unknown",r=a.taskType??a.type??"unknown",o=a.index??0}catch{r=i.data||"unknown"}return t.addEvent({type:"task_start",taskId:s,taskType:r,index:o,timestamp:Date.now()}),!1}case"task_complete":{e.getState().setThinking(!1);let s="unknown",r="unknown",o=0,a,l,c,u;try{const h=JSON.parse(i.data);s=h.taskId??h.id??"unknown",r=h.taskType??h.type??"unknown",o=h.index??0,a=h.durationMs??h.duration,l=h.actions,c=h.confidence,u=h.toolTrace}catch{r=i.data||"unknown"}return t.addEvent({type:"task_complete",taskId:s,taskType:r,index:o,durationMs:a,actions:l,confidence:c,toolTrace:u,timestamp:Date.now()}),!1}default:return!1}}function p7(i){const e=[],t=i.conversationOutputs??[];for(let n=0;n<(i.conversationSteps??[]).length;n++){const s=i.conversationSteps[n],r=s?Cj(s):void 0,o=Iw(t[n]);r&&e.push({id:`user-${e.length}-${Date.now()}`,role:"user",content:r,timestamp:Date.now()}),o&&e.push({id:`agent-${e.length}-${Date.now()}`,role:"agent",content:o,timestamp:Date.now()})}return e}function fze(i){return hn({queryKey:[...tse,"history",i],queryFn:()=>PL(50,0,"",i??""),enabled:!!i,staleTime:3e4})}function pze(){const i=Oi;return Kt({mutationFn:async({agentId:e,conversationId:t})=>{i.getState().clearMessages(),i.getState().setConversationId(t);const n=await Zie("production",e,t,!1),s=p7(n);return i.getState().replaceMessages(s),i.getState().setUndoRedo(n.conversationSteps.length>0,n.redoAvailable??!1),n}})}function mze(){const i=Oi;return Kt({mutationFn:async()=>{const{selectedAgentId:e,conversationId:t}=i.getState();if(!e||!t)throw new Error("No active conversation");const n=await YVe("production",e,t),s=p7(n);return i.getState().replaceMessages(s),i.getState().setUndoRedo(n.conversationSteps.length>0,n.redoAvailable??!1),n}})}function bze(){const i=Oi;return Kt({mutationFn:async()=>{const{selectedAgentId:e,conversationId:t}=i.getState();if(!e||!t)throw new Error("No active conversation");const n=await QVe("production",e,t),s=p7(n);return i.getState().replaceMessages(s),i.getState().setUndoRedo(n.conversationSteps.length>0,n.redoAvailable??!1),n}})}function xze(){const i=Oi,e=cn();return Kt({mutationFn:async()=>{const t=i.getState().conversationId;if(!t)throw new Error("No active conversation");await GVe(t),i.getState().clearMessages()},onSuccess:()=>{e.invalidateQueries({queryKey:[...tse,"history"]})}})}function vze(){const i=Oi;return Kt({mutationFn:async()=>{const{selectedAgentId:e,conversationId:t}=i.getState();if(!e||!t)throw new Error("No active conversation");await XVe(t);const n=await Zie("production",e,t,!1),s=p7(n);return i.getState().replaceMessages(s),i.getState().setUndoRedo(n.conversationSteps.length>0,n.redoAvailable??!1),n}})}function sfe(i){const e=[],t=String(i||"");let n=t.indexOf(","),s=0,r=!1;for(;!r;){n===-1&&(n=t.length,r=!0);const o=t.slice(s,n).trim();(o||!r)&&e.push(o),s=n+1,n=t.indexOf(",",s)}return e}function bke(i,e){const t={};return(i[i.length-1]===""?[...i,""]:i).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const _ze=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yze=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wze={};function rfe(i,e){return(wze.jsx?yze:_ze).test(i)}const Cze=/[ \t\n\f\r]/g;function Sze(i){return typeof i=="object"?i.type==="text"?ofe(i.value):!1:ofe(i)}function ofe(i){return i.replace(Cze,"")===""}class HM{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}HM.prototype.normal={};HM.prototype.property={};HM.prototype.space=void 0;function xke(i,e){const t={},n={};for(const s of i)Object.assign(t,s.property),Object.assign(n,s.normal);return new HM(t,n,e)}function bA(i){return i.toLowerCase()}class jd{constructor(e,t){this.attribute=t,this.property=e}}jd.prototype.attribute="";jd.prototype.booleanish=!1;jd.prototype.boolean=!1;jd.prototype.commaOrSpaceSeparated=!1;jd.prototype.commaSeparated=!1;jd.prototype.defined=!1;jd.prototype.mustUseProperty=!1;jd.prototype.number=!1;jd.prototype.overloadedBoolean=!1;jd.prototype.property="";jd.prototype.spaceSeparated=!1;jd.prototype.space=void 0;let kze=0;const mi=_C(),ia=_C(),vG=_C(),Dt=_C(),Rr=_C(),mN=_C(),Xd=_C();function _C(){return 2**++kze}const _G=Object.freeze(Object.defineProperty({__proto__:null,boolean:mi,booleanish:ia,commaOrSpaceSeparated:Xd,commaSeparated:mN,number:Dt,overloadedBoolean:vG,spaceSeparated:Rr},Symbol.toStringTag,{value:"Module"})),sU=Object.keys(_G);class sse extends jd{constructor(e,t,n,s){let r=-1;if(super(e,t),afe(this,"space",s),typeof n=="number")for(;++r4&&t.slice(0,4)==="data"&&Tze.test(e)){if(e.charAt(4)==="-"){const r=e.slice(5).replace(lfe,Aze);n="data"+r.charAt(0).toUpperCase()+r.slice(1)}else{const r=e.slice(4);if(!lfe.test(r)){let o=r.replace(Dze,Ize);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}s=sse}return new s(n,e)}function Ize(i){return"-"+i.toLowerCase()}function Aze(i){return i.charAt(1).toUpperCase()}const WM=xke([vke,Nze,wke,Cke,Ske],"html"),Z_=xke([vke,Eze,wke,Cke,Ske],"svg");function cfe(i){const e=String(i||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function kke(i){return i.join(" ").trim()}var LS={},rU,dfe;function Rze(){if(dfe)return rU;dfe=1;var i=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,t=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,r=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
-`,c="/",u="*",h="",g="comment",f="declaration";function m(v,_){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];_=_||{};var w=1,k=1;function C($){var K=$.match(e);K&&(w+=K.length);var z=$.lastIndexOf(l);k=~z?$.length-z:k+$.length}function E(){var $={line:w,column:k};return function(K){return K.position=new D($),R(),K}}function D($){this.start=$,this.end={line:w,column:k},this.source=_.source}D.prototype.content=v;function T($){var K=new Error(_.source+":"+w+":"+k+": "+$);if(K.reason=$,K.filename=_.source,K.line=w,K.column=k,K.source=v,!_.silent)throw K}function I($){var K=$.exec(v);if(K){var z=K[0];return C(z),v=v.slice(z.length),K}}function R(){I(t)}function P($){var K;for($=$||[];K=j();)K!==!1&&$.push(K);return $}function j(){var $=E();if(!(c!=v.charAt(0)||u!=v.charAt(1))){for(var K=2;h!=v.charAt(K)&&(u!=v.charAt(K)||c!=v.charAt(K+1));)++K;if(K+=2,h===v.charAt(K-1))return T("End of comment missing");var z=v.slice(2,K-2);return k+=2,C(z),v=v.slice(K),k+=2,$({type:g,comment:z})}}function B(){var $=E(),K=I(n);if(K){if(j(),!I(s))return T("property missing ':'");var z=I(r),G=$({type:f,property:x(K[0].replace(i,h)),value:z?x(z[0].replace(i,h)):h});return I(o),G}}function U(){var $=[];P($);for(var K;K=B();)K!==!1&&($.push(K),P($));return $}return R(),U()}function x(v){return v?v.replace(a,h):h}return rU=m,rU}var ufe;function Mze(){if(ufe)return LS;ufe=1;var i=LS&&LS.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(LS,"__esModule",{value:!0}),LS.default=t;const e=i(Rze());function t(n,s){let r=null;if(!n||typeof n!="string")return r;const o=(0,e.default)(n),a=typeof s=="function";return o.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;a?s(c,u,l):u&&(r=r||{},r[c]=u)}),r}return LS}var mT={},hfe;function Pze(){if(hfe)return mT;hfe=1,Object.defineProperty(mT,"__esModule",{value:!0}),mT.camelCase=void 0;var i=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,t=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,r=function(c){return!c||t.test(c)||i.test(c)},o=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),r(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(s,a):c=c.replace(n,a),c.replace(e,o))};return mT.camelCase=l,mT}var bT,gfe;function Oze(){if(gfe)return bT;gfe=1;var i=bT&&bT.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=i(Mze()),t=Pze();function n(s,r){var o={};return!s||typeof s!="string"||(0,e.default)(s,function(a,l){a&&l&&(o[(0,t.camelCase)(a,r)]=l)}),o}return n.default=n,bT=n,bT}var jze=Oze();const Fze=t7(jze),b7=Nke("end"),vp=Nke("start");function Nke(i){return e;function e(t){const n=t&&t.position&&t.position[i]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Bze(i){const e=vp(i),t=b7(i);if(e&&t)return{start:e,end:t}}function F2(i){return!i||typeof i!="object"?"":"position"in i||"type"in i?ffe(i.position):"start"in i||"end"in i?ffe(i):"line"in i||"column"in i?yG(i):""}function yG(i){return pfe(i&&i.line)+":"+pfe(i&&i.column)}function ffe(i){return yG(i&&i.start)+"-"+yG(i&&i.end)}function pfe(i){return i&&typeof i=="number"?i:1}class cc extends Error{constructor(e,t,n){super(),typeof t=="string"&&(n=t,t=void 0);let s="",r={},o=!1;if(t&&("line"in t&&"column"in t?r={place:t}:"start"in t&&"end"in t?r={place:t}:"type"in t?r={ancestors:[t],place:t.position}:r={...t}),typeof e=="string"?s=e:!r.cause&&e&&(o=!0,s=e.message,r.cause=e),!r.ruleId&&!r.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?r.ruleId=n:(r.source=n.slice(0,l),r.ruleId=n.slice(l+1))}if(!r.place&&r.ancestors&&r.ancestors){const l=r.ancestors[r.ancestors.length-1];l&&(r.place=l.position)}const a=r.place&&"start"in r.place?r.place.start:r.place;this.ancestors=r.ancestors||void 0,this.cause=r.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=a?a.line:void 0,this.name=F2(r.place)||"1:1",this.place=r.place||void 0,this.reason=this.message,this.ruleId=r.ruleId||void 0,this.source=r.source||void 0,this.stack=o&&r.cause&&typeof r.cause.stack=="string"?r.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}cc.prototype.file="";cc.prototype.name="";cc.prototype.reason="";cc.prototype.message="";cc.prototype.stack="";cc.prototype.column=void 0;cc.prototype.line=void 0;cc.prototype.ancestors=void 0;cc.prototype.cause=void 0;cc.prototype.fatal=void 0;cc.prototype.place=void 0;cc.prototype.ruleId=void 0;cc.prototype.source=void 0;const rse={}.hasOwnProperty,Hze=new Map,Wze=/[A-Z]/g,Vze=new Set(["table","tbody","thead","tfoot","tr"]),zze=new Set(["td","th"]),Eke="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Uze(i,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=e.filePath||void 0;let n;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=Zze(t,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=Xze(t,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:n,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Z_:WM,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},r=Lke(s,i,void 0);return r&&typeof r!="string"?r:s.create(i,s.Fragment,{children:r||void 0},void 0)}function Lke(i,e,t){if(e.type==="element")return $ze(i,e,t);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return qze(i,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Gze(i,e,t);if(e.type==="mdxjsEsm")return Kze(i,e);if(e.type==="root")return Yze(i,e,t);if(e.type==="text")return Qze(i,e)}function $ze(i,e,t){const n=i.schema;let s=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(s=Z_,i.schema=s),i.ancestors.push(e);const r=Tke(i,e.tagName,!1),o=Jze(i,e);let a=ase(i,e);return Vze.has(e.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Sze(l):!0})),Dke(i,o,r,e),ose(o,a),i.ancestors.pop(),i.schema=n,i.create(e,r,o,t)}function qze(i,e){if(e.data&&e.data.estree&&i.evaluater){const n=e.data.estree.body[0];return n.type,i.evaluater.evaluateExpression(n.expression)}xA(i,e.position)}function Kze(i,e){if(e.data&&e.data.estree&&i.evaluater)return i.evaluater.evaluateProgram(e.data.estree);xA(i,e.position)}function Gze(i,e,t){const n=i.schema;let s=n;e.name==="svg"&&n.space==="html"&&(s=Z_,i.schema=s),i.ancestors.push(e);const r=e.name===null?i.Fragment:Tke(i,e.name,!0),o=eUe(i,e),a=ase(i,e);return Dke(i,o,r,e),ose(o,a),i.ancestors.pop(),i.schema=n,i.create(e,r,o,t)}function Yze(i,e,t){const n={};return ose(n,ase(i,e)),i.create(e,i.Fragment,n,t)}function Qze(i,e){return e.value}function Dke(i,e,t,n){typeof t!="string"&&t!==i.Fragment&&i.passNode&&(e.node=n)}function ose(i,e){if(e.length>0){const t=e.length>1?e:e[0];t&&(i.children=t)}}function Xze(i,e,t){return n;function n(s,r,o,a){const c=Array.isArray(o.children)?t:e;return a?c(r,o,a):c(r,o)}}function Zze(i,e){return t;function t(n,s,r,o){const a=Array.isArray(r.children),l=vp(n);return e(s,r,o,a,{columnNumber:l?l.column-1:void 0,fileName:i,lineNumber:l?l.line:void 0},void 0)}}function Jze(i,e){const t={};let n,s;for(s in e.properties)if(s!=="children"&&rse.call(e.properties,s)){const r=tUe(i,s,e.properties[s]);if(r){const[o,a]=r;i.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&zze.has(e.tagName)?n=a:t[o]=a}}if(n){const r=t.style||(t.style={});r[i.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return t}function eUe(i,e){const t={};for(const n of e.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&i.evaluater){const r=n.data.estree.body[0];r.type;const o=r.expression;o.type;const a=o.properties[0];a.type,Object.assign(t,i.evaluater.evaluateExpression(a.argument))}else xA(i,e.position);else{const s=n.name;let r;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&i.evaluater){const a=n.value.data.estree.body[0];a.type,r=i.evaluater.evaluateExpression(a.expression)}else xA(i,e.position);else r=n.value===null?!0:n.value;t[s]=r}return t}function ase(i,e){const t=[];let n=-1;const s=i.passKeys?new Map:Hze;for(;++ns?0:s+e:e=e>s?s:e,t=t>0?t:0,n.length<1e4)o=Array.from(n),o.unshift(e,t),i.splice(...o);else for(t&&i.splice(e,t);r0?(vu(i,i.length,0,e),i):e}const xfe={}.hasOwnProperty;function Ake(i){const e={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function mg(i){return i.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kc=J_(/[A-Za-z]/),Gl=J_(/[\dA-Za-z]/),dUe=J_(/[#-'*+\--9=?A-Z^-~]/);function kj(i){return i!==null&&(i<32||i===127)}const wG=J_(/\d/),uUe=J_(/[\dA-Fa-f]/),hUe=J_(/[!-/:-@[-`{-~]/);function In(i){return i!==null&&i<-2}function Er(i){return i!==null&&(i<0||i===32)}function Bi(i){return i===-2||i===-1||i===32}const x7=J_(new RegExp("\\p{P}|\\p{S}","u")),Aw=J_(/\s/);function J_(i){return e;function e(t){return t!==null&&t>-1&&i.test(String.fromCharCode(t))}}function FL(i){const e=[];let t=-1,n=0,s=0;for(;++t55295&&r<57344){const a=i.charCodeAt(t+1);r<56320&&a>56319&&a<57344?(o=String.fromCharCode(r,a),s=1):o="�"}else o=String.fromCharCode(r);o&&(e.push(i.slice(n,t),encodeURIComponent(o)),n=t+s+1,o=""),s&&(t+=s,s=0)}return e.join("")+i.slice(n)}function ds(i,e,t,n){const s=n?n-1:Number.POSITIVE_INFINITY;let r=0;return o;function o(l){return Bi(l)?(i.enter(t),a(l)):e(l)}function a(l){return Bi(l)&&r++o))return;const T=e.events.length;let I=T,R,P;for(;I--;)if(e.events[I][0]==="exit"&&e.events[I][1].type==="chunkFlow"){if(R){P=e.events[I][1].end;break}R=!0}for(_(n),D=T;Dk;){const E=t[C];e.containerState=E[1],E[0].exit.call(e,i)}t.length=k}function w(){s.write([null]),r=void 0,s=void 0,e.containerState._closeFlow=void 0}}function bUe(i,e,t){return ds(i,i.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function FE(i){if(i===null||Er(i)||Aw(i))return 1;if(x7(i))return 2}function v7(i,e,t){const n=[];let s=-1;for(;++s1&&i[t][1].end.offset-i[t][1].start.offset>1?2:1;const h={...i[n][1].end},g={...i[t][1].start};_fe(h,-l),_fe(g,l),o={type:l>1?"strongSequence":"emphasisSequence",start:h,end:{...i[n][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...i[t][1].start},end:g},r={type:l>1?"strongText":"emphasisText",start:{...i[n][1].end},end:{...i[t][1].start}},s={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},i[n][1].end={...o.start},i[t][1].start={...a.end},c=[],i[n][1].end.offset-i[n][1].start.offset&&(c=uh(c,[["enter",i[n][1],e],["exit",i[n][1],e]])),c=uh(c,[["enter",s,e],["enter",o,e],["exit",o,e],["enter",r,e]]),c=uh(c,v7(e.parser.constructs.insideSpan.null,i.slice(n+1,t),e)),c=uh(c,[["exit",r,e],["enter",a,e],["exit",a,e],["exit",s,e]]),i[t][1].end.offset-i[t][1].start.offset?(u=2,c=uh(c,[["enter",i[t][1],e],["exit",i[t][1],e]])):u=0,vu(i,n-1,t-n+3,c),t=n+c.length-u-2;break}}for(t=-1;++t0&&Bi(D)?ds(i,w,"linePrefix",r+1)(D):w(D)}function w(D){return D===null||In(D)?i.check(yfe,x,C)(D):(i.enter("codeFlowValue"),k(D))}function k(D){return D===null||In(D)?(i.exit("codeFlowValue"),w(D)):(i.consume(D),k)}function C(D){return i.exit("codeFenced"),e(D)}function E(D,T,I){let R=0;return P;function P(K){return D.enter("lineEnding"),D.consume(K),D.exit("lineEnding"),j}function j(K){return D.enter("codeFencedFence"),Bi(K)?ds(D,B,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):B(K)}function B(K){return K===a?(D.enter("codeFencedFenceSequence"),U(K)):I(K)}function U(K){return K===a?(R++,D.consume(K),U):R>=o?(D.exit("codeFencedFenceSequence"),Bi(K)?ds(D,$,"whitespace")(K):$(K)):I(K)}function $(K){return K===null||In(K)?(D.exit("codeFencedFence"),T(K)):I(K)}}}function DUe(i,e,t){const n=this;return s;function s(o){return o===null?t(o):(i.enter("lineEnding"),i.consume(o),i.exit("lineEnding"),r)}function r(o){return n.parser.lazy[n.now().line]?t(o):e(o)}}const aU={name:"codeIndented",tokenize:IUe},TUe={partial:!0,tokenize:AUe};function IUe(i,e,t){const n=this;return s;function s(c){return i.enter("codeIndented"),ds(i,r,"linePrefix",5)(c)}function r(c){const u=n.events[n.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):t(c)}function o(c){return c===null?l(c):In(c)?i.attempt(TUe,o,l)(c):(i.enter("codeFlowValue"),a(c))}function a(c){return c===null||In(c)?(i.exit("codeFlowValue"),o(c)):(i.consume(c),a)}function l(c){return i.exit("codeIndented"),e(c)}}function AUe(i,e,t){const n=this;return s;function s(o){return n.parser.lazy[n.now().line]?t(o):In(o)?(i.enter("lineEnding"),i.consume(o),i.exit("lineEnding"),s):ds(i,r,"linePrefix",5)(o)}function r(o){const a=n.events[n.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):In(o)?s(o):t(o)}}const RUe={name:"codeText",previous:PUe,resolve:MUe,tokenize:OUe};function MUe(i){let e=i.length-4,t=3,n,s;if((i[t][1].type==="lineEnding"||i[t][1].type==="space")&&(i[e][1].type==="lineEnding"||i[e][1].type==="space")){for(n=t;++n=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const s=t||0;this.setCursor(Math.trunc(e));const r=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return n&&xT(this.left,n),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),xT(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),xT(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(o):i.interrupt(n.parser.constructs.flow,t,e)(o)}}function Fke(i,e,t,n,s,r,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return h;function h(_){return _===60?(i.enter(n),i.enter(s),i.enter(r),i.consume(_),i.exit(r),g):_===null||_===32||_===41||kj(_)?t(_):(i.enter(n),i.enter(o),i.enter(a),i.enter("chunkString",{contentType:"string"}),x(_))}function g(_){return _===62?(i.enter(r),i.consume(_),i.exit(r),i.exit(s),i.exit(n),e):(i.enter(a),i.enter("chunkString",{contentType:"string"}),f(_))}function f(_){return _===62?(i.exit("chunkString"),i.exit(a),g(_)):_===null||_===60||In(_)?t(_):(i.consume(_),_===92?m:f)}function m(_){return _===60||_===62||_===92?(i.consume(_),f):f(_)}function x(_){return!u&&(_===null||_===41||Er(_))?(i.exit("chunkString"),i.exit(a),i.exit(o),i.exit(n),e(_)):u999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(f):f===93?(i.exit(r),i.enter(s),i.consume(f),i.exit(s),i.exit(n),e):In(f)?(i.enter("lineEnding"),i.consume(f),i.exit("lineEnding"),u):(i.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||In(f)||a++>999?(i.exit("chunkString"),u(f)):(i.consume(f),l||(l=!Bi(f)),f===92?g:h)}function g(f){return f===91||f===92||f===93?(i.consume(f),a++,h):h(f)}}function Hke(i,e,t,n,s,r){let o;return a;function a(g){return g===34||g===39||g===40?(i.enter(n),i.enter(s),i.consume(g),i.exit(s),o=g===40?41:g,l):t(g)}function l(g){return g===o?(i.enter(s),i.consume(g),i.exit(s),i.exit(n),e):(i.enter(r),c(g))}function c(g){return g===o?(i.exit(r),l(o)):g===null?t(g):In(g)?(i.enter("lineEnding"),i.consume(g),i.exit("lineEnding"),ds(i,c,"linePrefix")):(i.enter("chunkString",{contentType:"string"}),u(g))}function u(g){return g===o||g===null||In(g)?(i.exit("chunkString"),c(g)):(i.consume(g),g===92?h:u)}function h(g){return g===o||g===92?(i.consume(g),u):u(g)}}function B2(i,e){let t;return n;function n(s){return In(s)?(i.enter("lineEnding"),i.consume(s),i.exit("lineEnding"),t=!0,n):Bi(s)?ds(i,n,t?"linePrefix":"lineSuffix")(s):e(s)}}const UUe={name:"definition",tokenize:qUe},$Ue={partial:!0,tokenize:KUe};function qUe(i,e,t){const n=this;let s;return r;function r(f){return i.enter("definition"),o(f)}function o(f){return Bke.call(n,i,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return s=mg(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),f===58?(i.enter("definitionMarker"),i.consume(f),i.exit("definitionMarker"),l):t(f)}function l(f){return Er(f)?B2(i,c)(f):c(f)}function c(f){return Fke(i,u,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return i.attempt($Ue,h,h)(f)}function h(f){return Bi(f)?ds(i,g,"whitespace")(f):g(f)}function g(f){return f===null||In(f)?(i.exit("definition"),n.parser.defined.push(s),e(f)):t(f)}}function KUe(i,e,t){return n;function n(a){return Er(a)?B2(i,s)(a):t(a)}function s(a){return Hke(i,r,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function r(a){return Bi(a)?ds(i,o,"whitespace")(a):o(a)}function o(a){return a===null||In(a)?e(a):t(a)}}const GUe={name:"hardBreakEscape",tokenize:YUe};function YUe(i,e,t){return n;function n(r){return i.enter("hardBreakEscape"),i.consume(r),s}function s(r){return In(r)?(i.exit("hardBreakEscape"),e(r)):t(r)}}const QUe={name:"headingAtx",resolve:XUe,tokenize:ZUe};function XUe(i,e){let t=i.length-2,n=3,s,r;return i[n][1].type==="whitespace"&&(n+=2),t-2>n&&i[t][1].type==="whitespace"&&(t-=2),i[t][1].type==="atxHeadingSequence"&&(n===t-1||t-4>n&&i[t-2][1].type==="whitespace")&&(t-=n+1===t?2:4),t>n&&(s={type:"atxHeadingText",start:i[n][1].start,end:i[t][1].end},r={type:"chunkText",start:i[n][1].start,end:i[t][1].end,contentType:"text"},vu(i,n,t-n+1,[["enter",s,e],["enter",r,e],["exit",r,e],["exit",s,e]])),i}function ZUe(i,e,t){let n=0;return s;function s(u){return i.enter("atxHeading"),r(u)}function r(u){return i.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&n++<6?(i.consume(u),o):u===null||Er(u)?(i.exit("atxHeadingSequence"),a(u)):t(u)}function a(u){return u===35?(i.enter("atxHeadingSequence"),l(u)):u===null||In(u)?(i.exit("atxHeading"),e(u)):Bi(u)?ds(i,a,"whitespace")(u):(i.enter("atxHeadingText"),c(u))}function l(u){return u===35?(i.consume(u),l):(i.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Er(u)?(i.exit("atxHeadingText"),a(u)):(i.consume(u),c)}}const JUe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Cfe=["pre","script","style","textarea"],e$e={concrete:!0,name:"htmlFlow",resolveTo:i$e,tokenize:s$e},t$e={partial:!0,tokenize:o$e},n$e={partial:!0,tokenize:r$e};function i$e(i){let e=i.length;for(;e--&&!(i[e][0]==="enter"&&i[e][1].type==="htmlFlow"););return e>1&&i[e-2][1].type==="linePrefix"&&(i[e][1].start=i[e-2][1].start,i[e+1][1].start=i[e-2][1].start,i.splice(e-2,2)),i}function s$e(i,e,t){const n=this;let s,r,o,a,l;return c;function c(V){return u(V)}function u(V){return i.enter("htmlFlow"),i.enter("htmlFlowData"),i.consume(V),h}function h(V){return V===33?(i.consume(V),g):V===47?(i.consume(V),r=!0,x):V===63?(i.consume(V),s=3,n.interrupt?e:H):kc(V)?(i.consume(V),o=String.fromCharCode(V),v):t(V)}function g(V){return V===45?(i.consume(V),s=2,f):V===91?(i.consume(V),s=5,a=0,m):kc(V)?(i.consume(V),s=4,n.interrupt?e:H):t(V)}function f(V){return V===45?(i.consume(V),n.interrupt?e:H):t(V)}function m(V){const ue="CDATA[";return V===ue.charCodeAt(a++)?(i.consume(V),a===ue.length?n.interrupt?e:B:m):t(V)}function x(V){return kc(V)?(i.consume(V),o=String.fromCharCode(V),v):t(V)}function v(V){if(V===null||V===47||V===62||Er(V)){const ue=V===47,he=o.toLowerCase();return!ue&&!r&&Cfe.includes(he)?(s=1,n.interrupt?e(V):B(V)):JUe.includes(o.toLowerCase())?(s=6,ue?(i.consume(V),_):n.interrupt?e(V):B(V)):(s=7,n.interrupt&&!n.parser.lazy[n.now().line]?t(V):r?w(V):k(V))}return V===45||Gl(V)?(i.consume(V),o+=String.fromCharCode(V),v):t(V)}function _(V){return V===62?(i.consume(V),n.interrupt?e:B):t(V)}function w(V){return Bi(V)?(i.consume(V),w):P(V)}function k(V){return V===47?(i.consume(V),P):V===58||V===95||kc(V)?(i.consume(V),C):Bi(V)?(i.consume(V),k):P(V)}function C(V){return V===45||V===46||V===58||V===95||Gl(V)?(i.consume(V),C):E(V)}function E(V){return V===61?(i.consume(V),D):Bi(V)?(i.consume(V),E):k(V)}function D(V){return V===null||V===60||V===61||V===62||V===96?t(V):V===34||V===39?(i.consume(V),l=V,T):Bi(V)?(i.consume(V),D):I(V)}function T(V){return V===l?(i.consume(V),l=null,R):V===null||In(V)?t(V):(i.consume(V),T)}function I(V){return V===null||V===34||V===39||V===47||V===60||V===61||V===62||V===96||Er(V)?E(V):(i.consume(V),I)}function R(V){return V===47||V===62||Bi(V)?k(V):t(V)}function P(V){return V===62?(i.consume(V),j):t(V)}function j(V){return V===null||In(V)?B(V):Bi(V)?(i.consume(V),j):t(V)}function B(V){return V===45&&s===2?(i.consume(V),z):V===60&&s===1?(i.consume(V),G):V===62&&s===4?(i.consume(V),Q):V===63&&s===3?(i.consume(V),H):V===93&&s===5?(i.consume(V),te):In(V)&&(s===6||s===7)?(i.exit("htmlFlowData"),i.check(t$e,Y,U)(V)):V===null||In(V)?(i.exit("htmlFlowData"),U(V)):(i.consume(V),B)}function U(V){return i.check(n$e,$,Y)(V)}function $(V){return i.enter("lineEnding"),i.consume(V),i.exit("lineEnding"),K}function K(V){return V===null||In(V)?U(V):(i.enter("htmlFlowData"),B(V))}function z(V){return V===45?(i.consume(V),H):B(V)}function G(V){return V===47?(i.consume(V),o="",ne):B(V)}function ne(V){if(V===62){const ue=o.toLowerCase();return Cfe.includes(ue)?(i.consume(V),Q):B(V)}return kc(V)&&o.length<8?(i.consume(V),o+=String.fromCharCode(V),ne):B(V)}function te(V){return V===93?(i.consume(V),H):B(V)}function H(V){return V===62?(i.consume(V),Q):V===45&&s===2?(i.consume(V),H):B(V)}function Q(V){return V===null||In(V)?(i.exit("htmlFlowData"),Y(V)):(i.consume(V),Q)}function Y(V){return i.exit("htmlFlow"),e(V)}}function r$e(i,e,t){const n=this;return s;function s(o){return In(o)?(i.enter("lineEnding"),i.consume(o),i.exit("lineEnding"),r):t(o)}function r(o){return n.parser.lazy[n.now().line]?t(o):e(o)}}function o$e(i,e,t){return n;function n(s){return i.enter("lineEnding"),i.consume(s),i.exit("lineEnding"),i.attempt(VM,e,t)}}const a$e={name:"htmlText",tokenize:l$e};function l$e(i,e,t){const n=this;let s,r,o;return a;function a(H){return i.enter("htmlText"),i.enter("htmlTextData"),i.consume(H),l}function l(H){return H===33?(i.consume(H),c):H===47?(i.consume(H),E):H===63?(i.consume(H),k):kc(H)?(i.consume(H),I):t(H)}function c(H){return H===45?(i.consume(H),u):H===91?(i.consume(H),r=0,m):kc(H)?(i.consume(H),w):t(H)}function u(H){return H===45?(i.consume(H),f):t(H)}function h(H){return H===null?t(H):H===45?(i.consume(H),g):In(H)?(o=h,G(H)):(i.consume(H),h)}function g(H){return H===45?(i.consume(H),f):h(H)}function f(H){return H===62?z(H):H===45?g(H):h(H)}function m(H){const Q="CDATA[";return H===Q.charCodeAt(r++)?(i.consume(H),r===Q.length?x:m):t(H)}function x(H){return H===null?t(H):H===93?(i.consume(H),v):In(H)?(o=x,G(H)):(i.consume(H),x)}function v(H){return H===93?(i.consume(H),_):x(H)}function _(H){return H===62?z(H):H===93?(i.consume(H),_):x(H)}function w(H){return H===null||H===62?z(H):In(H)?(o=w,G(H)):(i.consume(H),w)}function k(H){return H===null?t(H):H===63?(i.consume(H),C):In(H)?(o=k,G(H)):(i.consume(H),k)}function C(H){return H===62?z(H):k(H)}function E(H){return kc(H)?(i.consume(H),D):t(H)}function D(H){return H===45||Gl(H)?(i.consume(H),D):T(H)}function T(H){return In(H)?(o=T,G(H)):Bi(H)?(i.consume(H),T):z(H)}function I(H){return H===45||Gl(H)?(i.consume(H),I):H===47||H===62||Er(H)?R(H):t(H)}function R(H){return H===47?(i.consume(H),z):H===58||H===95||kc(H)?(i.consume(H),P):In(H)?(o=R,G(H)):Bi(H)?(i.consume(H),R):z(H)}function P(H){return H===45||H===46||H===58||H===95||Gl(H)?(i.consume(H),P):j(H)}function j(H){return H===61?(i.consume(H),B):In(H)?(o=j,G(H)):Bi(H)?(i.consume(H),j):R(H)}function B(H){return H===null||H===60||H===61||H===62||H===96?t(H):H===34||H===39?(i.consume(H),s=H,U):In(H)?(o=B,G(H)):Bi(H)?(i.consume(H),B):(i.consume(H),$)}function U(H){return H===s?(i.consume(H),s=void 0,K):H===null?t(H):In(H)?(o=U,G(H)):(i.consume(H),U)}function $(H){return H===null||H===34||H===39||H===60||H===61||H===96?t(H):H===47||H===62||Er(H)?R(H):(i.consume(H),$)}function K(H){return H===47||H===62||Er(H)?R(H):t(H)}function z(H){return H===62?(i.consume(H),i.exit("htmlTextData"),i.exit("htmlText"),e):t(H)}function G(H){return i.exit("htmlTextData"),i.enter("lineEnding"),i.consume(H),i.exit("lineEnding"),ne}function ne(H){return Bi(H)?ds(i,te,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):te(H)}function te(H){return i.enter("htmlTextData"),o(H)}}const dse={name:"labelEnd",resolveAll:h$e,resolveTo:g$e,tokenize:f$e},c$e={tokenize:p$e},d$e={tokenize:m$e},u$e={tokenize:b$e};function h$e(i){let e=-1;const t=[];for(;++e=3&&(c===null||In(c))?(i.exit("thematicBreak"),e(c)):t(c)}function l(c){return c===s?(i.consume(c),n++,l):(i.exit("thematicBreakSequence"),Bi(c)?ds(i,a,"whitespace")(c):a(c))}}const nd={continuation:{tokenize:E$e},exit:D$e,name:"list",tokenize:N$e},S$e={partial:!0,tokenize:T$e},k$e={partial:!0,tokenize:L$e};function N$e(i,e,t){const n=this,s=n.events[n.events.length-1];let r=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return a;function a(f){const m=n.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||f===n.containerState.marker:wG(f)){if(n.containerState.type||(n.containerState.type=m,i.enter(m,{_container:!0})),m==="listUnordered")return i.enter("listItemPrefix"),f===42||f===45?i.check(v4,t,c)(f):c(f);if(!n.interrupt||f===49)return i.enter("listItemPrefix"),i.enter("listItemValue"),l(f)}return t(f)}function l(f){return wG(f)&&++o<10?(i.consume(f),l):(!n.interrupt||o<2)&&(n.containerState.marker?f===n.containerState.marker:f===41||f===46)?(i.exit("listItemValue"),c(f)):t(f)}function c(f){return i.enter("listItemMarker"),i.consume(f),i.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||f,i.check(VM,n.interrupt?t:u,i.attempt(S$e,g,h))}function u(f){return n.containerState.initialBlankLine=!0,r++,g(f)}function h(f){return Bi(f)?(i.enter("listItemPrefixWhitespace"),i.consume(f),i.exit("listItemPrefixWhitespace"),g):t(f)}function g(f){return n.containerState.size=r+n.sliceSerialize(i.exit("listItemPrefix"),!0).length,e(f)}}function E$e(i,e,t){const n=this;return n.containerState._closeFlow=void 0,i.check(VM,s,r);function s(a){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ds(i,e,"listItemIndent",n.containerState.size+1)(a)}function r(a){return n.containerState.furtherBlankLines||!Bi(a)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,o(a)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,i.attempt(k$e,e,o)(a))}function o(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,ds(i,i.attempt(nd,e,t),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function L$e(i,e,t){const n=this;return ds(i,s,"listItemIndent",n.containerState.size+1);function s(r){const o=n.events[n.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===n.containerState.size?e(r):t(r)}}function D$e(i){i.exit(this.containerState.type)}function T$e(i,e,t){const n=this;return ds(i,s,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(r){const o=n.events[n.events.length-1];return!Bi(r)&&o&&o[1].type==="listItemPrefixWhitespace"?e(r):t(r)}}const Sfe={name:"setextUnderline",resolveTo:I$e,tokenize:A$e};function I$e(i,e){let t=i.length,n,s,r;for(;t--;)if(i[t][0]==="enter"){if(i[t][1].type==="content"){n=t;break}i[t][1].type==="paragraph"&&(s=t)}else i[t][1].type==="content"&&i.splice(t,1),!r&&i[t][1].type==="definition"&&(r=t);const o={type:"setextHeading",start:{...i[n][1].start},end:{...i[i.length-1][1].end}};return i[s][1].type="setextHeadingText",r?(i.splice(s,0,["enter",o,e]),i.splice(r+1,0,["exit",i[n][1],e]),i[n][1].end={...i[r][1].end}):i[n][1]=o,i.push(["exit",o,e]),i}function A$e(i,e,t){const n=this;let s;return r;function r(c){let u=n.events.length,h;for(;u--;)if(n.events[u][1].type!=="lineEnding"&&n.events[u][1].type!=="linePrefix"&&n.events[u][1].type!=="content"){h=n.events[u][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||h)?(i.enter("setextHeadingLine"),s=c,o(c)):t(c)}function o(c){return i.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===s?(i.consume(c),a):(i.exit("setextHeadingLineSequence"),Bi(c)?ds(i,l,"lineSuffix")(c):l(c))}function l(c){return c===null||In(c)?(i.exit("setextHeadingLine"),e(c)):t(c)}}const R$e={tokenize:M$e};function M$e(i){const e=this,t=i.attempt(VM,n,i.attempt(this.parser.constructs.flowInitial,s,ds(i,i.attempt(this.parser.constructs.flow,s,i.attempt(BUe,s)),"linePrefix")));return t;function n(r){if(r===null){i.consume(r);return}return i.enter("lineEndingBlank"),i.consume(r),i.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function s(r){if(r===null){i.consume(r);return}return i.enter("lineEnding"),i.consume(r),i.exit("lineEnding"),e.currentConstruct=void 0,t}}const P$e={resolveAll:Vke()},O$e=Wke("string"),j$e=Wke("text");function Wke(i){return{resolveAll:Vke(i==="text"?F$e:void 0),tokenize:e};function e(t){const n=this,s=this.parser.constructs[i],r=t.attempt(s,o,a);return o;function o(u){return c(u)?r(u):a(u)}function a(u){if(u===null){t.consume(u);return}return t.enter("data"),t.consume(u),l}function l(u){return c(u)?(t.exit("data"),r(u)):(t.consume(u),l)}function c(u){if(u===null)return!0;const h=s[u];let g=-1;if(h)for(;++g-1){const a=o[0];typeof a=="string"?o[0]=a.slice(n):o.shift()}r>0&&o.push(i[s].slice(0,r))}return o}function X$e(i,e){let t=-1;const n=[];let s;for(;++t0){const vs=tn.tokenStack[tn.tokenStack.length-1];(vs[1]||Nfe).call(tn,void 0,vs[0])}for(mt.position={start:Ex(Ge.length>0?Ge[0][1].start:{line:1,column:1,offset:0}),end:Ex(Ge.length>0?Ge[Ge.length-2][1].end:{line:1,column:1,offset:0})},Un=-1;++Un0&&(n.className=["language-"+s[0]]);let r={type:"element",tagName:"code",properties:n,children:[{type:"text",value:t}]};return e.meta&&(r.data={meta:e.meta}),i.patch(e,r),r=i.applyData(e,r),r={type:"element",tagName:"pre",properties:{},children:[r]},i.patch(e,r),r}function uqe(i,e){const t={type:"element",tagName:"del",properties:{},children:i.all(e)};return i.patch(e,t),i.applyData(e,t)}function hqe(i,e){const t={type:"element",tagName:"em",properties:{},children:i.all(e)};return i.patch(e,t),i.applyData(e,t)}function gqe(i,e){const t=typeof i.options.clobberPrefix=="string"?i.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),s=FL(n.toLowerCase()),r=i.footnoteOrder.indexOf(n);let o,a=i.footnoteCounts.get(n);a===void 0?(a=0,i.footnoteOrder.push(n),o=i.footnoteOrder.length):o=r+1,a+=1,i.footnoteCounts.set(n,a);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};i.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return i.patch(e,c),i.applyData(e,c)}function fqe(i,e){const t={type:"element",tagName:"h"+e.depth,properties:{},children:i.all(e)};return i.patch(e,t),i.applyData(e,t)}function pqe(i,e){if(i.options.allowDangerousHtml){const t={type:"raw",value:e.value};return i.patch(e,t),i.applyData(e,t)}}function $ke(i,e){const t=e.referenceType;let n="]";if(t==="collapsed"?n+="[]":t==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+n}];const s=i.all(e),r=s[0];r&&r.type==="text"?r.value="["+r.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=n:s.push({type:"text",value:n}),s}function mqe(i,e){const t=String(e.identifier).toUpperCase(),n=i.definitionById.get(t);if(!n)return $ke(i,e);const s={src:FL(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(s.title=n.title);const r={type:"element",tagName:"img",properties:s,children:[]};return i.patch(e,r),i.applyData(e,r)}function bqe(i,e){const t={src:FL(e.url)};e.alt!==null&&e.alt!==void 0&&(t.alt=e.alt),e.title!==null&&e.title!==void 0&&(t.title=e.title);const n={type:"element",tagName:"img",properties:t,children:[]};return i.patch(e,n),i.applyData(e,n)}function xqe(i,e){const t={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};i.patch(e,t);const n={type:"element",tagName:"code",properties:{},children:[t]};return i.patch(e,n),i.applyData(e,n)}function vqe(i,e){const t=String(e.identifier).toUpperCase(),n=i.definitionById.get(t);if(!n)return $ke(i,e);const s={href:FL(n.url||"")};n.title!==null&&n.title!==void 0&&(s.title=n.title);const r={type:"element",tagName:"a",properties:s,children:i.all(e)};return i.patch(e,r),i.applyData(e,r)}function _qe(i,e){const t={href:FL(e.url)};e.title!==null&&e.title!==void 0&&(t.title=e.title);const n={type:"element",tagName:"a",properties:t,children:i.all(e)};return i.patch(e,n),i.applyData(e,n)}function yqe(i,e,t){const n=i.all(e),s=t?wqe(t):qke(e),r={},o=[];if(typeof e.checked=="boolean"){const u=n[0];let h;u&&u.type==="element"&&u.tagName==="p"?h=u:(h={type:"element",tagName:"p",properties:{},children:[]},n.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),r.className=["task-list-item"]}let a=-1;for(;++a1}function Cqe(i,e){const t={},n=i.all(e);let s=-1;for(typeof e.start=="number"&&e.start!==1&&(t.start=e.start);++s0){const o={type:"element",tagName:"tbody",properties:{},children:i.wrap(t,!0)},a=vp(e.children[1]),l=b7(e.children[e.children.length-1]);a&&l&&(o.position={start:a,end:l}),s.push(o)}const r={type:"element",tagName:"table",properties:{},children:i.wrap(s,!0)};return i.patch(e,r),i.applyData(e,r)}function Lqe(i,e,t){const n=t?t.children:void 0,r=(n?n.indexOf(e):1)===0?"th":"td",o=t&&t.type==="table"?t.align:void 0,a=o?o.length:e.children.length;let l=-1;const c=[];for(;++l0,!0),n[0]),s=n.index+n[0].length,n=t.exec(e);return r.push(Dfe(e.slice(s),s>0,!1)),r.join("")}function Dfe(i,e,t){let n=0,s=i.length;if(e){let r=i.codePointAt(n);for(;r===Efe||r===Lfe;)n++,r=i.codePointAt(n)}if(t){let r=i.codePointAt(s-1);for(;r===Efe||r===Lfe;)s--,r=i.codePointAt(s-1)}return s>n?i.slice(n,s):""}function Iqe(i,e){const t={type:"text",value:Tqe(String(e.value))};return i.patch(e,t),i.applyData(e,t)}function Aqe(i,e){const t={type:"element",tagName:"hr",properties:{},children:[]};return i.patch(e,t),i.applyData(e,t)}const Rqe={blockquote:lqe,break:cqe,code:dqe,delete:uqe,emphasis:hqe,footnoteReference:gqe,heading:fqe,html:pqe,imageReference:mqe,image:bqe,inlineCode:xqe,linkReference:vqe,link:_qe,listItem:yqe,list:Cqe,paragraph:Sqe,root:kqe,strong:Nqe,table:Eqe,tableCell:Dqe,tableRow:Lqe,text:Iqe,thematicBreak:Aqe,toml:f5,yaml:f5,definition:f5,footnoteDefinition:f5};function f5(){}const Kke=-1,_7=0,H2=1,Nj=2,use=3,hse=4,gse=5,fse=6,Gke=7,Yke=8,Tfe=typeof self=="object"?self:globalThis,Mqe=(i,e)=>{const t=(s,r)=>(i.set(r,s),s),n=s=>{if(i.has(s))return i.get(s);const[r,o]=e[s];switch(r){case _7:case Kke:return t(o,s);case H2:{const a=t([],s);for(const l of o)a.push(n(l));return a}case Nj:{const a=t({},s);for(const[l,c]of o)a[n(l)]=n(c);return a}case use:return t(new Date(o),s);case hse:{const{source:a,flags:l}=o;return t(new RegExp(a,l),s)}case gse:{const a=t(new Map,s);for(const[l,c]of o)a.set(n(l),n(c));return a}case fse:{const a=t(new Set,s);for(const l of o)a.add(n(l));return a}case Gke:{const{name:a,message:l}=o;return t(new Tfe[a](l),s)}case Yke:return t(BigInt(o),s);case"BigInt":return t(Object(BigInt(o)),s);case"ArrayBuffer":return t(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return t(new DataView(a),o)}}return t(new Tfe[r](o),s)};return n},Ife=i=>Mqe(new Map,i)(0),DS="",{toString:Pqe}={},{keys:Oqe}=Object,vT=i=>{const e=typeof i;if(e!=="object"||!i)return[_7,e];const t=Pqe.call(i).slice(8,-1);switch(t){case"Array":return[H2,DS];case"Object":return[Nj,DS];case"Date":return[use,DS];case"RegExp":return[hse,DS];case"Map":return[gse,DS];case"Set":return[fse,DS];case"DataView":return[H2,t]}return t.includes("Array")?[H2,t]:t.includes("Error")?[Gke,t]:[Nj,t]},p5=([i,e])=>i===_7&&(e==="function"||e==="symbol"),jqe=(i,e,t,n)=>{const s=(o,a)=>{const l=n.push(o)-1;return t.set(a,l),l},r=o=>{if(t.has(o))return t.get(o);let[a,l]=vT(o);switch(a){case _7:{let u=o;switch(l){case"bigint":a=Yke,u=o.toString();break;case"function":case"symbol":if(i)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return s([Kke],o)}return s([a,u],o)}case H2:{if(l){let g=o;return l==="DataView"?g=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(g=new Uint8Array(o)),s([l,[...g]],o)}const u=[],h=s([a,u],o);for(const g of o)u.push(r(g));return h}case Nj:{if(l)switch(l){case"BigInt":return s([l,o.toString()],o);case"Boolean":case"Number":case"String":return s([l,o.valueOf()],o)}if(e&&"toJSON"in o)return r(o.toJSON());const u=[],h=s([a,u],o);for(const g of Oqe(o))(i||!p5(vT(o[g])))&&u.push([r(g),r(o[g])]);return h}case use:return s([a,o.toISOString()],o);case hse:{const{source:u,flags:h}=o;return s([a,{source:u,flags:h}],o)}case gse:{const u=[],h=s([a,u],o);for(const[g,f]of o)(i||!(p5(vT(g))||p5(vT(f))))&&u.push([r(g),r(f)]);return h}case fse:{const u=[],h=s([a,u],o);for(const g of o)(i||!p5(vT(g)))&&u.push(r(g));return h}}const{message:c}=o;return s([a,{name:l,message:c}],o)};return r},Afe=(i,{json:e,lossy:t}={})=>{const n=[];return jqe(!(e||t),!!e,new Map,n)(i),n},BE=typeof structuredClone=="function"?(i,e)=>e&&("json"in e||"lossy"in e)?Ife(Afe(i,e)):structuredClone(i):(i,e)=>Ife(Afe(i,e));function Fqe(i,e){const t=[{type:"text",value:"↩"}];return e>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),t}function Bqe(i,e){return"Back to reference "+(i+1)+(e>1?"-"+e:"")}function Hqe(i){const e=typeof i.options.clobberPrefix=="string"?i.options.clobberPrefix:"user-content-",t=i.options.footnoteBackContent||Fqe,n=i.options.footnoteBackLabel||Bqe,s=i.options.footnoteLabel||"Footnotes",r=i.options.footnoteLabelTagName||"h2",o=i.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l0&&m.push({type:"text",value:" "});let w=typeof t=="string"?t:t(l,f);typeof w=="string"&&(w={type:"text",value:w}),m.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+g+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(l,f),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else u.push(...m);const _={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:i.wrap(u,!0)};i.patch(c,_),a.push(_)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:r,properties:{...BE(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
-`},{type:"element",tagName:"ol",properties:{},children:i.wrap(a,!0)},{type:"text",value:`
-`}]}}const y7=(function(i){if(i==null)return Uqe;if(typeof i=="function")return w7(i);if(typeof i=="object")return Array.isArray(i)?Wqe(i):Vqe(i);if(typeof i=="string")return zqe(i);throw new Error("Expected function, string, or object as test")});function Wqe(i){const e=[];let t=-1;for(;++t":""))+")"})}return g;function g(){let f=Qke,m,x,v;if((!e||r(l,c,u[u.length-1]||void 0))&&(f=Gqe(t(l,u)),f[0]===SG))return f;if("children"in l&&l.children){const _=l;if(_.children&&f[0]!==Kqe)for(x=(n?_.children.length:-1)+o,v=u.concat(_);x>-1&&x<_.children.length;){const w=_.children[x];if(m=a(w,x,v)(),m[0]===SG)return m;x=typeof m[1]=="number"?m[1]:x+o}}return f}}}function Gqe(i){return Array.isArray(i)?i:typeof i=="number"?[qqe,i]:i==null?Qke:[i]}function C7(i,e,t,n){let s,r,o;typeof e=="function"&&typeof t!="function"?(r=void 0,o=e,s=t):(r=e,o=t,s=n),Xke(i,r,a,s);function a(l,c){const u=c[c.length-1],h=u?u.children.indexOf(l):void 0;return o(l,h,u)}}const kG={}.hasOwnProperty,Yqe={};function Qqe(i,e){const t=e||Yqe,n=new Map,s=new Map,r=new Map,o={...Rqe,...t.handlers},a={all:c,applyData:Zqe,definitionById:n,footnoteById:s,footnoteCounts:r,footnoteOrder:[],handlers:o,one:l,options:t,patch:Xqe,wrap:eKe};return C7(i,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const h=u.type==="definition"?n:s,g=String(u.identifier).toUpperCase();h.has(g)||h.set(g,u)}}),a;function l(u,h){const g=u.type,f=a.handlers[g];if(kG.call(a.handlers,g)&&f)return f(a,u,h);if(a.options.passThrough&&a.options.passThrough.includes(g)){if("children"in u){const{children:x,...v}=u,_=BE(v);return _.children=a.all(u),_}return BE(u)}return(a.options.unknownHandler||Jqe)(a,u,h)}function c(u){const h=[];if("children"in u){const g=u.children;let f=-1;for(;++f0&&t.push({type:"text",value:`
-`}),t}function Rfe(i){let e=0,t=i.charCodeAt(e);for(;t===9||t===32;)e++,t=i.charCodeAt(e);return i.slice(e)}function Mfe(i,e){const t=Qqe(i,e),n=t.one(i,void 0),s=Hqe(t),r=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return s&&r.children.push({type:"text",value:`
-`},s),r}function tKe(i,e){return i&&"run"in i?async function(t,n){const s=Mfe(t,{file:n,...e});await i.run(s,n)}:function(t,n){return Mfe(t,{file:n,...i||e})}}function Pfe(i){if(i)throw i}var cU,Ofe;function nKe(){if(Ofe)return cU;Ofe=1;var i=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=function(c){return typeof Array.isArray=="function"?Array.isArray(c):e.call(c)==="[object Array]"},r=function(c){if(!c||e.call(c)!=="[object Object]")return!1;var u=i.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&i.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!h)return!1;var g;for(g in c);return typeof g>"u"||i.call(c,g)},o=function(c,u){t&&u.name==="__proto__"?t(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(i.call(c,u)){if(n)return n(c,u).value}else return;return c[u]};return cU=function l(){var c,u,h,g,f,m,x=arguments[0],v=1,_=arguments.length,w=!1;for(typeof x=="boolean"&&(w=x,x=arguments[1]||{},v=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});v<_;++v)if(c=arguments[v],c!=null)for(u in c)h=a(x,u),g=a(c,u),x!==g&&(w&&g&&(r(g)||(f=s(g)))?(f?(f=!1,m=h&&s(h)?h:[]):m=h&&r(h)?h:{},o(x,{name:u,newValue:l(w,m,g)})):typeof g<"u"&&o(x,{name:u,newValue:g}));return x},cU}var iKe=nKe();const dU=t7(iKe);function NG(i){if(typeof i!="object"||i===null)return!1;const e=Object.getPrototypeOf(i);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)}function sKe(){const i=[],e={run:t,use:n};return e;function t(...s){let r=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...s);function a(l,...c){const u=i[++r];let h=-1;if(l){o(l);return}for(;++ho.length;let l;a&&o.push(s);try{l=i.apply(this,o)}catch(c){const u=c;if(a&&t)throw u;return s(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(r,s):l instanceof Error?s(l):r(l))}function s(o,...a){t||(t=!0,e(o,...a))}function r(o){s(null,o)}}const af={basename:oKe,dirname:aKe,extname:lKe,join:cKe,sep:"/"};function oKe(i,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');zM(i);let t=0,n=-1,s=i.length,r;if(e===void 0||e.length===0||e.length>i.length){for(;s--;)if(i.codePointAt(s)===47){if(r){t=s+1;break}}else n<0&&(r=!0,n=s+1);return n<0?"":i.slice(t,n)}if(e===i)return"";let o=-1,a=e.length-1;for(;s--;)if(i.codePointAt(s)===47){if(r){t=s+1;break}}else o<0&&(r=!0,o=s+1),a>-1&&(i.codePointAt(s)===e.codePointAt(a--)?a<0&&(n=s):(a=-1,n=o));return t===n?n=o:n<0&&(n=i.length),i.slice(t,n)}function aKe(i){if(zM(i),i.length===0)return".";let e=-1,t=i.length,n;for(;--t;)if(i.codePointAt(t)===47){if(n){e=t;break}}else n||(n=!0);return e<0?i.codePointAt(0)===47?"/":".":e===1&&i.codePointAt(0)===47?"//":i.slice(0,e)}function lKe(i){zM(i);let e=i.length,t=-1,n=0,s=-1,r=0,o;for(;e--;){const a=i.codePointAt(e);if(a===47){if(o){n=e+1;break}continue}t<0&&(o=!0,t=e+1),a===46?s<0?s=e:r!==1&&(r=1):s>-1&&(r=-1)}return s<0||t<0||r===0||r===1&&s===t-1&&s===n+1?"":i.slice(s,t)}function cKe(...i){let e=-1,t;for(;++e0&&i.codePointAt(i.length-1)===47&&(t+="/"),e?"/"+t:t}function uKe(i,e){let t="",n=0,s=-1,r=0,o=-1,a,l;for(;++o<=i.length;){if(o2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",n=0):(t=t.slice(0,l),n=t.length-1-t.lastIndexOf("/")),s=o,r=0;continue}}else if(t.length>0){t="",n=0,s=o,r=0;continue}}e&&(t=t.length>0?t+"/..":"..",n=2)}else t.length>0?t+="/"+i.slice(s+1,o):t=i.slice(s+1,o),n=o-s-1;s=o,r=0}else a===46&&r>-1?r++:r=-1}return t}function zM(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}const hKe={cwd:gKe};function gKe(){return"/"}function EG(i){return!!(i!==null&&typeof i=="object"&&"href"in i&&i.href&&"protocol"in i&&i.protocol&&i.auth===void 0)}function fKe(i){if(typeof i=="string")i=new URL(i);else if(!EG(i)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+i+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(i.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return pKe(i)}function pKe(i){if(i.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=i.pathname;let t=-1;for(;++t0){let[f,...m]=u;const x=n[g][1];NG(x)&&NG(f)&&(f=dU(!0,x,f)),n[g]=[c,f,...m]}}}}const vKe=new pse().freeze();function fU(i,e){if(typeof e!="function")throw new TypeError("Cannot `"+i+"` without `parser`")}function pU(i,e){if(typeof e!="function")throw new TypeError("Cannot `"+i+"` without `compiler`")}function mU(i,e){if(e)throw new Error("Cannot call `"+i+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ffe(i){if(!NG(i)||typeof i.type!="string")throw new TypeError("Expected node, got `"+i+"`")}function Bfe(i,e,t){if(!t)throw new Error("`"+i+"` finished async. Use `"+e+"` instead")}function m5(i){return _Ke(i)?i:new Zke(i)}function _Ke(i){return!!(i&&typeof i=="object"&&"message"in i&&"messages"in i)}function yKe(i){return typeof i=="string"||wKe(i)}function wKe(i){return!!(i&&typeof i=="object"&&"byteLength"in i&&"byteOffset"in i)}const CKe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Hfe=[],Wfe={allowDangerousHtml:!0},SKe=/^(https?|ircs?|mailto|xmpp)$/i,kKe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function mse(i){const e=NKe(i),t=EKe(i);return LKe(e.runSync(e.parse(t),t),i)}function NKe(i){const e=i.rehypePlugins||Hfe,t=i.remarkPlugins||Hfe,n=i.remarkRehypeOptions?{...i.remarkRehypeOptions,...Wfe}:Wfe;return vKe().use(aqe).use(t).use(tKe,n).use(e)}function EKe(i){const e=i.children||"",t=new Zke;return typeof e=="string"&&(t.value=e),t}function LKe(i,e){const t=e.allowedElements,n=e.allowElement,s=e.components,r=e.disallowedElements,o=e.skipHtml,a=e.unwrapDisallowed,l=e.urlTransform||DKe;for(const u of kKe)Object.hasOwn(e,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+CKe+u.id,void 0);return e.className&&(i={type:"element",tagName:"div",properties:{className:e.className},children:i.type==="root"?i.children:[i]}),C7(i,c),Uze(i,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(u,h,g){if(u.type==="raw"&&g&&typeof h=="number")return o?g.children.splice(h,1):g.children[h]={type:"text",value:u.value},h;if(u.type==="element"){let f;for(f in oU)if(Object.hasOwn(oU,f)&&Object.hasOwn(u.properties,f)){const m=u.properties[f],x=oU[f];(x===null||x.includes(u.tagName))&&(u.properties[f]=l(String(m||""),f,u))}}if(u.type==="element"){let f=t?!t.includes(u.tagName):r?r.includes(u.tagName):!1;if(!f&&n&&typeof h=="number"&&(f=!n(u,h,g)),f&&g&&typeof h=="number")return a&&u.children?g.children.splice(h,1,...u.children):g.children.splice(h,1),h}}}function DKe(i){const e=i.indexOf(":"),t=i.indexOf("?"),n=i.indexOf("#"),s=i.indexOf("/");return e===-1||s!==-1&&e>s||t!==-1&&e>t||n!==-1&&e>n||SKe.test(i.slice(0,e))?i:""}function Vfe(i,e){const t=String(i);if(typeof e!="string")throw new TypeError("Expected character");let n=0,s=t.indexOf(e);for(;s!==-1;)n++,s=t.indexOf(e,s+e.length);return n}function TKe(i){if(typeof i!="string")throw new TypeError("Expected a string");return i.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function IKe(i,e,t){const s=y7((t||{}).ignore||[]),r=AKe(e);let o=-1;for(;++o0?{type:"text",value:D}:void 0),D===!1?g.lastIndex=C+1:(m!==C&&w.push({type:"text",value:c.value.slice(m,C)}),Array.isArray(D)?w.push(...D):D&&w.push(D),m=C+k[0].length,_=!0),!g.global)break;k=g.exec(c.value)}return _?(m?\]}]+$/.exec(i);if(!e)return[i,void 0];i=i.slice(0,e.index);let t=e[0],n=t.indexOf(")");const s=Vfe(i,"(");let r=Vfe(i,")");for(;n!==-1&&s>r;)i+=t.slice(0,n+1),t=t.slice(n+1),n=t.indexOf(")"),r++;return[i,t]}function Jke(i,e){const t=i.input.charCodeAt(i.index-1);return(i.index===0||Aw(t)||x7(t))&&(!e||t!==47)}eNe.peek=tGe;function KKe(){this.buffer()}function GKe(i){this.enter({type:"footnoteReference",identifier:"",label:""},i)}function YKe(){this.buffer()}function QKe(i){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},i)}function XKe(i){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=mg(this.sliceSerialize(i)).toLowerCase(),t.label=e}function ZKe(i){this.exit(i)}function JKe(i){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=mg(this.sliceSerialize(i)).toLowerCase(),t.label=e}function eGe(i){this.exit(i)}function tGe(){return"["}function eNe(i,e,t,n){const s=t.createTracker(n);let r=s.move("[^");const o=t.enter("footnoteReference"),a=t.enter("reference");return r+=s.move(t.safe(t.associationId(i),{after:"]",before:r})),a(),o(),r+=s.move("]"),r}function nGe(){return{enter:{gfmFootnoteCallString:KKe,gfmFootnoteCall:GKe,gfmFootnoteDefinitionLabelString:YKe,gfmFootnoteDefinition:QKe},exit:{gfmFootnoteCallString:XKe,gfmFootnoteCall:ZKe,gfmFootnoteDefinitionLabelString:JKe,gfmFootnoteDefinition:eGe}}}function iGe(i){let e=!1;return i&&i.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:t,footnoteReference:eNe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(n,s,r,o){const a=r.createTracker(o);let l=a.move("[^");const c=r.enter("footnoteDefinition"),u=r.enter("label");return l+=a.move(r.safe(r.associationId(n),{before:l,after:"]"})),u(),l+=a.move("]:"),n.children&&n.children.length>0&&(a.shift(4),l+=a.move((e?`
-`:" ")+r.indentLines(r.containerFlow(n,a.current()),e?tNe:sGe))),c(),l}}function sGe(i,e,t){return e===0?i:tNe(i,e,t)}function tNe(i,e,t){return(t?"":" ")+i}const rGe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];nNe.peek=dGe;function oGe(){return{canContainEols:["delete"],enter:{strikethrough:lGe},exit:{strikethrough:cGe}}}function aGe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:rGe}],handlers:{delete:nNe}}}function lGe(i){this.enter({type:"delete",children:[]},i)}function cGe(i){this.exit(i)}function nNe(i,e,t,n){const s=t.createTracker(n),r=t.enter("strikethrough");let o=s.move("~~");return o+=t.containerPhrasing(i,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),r(),o}function dGe(){return"~"}function uGe(i){return i.length}function hGe(i,e){const t=e||{},n=(t.align||[]).concat(),s=t.stringLength||uGe,r=[],o=[],a=[],l=[];let c=0,u=-1;for(;++uc&&(c=i[u].length);++_l[_])&&(l[_]=k)}x.push(w)}o[u]=x,a[u]=v}let h=-1;if(typeof n=="object"&&"length"in n)for(;++hl[h]&&(l[h]=w),f[h]=w),g[h]=k}o.splice(1,0,g),a.splice(1,0,f),u=-1;const m=[];for(;++u "),r.shift(2);const o=t.indentLines(t.containerFlow(i,r.current()),pGe);return s(),o}function pGe(i,e,t){return">"+(t?"":" ")+i}function mGe(i,e){return $fe(i,e.inConstruct,!0)&&!$fe(i,e.notInConstruct,!1)}function $fe(i,e,t){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return t;let n=-1;for(;++no&&(o=r):r=1,s=n+e.length,n=t.indexOf(e,s);return o}function xGe(i,e){return!!(e.options.fences===!1&&i.value&&!i.lang&&/[^ \r\n]/.test(i.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(i.value))}function vGe(i){const e=i.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function _Ge(i,e,t,n){const s=vGe(t),r=i.value||"",o=s==="`"?"GraveAccent":"Tilde";if(xGe(i,t)){const h=t.enter("codeIndented"),g=t.indentLines(r,yGe);return h(),g}const a=t.createTracker(n),l=s.repeat(Math.max(bGe(r,s)+1,3)),c=t.enter("codeFenced");let u=a.move(l);if(i.lang){const h=t.enter(`codeFencedLang${o}`);u+=a.move(t.safe(i.lang,{before:u,after:" ",encode:["`"],...a.current()})),h()}if(i.lang&&i.meta){const h=t.enter(`codeFencedMeta${o}`);u+=a.move(" "),u+=a.move(t.safe(i.meta,{before:u,after:`
-`,encode:["`"],...a.current()})),h()}return u+=a.move(`
-`),r&&(u+=a.move(r+`
-`)),u+=a.move(l),c(),u}function yGe(i,e,t){return(t?"":" ")+i}function bse(i){const e=i.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function wGe(i,e,t,n){const s=bse(t),r=s==='"'?"Quote":"Apostrophe",o=t.enter("definition");let a=t.enter("label");const l=t.createTracker(n);let c=l.move("[");return c+=l.move(t.safe(t.associationId(i),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!i.url||/[\0- \u007F]/.test(i.url)?(a=t.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(t.safe(i.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=t.enter("destinationRaw"),c+=l.move(t.safe(i.url,{before:c,after:i.title?" ":`
-`,...l.current()}))),a(),i.title&&(a=t.enter(`title${r}`),c+=l.move(" "+s),c+=l.move(t.safe(i.title,{before:c,after:s,...l.current()})),c+=l.move(s),a()),o(),c}function CGe(i){const e=i.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function vA(i){return""+i.toString(16).toUpperCase()+";"}function Ej(i,e,t){const n=FE(i),s=FE(e);return n===void 0?s===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}sNe.peek=SGe;function sNe(i,e,t,n){const s=CGe(t),r=t.enter("emphasis"),o=t.createTracker(n),a=o.move(s);let l=o.move(t.containerPhrasing(i,{after:s,before:a,...o.current()}));const c=l.charCodeAt(0),u=Ej(n.before.charCodeAt(n.before.length-1),c,s);u.inside&&(l=vA(c)+l.slice(1));const h=l.charCodeAt(l.length-1),g=Ej(n.after.charCodeAt(0),h,s);g.inside&&(l=l.slice(0,-1)+vA(h));const f=o.move(s);return r(),t.attentionEncodeSurroundingInfo={after:g.outside,before:u.outside},a+l+f}function SGe(i,e,t){return t.options.emphasis||"*"}function kGe(i,e){let t=!1;return C7(i,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return t=!0,SG}),!!((!i.depth||i.depth<3)&&lse(i)&&(e.options.setext||t))}function NGe(i,e,t,n){const s=Math.max(Math.min(6,i.depth||1),1),r=t.createTracker(n);if(kGe(i,t)){const u=t.enter("headingSetext"),h=t.enter("phrasing"),g=t.containerPhrasing(i,{...r.current(),before:`
-`,after:`
-`});return h(),u(),g+`
-`+(s===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
-`))+1))}const o="#".repeat(s),a=t.enter("headingAtx"),l=t.enter("phrasing");r.move(o+" ");let c=t.containerPhrasing(i,{before:"# ",after:`
-`,...r.current()});return/^[\t ]/.test(c)&&(c=vA(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,t.options.closeAtx&&(c+=" "+o),l(),a(),c}rNe.peek=EGe;function rNe(i){return i.value||""}function EGe(){return"<"}oNe.peek=LGe;function oNe(i,e,t,n){const s=bse(t),r=s==='"'?"Quote":"Apostrophe",o=t.enter("image");let a=t.enter("label");const l=t.createTracker(n);let c=l.move("![");return c+=l.move(t.safe(i.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!i.url&&i.title||/[\0- \u007F]/.test(i.url)?(a=t.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(t.safe(i.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=t.enter("destinationRaw"),c+=l.move(t.safe(i.url,{before:c,after:i.title?" ":")",...l.current()}))),a(),i.title&&(a=t.enter(`title${r}`),c+=l.move(" "+s),c+=l.move(t.safe(i.title,{before:c,after:s,...l.current()})),c+=l.move(s),a()),c+=l.move(")"),o(),c}function LGe(){return"!"}aNe.peek=DGe;function aNe(i,e,t,n){const s=i.referenceType,r=t.enter("imageReference");let o=t.enter("label");const a=t.createTracker(n);let l=a.move("![");const c=t.safe(i.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=t.stack;t.stack=[],o=t.enter("reference");const h=t.safe(t.associationId(i),{before:l,after:"]",...a.current()});return o(),t.stack=u,r(),s==="full"||!c||c!==h?l+=a.move(h+"]"):s==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function DGe(){return"!"}lNe.peek=TGe;function lNe(i,e,t){let n=i.value||"",s="`",r=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(n);)s+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++r\u007F]/.test(i.url))}dNe.peek=IGe;function dNe(i,e,t,n){const s=bse(t),r=s==='"'?"Quote":"Apostrophe",o=t.createTracker(n);let a,l;if(cNe(i,t)){const u=t.stack;t.stack=[],a=t.enter("autolink");let h=o.move("<");return h+=o.move(t.containerPhrasing(i,{before:h,after:">",...o.current()})),h+=o.move(">"),a(),t.stack=u,h}a=t.enter("link"),l=t.enter("label");let c=o.move("[");return c+=o.move(t.containerPhrasing(i,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!i.url&&i.title||/[\0- \u007F]/.test(i.url)?(l=t.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(t.safe(i.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=t.enter("destinationRaw"),c+=o.move(t.safe(i.url,{before:c,after:i.title?" ":")",...o.current()}))),l(),i.title&&(l=t.enter(`title${r}`),c+=o.move(" "+s),c+=o.move(t.safe(i.title,{before:c,after:s,...o.current()})),c+=o.move(s),l()),c+=o.move(")"),a(),c}function IGe(i,e,t){return cNe(i,t)?"<":"["}uNe.peek=AGe;function uNe(i,e,t,n){const s=i.referenceType,r=t.enter("linkReference");let o=t.enter("label");const a=t.createTracker(n);let l=a.move("[");const c=t.containerPhrasing(i,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=t.stack;t.stack=[],o=t.enter("reference");const h=t.safe(t.associationId(i),{before:l,after:"]",...a.current()});return o(),t.stack=u,r(),s==="full"||!c||c!==h?l+=a.move(h+"]"):s==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function AGe(){return"["}function xse(i){const e=i.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function RGe(i){const e=xse(i),t=i.options.bulletOther;if(!t)return e==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+t+"`) to be different");return t}function MGe(i){const e=i.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function hNe(i){const e=i.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function PGe(i,e,t,n){const s=t.enter("list"),r=t.bulletCurrent;let o=i.ordered?MGe(t):xse(t);const a=i.ordered?o==="."?")":".":RGe(t);let l=e&&t.bulletLastUsed?o===t.bulletLastUsed:!1;if(!i.ordered){const u=i.children?i.children[0]:void 0;if((o==="*"||o==="-")&&u&&(!u.children||!u.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(l=!0),hNe(t)===o&&u){let h=-1;for(;++h-1?e.start:1)+(t.options.incrementListMarker===!1?0:e.children.indexOf(i))+r);let o=r.length+1;(s==="tab"||s==="mixed"&&(e&&e.type==="list"&&e.spread||i.spread))&&(o=Math.ceil(o/4)*4);const a=t.createTracker(n);a.move(r+" ".repeat(o-r.length)),a.shift(o);const l=t.enter("listItem"),c=t.indentLines(t.containerFlow(i,a.current()),u);return l(),c;function u(h,g,f){return g?(f?"":" ".repeat(o))+h:(f?r:r+" ".repeat(o-r.length))+h}}function FGe(i,e,t,n){const s=t.enter("paragraph"),r=t.enter("phrasing"),o=t.containerPhrasing(i,n);return r(),s(),o}const BGe=y7(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function HGe(i,e,t,n){return(i.children.some(function(o){return BGe(o)})?t.containerPhrasing:t.containerFlow).call(t,i,n)}function WGe(i){const e=i.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}gNe.peek=VGe;function gNe(i,e,t,n){const s=WGe(t),r=t.enter("strong"),o=t.createTracker(n),a=o.move(s+s);let l=o.move(t.containerPhrasing(i,{after:s,before:a,...o.current()}));const c=l.charCodeAt(0),u=Ej(n.before.charCodeAt(n.before.length-1),c,s);u.inside&&(l=vA(c)+l.slice(1));const h=l.charCodeAt(l.length-1),g=Ej(n.after.charCodeAt(0),h,s);g.inside&&(l=l.slice(0,-1)+vA(h));const f=o.move(s+s);return r(),t.attentionEncodeSurroundingInfo={after:g.outside,before:u.outside},a+l+f}function VGe(i,e,t){return t.options.strong||"*"}function zGe(i,e,t,n){return t.safe(i.value,n)}function UGe(i){const e=i.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function $Ge(i,e,t){const n=(hNe(t)+(t.options.ruleSpaces?" ":"")).repeat(UGe(t));return t.options.ruleSpaces?n.slice(0,-1):n}const fNe={blockquote:fGe,break:qfe,code:_Ge,definition:wGe,emphasis:sNe,hardBreak:qfe,heading:NGe,html:rNe,image:oNe,imageReference:aNe,inlineCode:lNe,link:dNe,linkReference:uNe,list:PGe,listItem:jGe,paragraph:FGe,root:HGe,strong:gNe,text:zGe,thematicBreak:$Ge};function qGe(){return{enter:{table:KGe,tableData:Kfe,tableHeader:Kfe,tableRow:YGe},exit:{codeText:QGe,table:GGe,tableData:_U,tableHeader:_U,tableRow:_U}}}function KGe(i){const e=i._align;this.enter({type:"table",align:e.map(function(t){return t==="none"?null:t}),children:[]},i),this.data.inTable=!0}function GGe(i){this.exit(i),this.data.inTable=void 0}function YGe(i){this.enter({type:"tableRow",children:[]},i)}function _U(i){this.exit(i)}function Kfe(i){this.enter({type:"tableCell",children:[]},i)}function QGe(i){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,XGe));const t=this.stack[this.stack.length-1];t.type,t.value=e,this.exit(i)}function XGe(i,e){return e==="|"?e:i}function ZGe(i){const e=i||{},t=e.tableCellPadding,n=e.tablePipeAlign,s=e.stringLength,r=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
-`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:o,tableCell:l,tableRow:a}};function o(f,m,x,v){return c(u(f,x,v),f.align)}function a(f,m,x,v){const _=h(f,x,v),w=c([_]);return w.slice(0,w.indexOf(`
-`))}function l(f,m,x,v){const _=x.enter("tableCell"),w=x.enter("phrasing"),k=x.containerPhrasing(f,{...v,before:r,after:r});return w(),_(),k}function c(f,m){return hGe(f,{align:m,alignDelimiters:n,padding:t,stringLength:s})}function u(f,m,x){const v=f.children;let _=-1;const w=[],k=m.enter("table");for(;++_0&&!t&&(i[i.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const mYe={tokenize:SYe,partial:!0};function bYe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:yYe,continuation:{tokenize:wYe},exit:CYe}},text:{91:{name:"gfmFootnoteCall",tokenize:_Ye},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:xYe,resolveTo:vYe}}}}function xYe(i,e,t){const n=this;let s=n.events.length;const r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let o;for(;s--;){const l=n.events[s][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return t(l);const c=mg(n.sliceSerialize({start:o.end,end:n.now()}));return c.codePointAt(0)!==94||!r.includes(c.slice(1))?t(l):(i.enter("gfmFootnoteCallLabelMarker"),i.consume(l),i.exit("gfmFootnoteCallLabelMarker"),e(l))}}function vYe(i,e){let t=i.length;for(;t--;)if(i[t][1].type==="labelImage"&&i[t][0]==="enter"){i[t][1];break}i[t+1][1].type="data",i[t+3][1].type="gfmFootnoteCallLabelMarker";const n={type:"gfmFootnoteCall",start:Object.assign({},i[t+3][1].start),end:Object.assign({},i[i.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},i[t+3][1].end),end:Object.assign({},i[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const r={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},i[i.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},r.start),end:Object.assign({},r.end)},a=[i[t+1],i[t+2],["enter",n,e],i[t+3],i[t+4],["enter",s,e],["exit",s,e],["enter",r,e],["enter",o,e],["exit",o,e],["exit",r,e],i[i.length-2],i[i.length-1],["exit",n,e]];return i.splice(t,i.length-t+1,...a),i}function _Ye(i,e,t){const n=this,s=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let r=0,o;return a;function a(h){return i.enter("gfmFootnoteCall"),i.enter("gfmFootnoteCallLabelMarker"),i.consume(h),i.exit("gfmFootnoteCallLabelMarker"),l}function l(h){return h!==94?t(h):(i.enter("gfmFootnoteCallMarker"),i.consume(h),i.exit("gfmFootnoteCallMarker"),i.enter("gfmFootnoteCallString"),i.enter("chunkString").contentType="string",c)}function c(h){if(r>999||h===93&&!o||h===null||h===91||Er(h))return t(h);if(h===93){i.exit("chunkString");const g=i.exit("gfmFootnoteCallString");return s.includes(mg(n.sliceSerialize(g)))?(i.enter("gfmFootnoteCallLabelMarker"),i.consume(h),i.exit("gfmFootnoteCallLabelMarker"),i.exit("gfmFootnoteCall"),e):t(h)}return Er(h)||(o=!0),r++,i.consume(h),h===92?u:c}function u(h){return h===91||h===92||h===93?(i.consume(h),r++,c):c(h)}}function yYe(i,e,t){const n=this,s=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let r,o=0,a;return l;function l(m){return i.enter("gfmFootnoteDefinition")._container=!0,i.enter("gfmFootnoteDefinitionLabel"),i.enter("gfmFootnoteDefinitionLabelMarker"),i.consume(m),i.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(i.enter("gfmFootnoteDefinitionMarker"),i.consume(m),i.exit("gfmFootnoteDefinitionMarker"),i.enter("gfmFootnoteDefinitionLabelString"),i.enter("chunkString").contentType="string",u):t(m)}function u(m){if(o>999||m===93&&!a||m===null||m===91||Er(m))return t(m);if(m===93){i.exit("chunkString");const x=i.exit("gfmFootnoteDefinitionLabelString");return r=mg(n.sliceSerialize(x)),i.enter("gfmFootnoteDefinitionLabelMarker"),i.consume(m),i.exit("gfmFootnoteDefinitionLabelMarker"),i.exit("gfmFootnoteDefinitionLabel"),g}return Er(m)||(a=!0),o++,i.consume(m),m===92?h:u}function h(m){return m===91||m===92||m===93?(i.consume(m),o++,u):u(m)}function g(m){return m===58?(i.enter("definitionMarker"),i.consume(m),i.exit("definitionMarker"),s.includes(r)||s.push(r),ds(i,f,"gfmFootnoteDefinitionWhitespace")):t(m)}function f(m){return e(m)}}function wYe(i,e,t){return i.check(VM,e,i.attempt(mYe,e,t))}function CYe(i){i.exit("gfmFootnoteDefinition")}function SYe(i,e,t){const n=this;return ds(i,s,"gfmFootnoteDefinitionIndent",5);function s(r){const o=n.events[n.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?e(r):t(r)}}function kYe(i){let t=(i||{}).singleTilde;const n={name:"strikethrough",tokenize:r,resolveAll:s};return t==null&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function s(o,a){let l=-1;for(;++l1?l(m):(o.consume(m),h++,f);if(h<2&&!t)return l(m);const v=o.exit("strikethroughSequenceTemporary"),_=FE(m);return v._open=!_||_===2&&!!x,v._close=!x||x===2&&!!_,a(m)}}}class NYe{constructor(){this.map=[]}add(e,t,n){EYe(this,e,t,n)}consume(e){if(this.map.sort(function(r,o){return r[0]-o[0]}),this.map.length===0)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let s=n.pop();for(;s;){for(const r of s)e.push(r);s=n.pop()}this.map.length=0}}function EYe(i,e,t,n){let s=0;if(!(t===0&&n.length===0)){for(;s-1;){const $=n.events[j][1].type;if($==="lineEnding"||$==="linePrefix")j--;else break}const B=j>-1?n.events[j][1].type:null,U=B==="tableHead"||B==="tableRow"?D:l;return U===D&&n.parser.lazy[n.now().line]?t(P):U(P)}function l(P){return i.enter("tableHead"),i.enter("tableRow"),c(P)}function c(P){return P===124||(o=!0,r+=1),u(P)}function u(P){return P===null?t(P):In(P)?r>1?(r=0,n.interrupt=!0,i.exit("tableRow"),i.enter("lineEnding"),i.consume(P),i.exit("lineEnding"),f):t(P):Bi(P)?ds(i,u,"whitespace")(P):(r+=1,o&&(o=!1,s+=1),P===124?(i.enter("tableCellDivider"),i.consume(P),i.exit("tableCellDivider"),o=!0,u):(i.enter("data"),h(P)))}function h(P){return P===null||P===124||Er(P)?(i.exit("data"),u(P)):(i.consume(P),P===92?g:h)}function g(P){return P===92||P===124?(i.consume(P),h):h(P)}function f(P){return n.interrupt=!1,n.parser.lazy[n.now().line]?t(P):(i.enter("tableDelimiterRow"),o=!1,Bi(P)?ds(i,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):m(P))}function m(P){return P===45||P===58?v(P):P===124?(o=!0,i.enter("tableCellDivider"),i.consume(P),i.exit("tableCellDivider"),x):E(P)}function x(P){return Bi(P)?ds(i,v,"whitespace")(P):v(P)}function v(P){return P===58?(r+=1,o=!0,i.enter("tableDelimiterMarker"),i.consume(P),i.exit("tableDelimiterMarker"),_):P===45?(r+=1,_(P)):P===null||In(P)?C(P):E(P)}function _(P){return P===45?(i.enter("tableDelimiterFiller"),w(P)):E(P)}function w(P){return P===45?(i.consume(P),w):P===58?(o=!0,i.exit("tableDelimiterFiller"),i.enter("tableDelimiterMarker"),i.consume(P),i.exit("tableDelimiterMarker"),k):(i.exit("tableDelimiterFiller"),k(P))}function k(P){return Bi(P)?ds(i,C,"whitespace")(P):C(P)}function C(P){return P===124?m(P):P===null||In(P)?!o||s!==r?E(P):(i.exit("tableDelimiterRow"),i.exit("tableHead"),e(P)):E(P)}function E(P){return t(P)}function D(P){return i.enter("tableRow"),T(P)}function T(P){return P===124?(i.enter("tableCellDivider"),i.consume(P),i.exit("tableCellDivider"),T):P===null||In(P)?(i.exit("tableRow"),e(P)):Bi(P)?ds(i,T,"whitespace")(P):(i.enter("data"),I(P))}function I(P){return P===null||P===124||Er(P)?(i.exit("data"),T(P)):(i.consume(P),P===92?R:I)}function R(P){return P===92||P===124?(i.consume(P),I):I(P)}}function IYe(i,e){let t=-1,n=!0,s=0,r=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,u,h;const g=new NYe;for(;++tt[2]+1){const m=t[2]+1,x=t[3]-t[2]-1;i.add(m,x,[])}}i.add(t[3]+1,0,[["exit",h,e]])}return s!==void 0&&(r.end=Object.assign({},fk(e.events,s)),i.add(s,0,[["exit",r,e]]),r=void 0),r}function Yfe(i,e,t,n,s){const r=[],o=fk(e.events,t);s&&(s.end=Object.assign({},o),r.push(["exit",s,e])),n.end=Object.assign({},o),r.push(["exit",n,e]),i.add(t+1,0,r)}function fk(i,e){const t=i[e],n=t[0]==="enter"?"start":"end";return t[1][n]}const AYe={name:"tasklistCheck",tokenize:MYe};function RYe(){return{text:{91:AYe}}}function MYe(i,e,t){const n=this;return s;function s(l){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?t(l):(i.enter("taskListCheck"),i.enter("taskListCheckMarker"),i.consume(l),i.exit("taskListCheckMarker"),r)}function r(l){return Er(l)?(i.enter("taskListCheckValueUnchecked"),i.consume(l),i.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(i.enter("taskListCheckValueChecked"),i.consume(l),i.exit("taskListCheckValueChecked"),o):t(l)}function o(l){return l===93?(i.enter("taskListCheckMarker"),i.consume(l),i.exit("taskListCheckMarker"),i.exit("taskListCheck"),a):t(l)}function a(l){return In(l)?e(l):Bi(l)?i.check({tokenize:PYe},e,t)(l):t(l)}}function PYe(i,e,t){return ds(i,n,"whitespace");function n(s){return s===null?t(s):e(s)}}function OYe(i){return Ake([aYe(),bYe(),kYe(i),DYe(),RYe()])}const jYe={};function _se(i){const e=this,t=i||jYe,n=e.data(),s=n.micromarkExtensions||(n.micromarkExtensions=[]),r=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);s.push(OYe(t)),r.push(iYe()),o.push(sYe(t))}const Qfe=/[#.]/g;function FYe(i,e){const t=i||"",n={};let s=0,r,o;for(;s-1&&r<=e.length){let o=0;for(;;){let a=t[o];if(a===void 0){const l=Zfe(e,t[o-1]);a=l===-1?e.length+1:l+1,t[o]=a}if(a>r)return{line:o+1,column:r-(o>0?t[o-1]:0)+1,offset:r};o++}}}function s(r){if(r&&typeof r.line=="number"&&typeof r.column=="number"&&!Number.isNaN(r.line)&&!Number.isNaN(r.column)){for(;t.length1?t[r.line-2]:0)+r.column-1;if(o=55296&&i<=57343}function cQe(i){return i>=56320&&i<=57343}function dQe(i,e){return(i-55296)*1024+9216+e}function LNe(i){return i!==32&&i!==10&&i!==13&&i!==9&&i!==12&&i>=1&&i<=31||i>=127&&i<=159}function DNe(i){return i>=64976&&i<=65007||lQe.has(i)}var Je;(function(i){i.controlCharacterInInputStream="control-character-in-input-stream",i.noncharacterInInputStream="noncharacter-in-input-stream",i.surrogateInInputStream="surrogate-in-input-stream",i.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",i.endTagWithAttributes="end-tag-with-attributes",i.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",i.unexpectedSolidusInTag="unexpected-solidus-in-tag",i.unexpectedNullCharacter="unexpected-null-character",i.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",i.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",i.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",i.missingEndTagName="missing-end-tag-name",i.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",i.unknownNamedCharacterReference="unknown-named-character-reference",i.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",i.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",i.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",i.eofBeforeTagName="eof-before-tag-name",i.eofInTag="eof-in-tag",i.missingAttributeValue="missing-attribute-value",i.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",i.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",i.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",i.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",i.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",i.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",i.missingDoctypePublicIdentifier="missing-doctype-public-identifier",i.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",i.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",i.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",i.cdataInHtmlContent="cdata-in-html-content",i.incorrectlyOpenedComment="incorrectly-opened-comment",i.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",i.eofInDoctype="eof-in-doctype",i.nestedComment="nested-comment",i.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",i.eofInComment="eof-in-comment",i.incorrectlyClosedComment="incorrectly-closed-comment",i.eofInCdata="eof-in-cdata",i.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",i.nullCharacterReference="null-character-reference",i.surrogateCharacterReference="surrogate-character-reference",i.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",i.controlCharacterReference="control-character-reference",i.noncharacterCharacterReference="noncharacter-character-reference",i.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",i.missingDoctypeName="missing-doctype-name",i.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",i.duplicateAttribute="duplicate-attribute",i.nonConformingDoctype="non-conforming-doctype",i.missingDoctype="missing-doctype",i.misplacedDoctype="misplaced-doctype",i.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",i.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",i.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",i.openElementsLeftAfterEof="open-elements-left-after-eof",i.abandonedHeadElementChild="abandoned-head-element-child",i.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",i.nestedNoscriptInHead="nested-noscript-in-head",i.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Je||(Je={}));const uQe=65536;class hQe{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=uQe,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){const{line:n,col:s,offset:r}=this,o=s+t,a=r+t;return{code:e,startLine:n,endLine:n,startCol:o,endCol:o,startOffset:a,endOffset:a}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const t=this.html.charCodeAt(this.pos+1);if(cQe(t))return this.pos++,this._addGap(),dQe(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,ae.EOF;return this._err(Je.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let n=0;n=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,ae.EOF;const n=this.html.charCodeAt(t);return n===ae.CARRIAGE_RETURN?ae.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,ae.EOF;let e=this.html.charCodeAt(this.pos);return e===ae.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,ae.LINE_FEED):e===ae.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,ENe(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===ae.LINE_FEED||e===ae.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){LNe(e)?this._err(Je.controlCharacterInInputStream):DNe(e)&&this._err(Je.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos=0;t--)if(i.attrs[t].name===e)return i.attrs[t].value;return null}const gQe=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(i=>i.charCodeAt(0))),fQe=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function pQe(i){var e;return i>=55296&&i<=57343||i>1114111?65533:(e=fQe.get(i))!==null&&e!==void 0?e:i}var Qa;(function(i){i[i.NUM=35]="NUM",i[i.SEMI=59]="SEMI",i[i.EQUALS=61]="EQUALS",i[i.ZERO=48]="ZERO",i[i.NINE=57]="NINE",i[i.LOWER_A=97]="LOWER_A",i[i.LOWER_F=102]="LOWER_F",i[i.LOWER_X=120]="LOWER_X",i[i.LOWER_Z=122]="LOWER_Z",i[i.UPPER_A=65]="UPPER_A",i[i.UPPER_F=70]="UPPER_F",i[i.UPPER_Z=90]="UPPER_Z"})(Qa||(Qa={}));const mQe=32;var yv;(function(i){i[i.VALUE_LENGTH=49152]="VALUE_LENGTH",i[i.BRANCH_LENGTH=16256]="BRANCH_LENGTH",i[i.JUMP_TABLE=127]="JUMP_TABLE"})(yv||(yv={}));function TG(i){return i>=Qa.ZERO&&i<=Qa.NINE}function bQe(i){return i>=Qa.UPPER_A&&i<=Qa.UPPER_F||i>=Qa.LOWER_A&&i<=Qa.LOWER_F}function xQe(i){return i>=Qa.UPPER_A&&i<=Qa.UPPER_Z||i>=Qa.LOWER_A&&i<=Qa.LOWER_Z||TG(i)}function vQe(i){return i===Qa.EQUALS||xQe(i)}var Ba;(function(i){i[i.EntityStart=0]="EntityStart",i[i.NumericStart=1]="NumericStart",i[i.NumericDecimal=2]="NumericDecimal",i[i.NumericHex=3]="NumericHex",i[i.NamedEntity=4]="NamedEntity"})(Ba||(Ba={}));var jm;(function(i){i[i.Legacy=0]="Legacy",i[i.Strict=1]="Strict",i[i.Attribute=2]="Attribute"})(jm||(jm={}));class _Qe{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Ba.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=jm.Strict}startEntity(e){this.decodeMode=e,this.state=Ba.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Ba.EntityStart:return e.charCodeAt(t)===Qa.NUM?(this.state=Ba.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ba.NamedEntity,this.stateNamedEntity(e,t));case Ba.NumericStart:return this.stateNumericStart(e,t);case Ba.NumericDecimal:return this.stateNumericDecimal(e,t);case Ba.NumericHex:return this.stateNumericHex(e,t);case Ba.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|mQe)===Qa.LOWER_X?(this.state=Ba.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ba.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,s){if(t!==n){const r=n-t;this.result=this.result*Math.pow(s,r)+Number.parseInt(e.substr(t,r),s),this.consumed+=r}}stateNumericHex(e,t){const n=t;for(;t>14;for(;t>14,r!==0){if(o===Qa.SEMI)return this.emitNamedEntityData(this.treeIndex,r,this.consumed+this.excess);this.decodeMode!==jm.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,s=(n[t]&yv.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:s}=this;return this.emitCodePoint(t===1?s[e]&~yv.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case Ba.NamedEntity:return this.result!==0&&(this.decodeMode!==jm.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ba.NumericDecimal:return this.emitNumericEntity(0,2);case Ba.NumericHex:return this.emitNumericEntity(0,3);case Ba.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ba.EntityStart:return 0}}}function yQe(i,e,t,n){const s=(e&yv.BRANCH_LENGTH)>>7,r=e&yv.JUMP_TABLE;if(s===0)return r!==0&&n===r?t:-1;if(r){const l=n-r;return l<0||l>=s?-1:i[t+l]-1}let o=t,a=o+s-1;for(;o<=a;){const l=o+a>>>1,c=i[l];if(cn)a=l-1;else return i[l+s]}return-1}var bt;(function(i){i.HTML="http://www.w3.org/1999/xhtml",i.MATHML="http://www.w3.org/1998/Math/MathML",i.SVG="http://www.w3.org/2000/svg",i.XLINK="http://www.w3.org/1999/xlink",i.XML="http://www.w3.org/XML/1998/namespace",i.XMLNS="http://www.w3.org/2000/xmlns/"})(bt||(bt={}));var d1;(function(i){i.TYPE="type",i.ACTION="action",i.ENCODING="encoding",i.PROMPT="prompt",i.NAME="name",i.COLOR="color",i.FACE="face",i.SIZE="size"})(d1||(d1={}));var hh;(function(i){i.NO_QUIRKS="no-quirks",i.QUIRKS="quirks",i.LIMITED_QUIRKS="limited-quirks"})(hh||(hh={}));var Me;(function(i){i.A="a",i.ADDRESS="address",i.ANNOTATION_XML="annotation-xml",i.APPLET="applet",i.AREA="area",i.ARTICLE="article",i.ASIDE="aside",i.B="b",i.BASE="base",i.BASEFONT="basefont",i.BGSOUND="bgsound",i.BIG="big",i.BLOCKQUOTE="blockquote",i.BODY="body",i.BR="br",i.BUTTON="button",i.CAPTION="caption",i.CENTER="center",i.CODE="code",i.COL="col",i.COLGROUP="colgroup",i.DD="dd",i.DESC="desc",i.DETAILS="details",i.DIALOG="dialog",i.DIR="dir",i.DIV="div",i.DL="dl",i.DT="dt",i.EM="em",i.EMBED="embed",i.FIELDSET="fieldset",i.FIGCAPTION="figcaption",i.FIGURE="figure",i.FONT="font",i.FOOTER="footer",i.FOREIGN_OBJECT="foreignObject",i.FORM="form",i.FRAME="frame",i.FRAMESET="frameset",i.H1="h1",i.H2="h2",i.H3="h3",i.H4="h4",i.H5="h5",i.H6="h6",i.HEAD="head",i.HEADER="header",i.HGROUP="hgroup",i.HR="hr",i.HTML="html",i.I="i",i.IMG="img",i.IMAGE="image",i.INPUT="input",i.IFRAME="iframe",i.KEYGEN="keygen",i.LABEL="label",i.LI="li",i.LINK="link",i.LISTING="listing",i.MAIN="main",i.MALIGNMARK="malignmark",i.MARQUEE="marquee",i.MATH="math",i.MENU="menu",i.META="meta",i.MGLYPH="mglyph",i.MI="mi",i.MO="mo",i.MN="mn",i.MS="ms",i.MTEXT="mtext",i.NAV="nav",i.NOBR="nobr",i.NOFRAMES="noframes",i.NOEMBED="noembed",i.NOSCRIPT="noscript",i.OBJECT="object",i.OL="ol",i.OPTGROUP="optgroup",i.OPTION="option",i.P="p",i.PARAM="param",i.PLAINTEXT="plaintext",i.PRE="pre",i.RB="rb",i.RP="rp",i.RT="rt",i.RTC="rtc",i.RUBY="ruby",i.S="s",i.SCRIPT="script",i.SEARCH="search",i.SECTION="section",i.SELECT="select",i.SOURCE="source",i.SMALL="small",i.SPAN="span",i.STRIKE="strike",i.STRONG="strong",i.STYLE="style",i.SUB="sub",i.SUMMARY="summary",i.SUP="sup",i.TABLE="table",i.TBODY="tbody",i.TEMPLATE="template",i.TEXTAREA="textarea",i.TFOOT="tfoot",i.TD="td",i.TH="th",i.THEAD="thead",i.TITLE="title",i.TR="tr",i.TRACK="track",i.TT="tt",i.U="u",i.UL="ul",i.SVG="svg",i.VAR="var",i.WBR="wbr",i.XMP="xmp"})(Me||(Me={}));var O;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.A=1]="A",i[i.ADDRESS=2]="ADDRESS",i[i.ANNOTATION_XML=3]="ANNOTATION_XML",i[i.APPLET=4]="APPLET",i[i.AREA=5]="AREA",i[i.ARTICLE=6]="ARTICLE",i[i.ASIDE=7]="ASIDE",i[i.B=8]="B",i[i.BASE=9]="BASE",i[i.BASEFONT=10]="BASEFONT",i[i.BGSOUND=11]="BGSOUND",i[i.BIG=12]="BIG",i[i.BLOCKQUOTE=13]="BLOCKQUOTE",i[i.BODY=14]="BODY",i[i.BR=15]="BR",i[i.BUTTON=16]="BUTTON",i[i.CAPTION=17]="CAPTION",i[i.CENTER=18]="CENTER",i[i.CODE=19]="CODE",i[i.COL=20]="COL",i[i.COLGROUP=21]="COLGROUP",i[i.DD=22]="DD",i[i.DESC=23]="DESC",i[i.DETAILS=24]="DETAILS",i[i.DIALOG=25]="DIALOG",i[i.DIR=26]="DIR",i[i.DIV=27]="DIV",i[i.DL=28]="DL",i[i.DT=29]="DT",i[i.EM=30]="EM",i[i.EMBED=31]="EMBED",i[i.FIELDSET=32]="FIELDSET",i[i.FIGCAPTION=33]="FIGCAPTION",i[i.FIGURE=34]="FIGURE",i[i.FONT=35]="FONT",i[i.FOOTER=36]="FOOTER",i[i.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",i[i.FORM=38]="FORM",i[i.FRAME=39]="FRAME",i[i.FRAMESET=40]="FRAMESET",i[i.H1=41]="H1",i[i.H2=42]="H2",i[i.H3=43]="H3",i[i.H4=44]="H4",i[i.H5=45]="H5",i[i.H6=46]="H6",i[i.HEAD=47]="HEAD",i[i.HEADER=48]="HEADER",i[i.HGROUP=49]="HGROUP",i[i.HR=50]="HR",i[i.HTML=51]="HTML",i[i.I=52]="I",i[i.IMG=53]="IMG",i[i.IMAGE=54]="IMAGE",i[i.INPUT=55]="INPUT",i[i.IFRAME=56]="IFRAME",i[i.KEYGEN=57]="KEYGEN",i[i.LABEL=58]="LABEL",i[i.LI=59]="LI",i[i.LINK=60]="LINK",i[i.LISTING=61]="LISTING",i[i.MAIN=62]="MAIN",i[i.MALIGNMARK=63]="MALIGNMARK",i[i.MARQUEE=64]="MARQUEE",i[i.MATH=65]="MATH",i[i.MENU=66]="MENU",i[i.META=67]="META",i[i.MGLYPH=68]="MGLYPH",i[i.MI=69]="MI",i[i.MO=70]="MO",i[i.MN=71]="MN",i[i.MS=72]="MS",i[i.MTEXT=73]="MTEXT",i[i.NAV=74]="NAV",i[i.NOBR=75]="NOBR",i[i.NOFRAMES=76]="NOFRAMES",i[i.NOEMBED=77]="NOEMBED",i[i.NOSCRIPT=78]="NOSCRIPT",i[i.OBJECT=79]="OBJECT",i[i.OL=80]="OL",i[i.OPTGROUP=81]="OPTGROUP",i[i.OPTION=82]="OPTION",i[i.P=83]="P",i[i.PARAM=84]="PARAM",i[i.PLAINTEXT=85]="PLAINTEXT",i[i.PRE=86]="PRE",i[i.RB=87]="RB",i[i.RP=88]="RP",i[i.RT=89]="RT",i[i.RTC=90]="RTC",i[i.RUBY=91]="RUBY",i[i.S=92]="S",i[i.SCRIPT=93]="SCRIPT",i[i.SEARCH=94]="SEARCH",i[i.SECTION=95]="SECTION",i[i.SELECT=96]="SELECT",i[i.SOURCE=97]="SOURCE",i[i.SMALL=98]="SMALL",i[i.SPAN=99]="SPAN",i[i.STRIKE=100]="STRIKE",i[i.STRONG=101]="STRONG",i[i.STYLE=102]="STYLE",i[i.SUB=103]="SUB",i[i.SUMMARY=104]="SUMMARY",i[i.SUP=105]="SUP",i[i.TABLE=106]="TABLE",i[i.TBODY=107]="TBODY",i[i.TEMPLATE=108]="TEMPLATE",i[i.TEXTAREA=109]="TEXTAREA",i[i.TFOOT=110]="TFOOT",i[i.TD=111]="TD",i[i.TH=112]="TH",i[i.THEAD=113]="THEAD",i[i.TITLE=114]="TITLE",i[i.TR=115]="TR",i[i.TRACK=116]="TRACK",i[i.TT=117]="TT",i[i.U=118]="U",i[i.UL=119]="UL",i[i.SVG=120]="SVG",i[i.VAR=121]="VAR",i[i.WBR=122]="WBR",i[i.XMP=123]="XMP"})(O||(O={}));const wQe=new Map([[Me.A,O.A],[Me.ADDRESS,O.ADDRESS],[Me.ANNOTATION_XML,O.ANNOTATION_XML],[Me.APPLET,O.APPLET],[Me.AREA,O.AREA],[Me.ARTICLE,O.ARTICLE],[Me.ASIDE,O.ASIDE],[Me.B,O.B],[Me.BASE,O.BASE],[Me.BASEFONT,O.BASEFONT],[Me.BGSOUND,O.BGSOUND],[Me.BIG,O.BIG],[Me.BLOCKQUOTE,O.BLOCKQUOTE],[Me.BODY,O.BODY],[Me.BR,O.BR],[Me.BUTTON,O.BUTTON],[Me.CAPTION,O.CAPTION],[Me.CENTER,O.CENTER],[Me.CODE,O.CODE],[Me.COL,O.COL],[Me.COLGROUP,O.COLGROUP],[Me.DD,O.DD],[Me.DESC,O.DESC],[Me.DETAILS,O.DETAILS],[Me.DIALOG,O.DIALOG],[Me.DIR,O.DIR],[Me.DIV,O.DIV],[Me.DL,O.DL],[Me.DT,O.DT],[Me.EM,O.EM],[Me.EMBED,O.EMBED],[Me.FIELDSET,O.FIELDSET],[Me.FIGCAPTION,O.FIGCAPTION],[Me.FIGURE,O.FIGURE],[Me.FONT,O.FONT],[Me.FOOTER,O.FOOTER],[Me.FOREIGN_OBJECT,O.FOREIGN_OBJECT],[Me.FORM,O.FORM],[Me.FRAME,O.FRAME],[Me.FRAMESET,O.FRAMESET],[Me.H1,O.H1],[Me.H2,O.H2],[Me.H3,O.H3],[Me.H4,O.H4],[Me.H5,O.H5],[Me.H6,O.H6],[Me.HEAD,O.HEAD],[Me.HEADER,O.HEADER],[Me.HGROUP,O.HGROUP],[Me.HR,O.HR],[Me.HTML,O.HTML],[Me.I,O.I],[Me.IMG,O.IMG],[Me.IMAGE,O.IMAGE],[Me.INPUT,O.INPUT],[Me.IFRAME,O.IFRAME],[Me.KEYGEN,O.KEYGEN],[Me.LABEL,O.LABEL],[Me.LI,O.LI],[Me.LINK,O.LINK],[Me.LISTING,O.LISTING],[Me.MAIN,O.MAIN],[Me.MALIGNMARK,O.MALIGNMARK],[Me.MARQUEE,O.MARQUEE],[Me.MATH,O.MATH],[Me.MENU,O.MENU],[Me.META,O.META],[Me.MGLYPH,O.MGLYPH],[Me.MI,O.MI],[Me.MO,O.MO],[Me.MN,O.MN],[Me.MS,O.MS],[Me.MTEXT,O.MTEXT],[Me.NAV,O.NAV],[Me.NOBR,O.NOBR],[Me.NOFRAMES,O.NOFRAMES],[Me.NOEMBED,O.NOEMBED],[Me.NOSCRIPT,O.NOSCRIPT],[Me.OBJECT,O.OBJECT],[Me.OL,O.OL],[Me.OPTGROUP,O.OPTGROUP],[Me.OPTION,O.OPTION],[Me.P,O.P],[Me.PARAM,O.PARAM],[Me.PLAINTEXT,O.PLAINTEXT],[Me.PRE,O.PRE],[Me.RB,O.RB],[Me.RP,O.RP],[Me.RT,O.RT],[Me.RTC,O.RTC],[Me.RUBY,O.RUBY],[Me.S,O.S],[Me.SCRIPT,O.SCRIPT],[Me.SEARCH,O.SEARCH],[Me.SECTION,O.SECTION],[Me.SELECT,O.SELECT],[Me.SOURCE,O.SOURCE],[Me.SMALL,O.SMALL],[Me.SPAN,O.SPAN],[Me.STRIKE,O.STRIKE],[Me.STRONG,O.STRONG],[Me.STYLE,O.STYLE],[Me.SUB,O.SUB],[Me.SUMMARY,O.SUMMARY],[Me.SUP,O.SUP],[Me.TABLE,O.TABLE],[Me.TBODY,O.TBODY],[Me.TEMPLATE,O.TEMPLATE],[Me.TEXTAREA,O.TEXTAREA],[Me.TFOOT,O.TFOOT],[Me.TD,O.TD],[Me.TH,O.TH],[Me.THEAD,O.THEAD],[Me.TITLE,O.TITLE],[Me.TR,O.TR],[Me.TRACK,O.TRACK],[Me.TT,O.TT],[Me.U,O.U],[Me.UL,O.UL],[Me.SVG,O.SVG],[Me.VAR,O.VAR],[Me.WBR,O.WBR],[Me.XMP,O.XMP]]);function HL(i){var e;return(e=wQe.get(i))!==null&&e!==void 0?e:O.UNKNOWN}const _t=O,CQe={[bt.HTML]:new Set([_t.ADDRESS,_t.APPLET,_t.AREA,_t.ARTICLE,_t.ASIDE,_t.BASE,_t.BASEFONT,_t.BGSOUND,_t.BLOCKQUOTE,_t.BODY,_t.BR,_t.BUTTON,_t.CAPTION,_t.CENTER,_t.COL,_t.COLGROUP,_t.DD,_t.DETAILS,_t.DIR,_t.DIV,_t.DL,_t.DT,_t.EMBED,_t.FIELDSET,_t.FIGCAPTION,_t.FIGURE,_t.FOOTER,_t.FORM,_t.FRAME,_t.FRAMESET,_t.H1,_t.H2,_t.H3,_t.H4,_t.H5,_t.H6,_t.HEAD,_t.HEADER,_t.HGROUP,_t.HR,_t.HTML,_t.IFRAME,_t.IMG,_t.INPUT,_t.LI,_t.LINK,_t.LISTING,_t.MAIN,_t.MARQUEE,_t.MENU,_t.META,_t.NAV,_t.NOEMBED,_t.NOFRAMES,_t.NOSCRIPT,_t.OBJECT,_t.OL,_t.P,_t.PARAM,_t.PLAINTEXT,_t.PRE,_t.SCRIPT,_t.SECTION,_t.SELECT,_t.SOURCE,_t.STYLE,_t.SUMMARY,_t.TABLE,_t.TBODY,_t.TD,_t.TEMPLATE,_t.TEXTAREA,_t.TFOOT,_t.TH,_t.THEAD,_t.TITLE,_t.TR,_t.TRACK,_t.UL,_t.WBR,_t.XMP]),[bt.MATHML]:new Set([_t.MI,_t.MO,_t.MN,_t.MS,_t.MTEXT,_t.ANNOTATION_XML]),[bt.SVG]:new Set([_t.TITLE,_t.FOREIGN_OBJECT,_t.DESC]),[bt.XLINK]:new Set,[bt.XML]:new Set,[bt.XMLNS]:new Set},IG=new Set([_t.H1,_t.H2,_t.H3,_t.H4,_t.H5,_t.H6]);Me.STYLE,Me.SCRIPT,Me.XMP,Me.IFRAME,Me.NOEMBED,Me.NOFRAMES,Me.PLAINTEXT;var ce;(function(i){i[i.DATA=0]="DATA",i[i.RCDATA=1]="RCDATA",i[i.RAWTEXT=2]="RAWTEXT",i[i.SCRIPT_DATA=3]="SCRIPT_DATA",i[i.PLAINTEXT=4]="PLAINTEXT",i[i.TAG_OPEN=5]="TAG_OPEN",i[i.END_TAG_OPEN=6]="END_TAG_OPEN",i[i.TAG_NAME=7]="TAG_NAME",i[i.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",i[i.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",i[i.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",i[i.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",i[i.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",i[i.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",i[i.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",i[i.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",i[i.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",i[i.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",i[i.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",i[i.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",i[i.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",i[i.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",i[i.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",i[i.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",i[i.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",i[i.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",i[i.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",i[i.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",i[i.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",i[i.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",i[i.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",i[i.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",i[i.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",i[i.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",i[i.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",i[i.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",i[i.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",i[i.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",i[i.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",i[i.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",i[i.BOGUS_COMMENT=40]="BOGUS_COMMENT",i[i.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",i[i.COMMENT_START=42]="COMMENT_START",i[i.COMMENT_START_DASH=43]="COMMENT_START_DASH",i[i.COMMENT=44]="COMMENT",i[i.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",i[i.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",i[i.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",i[i.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",i[i.COMMENT_END_DASH=49]="COMMENT_END_DASH",i[i.COMMENT_END=50]="COMMENT_END",i[i.COMMENT_END_BANG=51]="COMMENT_END_BANG",i[i.DOCTYPE=52]="DOCTYPE",i[i.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",i[i.DOCTYPE_NAME=54]="DOCTYPE_NAME",i[i.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",i[i.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",i[i.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",i[i.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",i[i.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",i[i.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",i[i.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",i[i.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",i[i.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",i[i.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",i[i.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",i[i.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",i[i.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",i[i.CDATA_SECTION=68]="CDATA_SECTION",i[i.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",i[i.CDATA_SECTION_END=70]="CDATA_SECTION_END",i[i.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",i[i.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(ce||(ce={}));const Bo={DATA:ce.DATA,RCDATA:ce.RCDATA,RAWTEXT:ce.RAWTEXT,SCRIPT_DATA:ce.SCRIPT_DATA,PLAINTEXT:ce.PLAINTEXT,CDATA_SECTION:ce.CDATA_SECTION};function SQe(i){return i>=ae.DIGIT_0&&i<=ae.DIGIT_9}function p2(i){return i>=ae.LATIN_CAPITAL_A&&i<=ae.LATIN_CAPITAL_Z}function kQe(i){return i>=ae.LATIN_SMALL_A&&i<=ae.LATIN_SMALL_Z}function Ox(i){return kQe(i)||p2(i)}function epe(i){return Ox(i)||SQe(i)}function x5(i){return i+32}function INe(i){return i===ae.SPACE||i===ae.LINE_FEED||i===ae.TABULATION||i===ae.FORM_FEED}function tpe(i){return INe(i)||i===ae.SOLIDUS||i===ae.GREATER_THAN_SIGN}function NQe(i){return i===ae.NULL?Je.nullCharacterReference:i>1114111?Je.characterReferenceOutsideUnicodeRange:ENe(i)?Je.surrogateCharacterReference:DNe(i)?Je.noncharacterCharacterReference:LNe(i)||i===ae.CARRIAGE_RETURN?Je.controlCharacterReference:null}class EQe{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=ce.DATA,this.returnState=ce.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new hQe(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new _Qe(gQe,(n,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(n)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Je.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:n=>{this._err(Je.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+n)},validateNumericCharacterReference:n=>{const s=NQe(n);s&&this._err(s,1)}}:void 0)}_err(e,t=0){var n,s;(s=(n=this.handler).onParseError)===null||s===void 0||s.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e==null||e())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n==null||n()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t0&&this._err(Je.endTagWithAttributes),e.selfClosing&&this._err(Je.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case Di.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Di.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Di.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:Di.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){const t=INe(e)?Di.WHITESPACE_CHARACTER:e===ae.NULL?Di.NULL_CHARACTER:Di.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(Di.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=ce.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?jm.Attribute:jm.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===ce.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===ce.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===ce.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case ce.DATA:{this._stateData(e);break}case ce.RCDATA:{this._stateRcdata(e);break}case ce.RAWTEXT:{this._stateRawtext(e);break}case ce.SCRIPT_DATA:{this._stateScriptData(e);break}case ce.PLAINTEXT:{this._statePlaintext(e);break}case ce.TAG_OPEN:{this._stateTagOpen(e);break}case ce.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case ce.TAG_NAME:{this._stateTagName(e);break}case ce.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case ce.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case ce.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case ce.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case ce.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case ce.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case ce.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case ce.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case ce.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case ce.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case ce.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case ce.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case ce.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case ce.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case ce.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case ce.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case ce.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case ce.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case ce.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case ce.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case ce.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case ce.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case ce.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case ce.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case ce.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case ce.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case ce.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case ce.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case ce.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case ce.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case ce.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case ce.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case ce.BOGUS_COMMENT:{this._stateBogusComment(e);break}case ce.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case ce.COMMENT_START:{this._stateCommentStart(e);break}case ce.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case ce.COMMENT:{this._stateComment(e);break}case ce.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case ce.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case ce.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case ce.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case ce.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case ce.COMMENT_END:{this._stateCommentEnd(e);break}case ce.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case ce.DOCTYPE:{this._stateDoctype(e);break}case ce.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case ce.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case ce.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case ce.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case ce.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case ce.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case ce.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case ce.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case ce.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case ce.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case ce.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case ce.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case ce.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case ce.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case ce.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case ce.CDATA_SECTION:{this._stateCdataSection(e);break}case ce.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case ce.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case ce.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case ce.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case ae.LESS_THAN_SIGN:{this.state=ce.TAG_OPEN;break}case ae.AMPERSAND:{this._startCharacterReference();break}case ae.NULL:{this._err(Je.unexpectedNullCharacter),this._emitCodePoint(e);break}case ae.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case ae.AMPERSAND:{this._startCharacterReference();break}case ae.LESS_THAN_SIGN:{this.state=ce.RCDATA_LESS_THAN_SIGN;break}case ae.NULL:{this._err(Je.unexpectedNullCharacter),this._emitChars(Gr);break}case ae.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case ae.LESS_THAN_SIGN:{this.state=ce.RAWTEXT_LESS_THAN_SIGN;break}case ae.NULL:{this._err(Je.unexpectedNullCharacter),this._emitChars(Gr);break}case ae.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case ae.LESS_THAN_SIGN:{this.state=ce.SCRIPT_DATA_LESS_THAN_SIGN;break}case ae.NULL:{this._err(Je.unexpectedNullCharacter),this._emitChars(Gr);break}case ae.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case ae.NULL:{this._err(Je.unexpectedNullCharacter),this._emitChars(Gr);break}case ae.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Ox(e))this._createStartTagToken(),this.state=ce.TAG_NAME,this._stateTagName(e);else switch(e){case ae.EXCLAMATION_MARK:{this.state=ce.MARKUP_DECLARATION_OPEN;break}case ae.SOLIDUS:{this.state=ce.END_TAG_OPEN;break}case ae.QUESTION_MARK:{this._err(Je.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=ce.BOGUS_COMMENT,this._stateBogusComment(e);break}case ae.EOF:{this._err(Je.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Je.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=ce.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Ox(e))this._createEndTagToken(),this.state=ce.TAG_NAME,this._stateTagName(e);else switch(e){case ae.GREATER_THAN_SIGN:{this._err(Je.missingEndTagName),this.state=ce.DATA;break}case ae.EOF:{this._err(Je.eofBeforeTagName),this._emitChars(""),this._emitEOFToken();break}default:this._err(Je.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=ce.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const t=this.currentToken;switch(e){case ae.SPACE:case ae.LINE_FEED:case ae.TABULATION:case ae.FORM_FEED:{this.state=ce.BEFORE_ATTRIBUTE_NAME;break}case ae.SOLIDUS:{this.state=ce.SELF_CLOSING_START_TAG;break}case ae.GREATER_THAN_SIGN:{this.state=ce.DATA,this.emitCurrentTagToken();break}case ae.NULL:{this._err(Je.unexpectedNullCharacter),t.tagName+=Gr;break}case ae.EOF:{this._err(Je.eofInTag),this._emitEOFToken();break}default:t.tagName+=String.fromCodePoint(p2(e)?x5(e):e)}}_stateRcdataLessThanSign(e){e===ae.SOLIDUS?this.state=ce.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=ce.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Ox(e)?(this.state=ce.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(""),this.state=ce.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case ae.SPACE:case ae.LINE_FEED:case ae.TABULATION:case ae.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=ce.BEFORE_ATTRIBUTE_NAME,!1;case ae.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=ce.SELF_CLOSING_START_TAG,!1;case ae.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=ce.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(""),this.state=ce.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===ae.SOLIDUS?this.state=ce.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=ce.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Ox(e)?(this.state=ce.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(""),this.state=ce.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(""),this.state=ce.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case ae.SOLIDUS:{this.state=ce.SCRIPT_DATA_END_TAG_OPEN;break}case ae.EXCLAMATION_MARK:{this.state=ce.SCRIPT_DATA_ESCAPE_START,this._emitChars("");break}case ae.NULL:{this._err(Je.unexpectedNullCharacter),this.state=ce.SCRIPT_DATA_ESCAPED,this._emitChars(Gr);break}case ae.EOF:{this._err(Je.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=ce.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===ae.SOLIDUS?this.state=ce.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ox(e)?(this._emitChars("<"),this.state=ce.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=ce.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Ox(e)?(this.state=ce.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(""),this.state=ce.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(""),this.state=ce.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Jc.SCRIPT,!1)&&tpe(this.preprocessor.peek(Jc.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t");break}case ae.NULL:{this._err(Je.unexpectedNullCharacter),this.state=ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Gr);break}case ae.EOF:{this._err(Je.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===ae.SOLIDUS?(this.state=ce.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Jc.SCRIPT,!1)&&tpe(this.preprocessor.peek(Jc.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){const n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){const s=this._indexOf(e)+1;this.items.splice(s,0,t),this.tagIDs.splice(s,0,n),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==bt.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){const n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(AQe,bt.HTML)}clearBackToTableBodyContext(){this.clearBackTo(IQe,bt.HTML)}clearBackToTableRowContext(){this.clearBackTo(TQe,bt.HTML)}remove(e){const t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===O.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===O.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){const s=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case bt.HTML:{if(s===e)return!0;if(t.has(s))return!1;break}case bt.SVG:{if(spe.has(s))return!1;break}case bt.MATHML:{if(ipe.has(s))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Lj)}hasInListItemScope(e){return this.hasInDynamicScope(e,LQe)}hasInButtonScope(e){return this.hasInDynamicScope(e,DQe)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case bt.HTML:{if(IG.has(t))return!0;if(Lj.has(t))return!1;break}case bt.SVG:{if(spe.has(t))return!1;break}case bt.MATHML:{if(ipe.has(t))return!1;break}}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===bt.HTML)switch(this.tagIDs[t]){case e:return!0;case O.TABLE:case O.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===bt.HTML)switch(this.tagIDs[e]){case O.TBODY:case O.THEAD:case O.TFOOT:return!0;case O.TABLE:case O.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===bt.HTML)switch(this.tagIDs[t]){case e:return!0;case O.OPTION:case O.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&ANe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&npe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&npe.has(this.currentTagId);)this.pop()}}const yU=3;var wf;(function(i){i[i.Marker=0]="Marker",i[i.Element=1]="Element"})(wf||(wf={}));const rpe={type:wf.Marker};class PQe{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){const n=[],s=t.length,r=this.treeAdapter.getTagName(e),o=this.treeAdapter.getNamespaceURI(e);for(let a=0;a[o.name,o.value]));let r=0;for(let o=0;os.get(l.name)===l.value)&&(r+=1,r>=yU&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(rpe)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:wf.Element,element:e,token:t})}insertElementAfterBookmark(e,t){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:wf.Element,element:e,token:t})}removeEntry(e){const t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){const e=this.entries.indexOf(rpe);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const t=this.entries.find(n=>n.type===wf.Marker||this.treeAdapter.getTagName(n.element)===e);return t&&t.type===wf.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===wf.Element&&t.element===e)}}const jx={createDocument(){return{nodeName:"#document",mode:hh.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(i,e,t){return{nodeName:i,tagName:i,attrs:t,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(i){return{nodeName:"#comment",data:i,parentNode:null}},createTextNode(i){return{nodeName:"#text",value:i,parentNode:null}},appendChild(i,e){i.childNodes.push(e),e.parentNode=i},insertBefore(i,e,t){const n=i.childNodes.indexOf(t);i.childNodes.splice(n,0,e),e.parentNode=i},setTemplateContent(i,e){i.content=e},getTemplateContent(i){return i.content},setDocumentType(i,e,t,n){const s=i.childNodes.find(r=>r.nodeName==="#documentType");if(s)s.name=e,s.publicId=t,s.systemId=n;else{const r={nodeName:"#documentType",name:e,publicId:t,systemId:n,parentNode:null};jx.appendChild(i,r)}},setDocumentMode(i,e){i.mode=e},getDocumentMode(i){return i.mode},detachNode(i){if(i.parentNode){const e=i.parentNode.childNodes.indexOf(i);i.parentNode.childNodes.splice(e,1),i.parentNode=null}},insertText(i,e){if(i.childNodes.length>0){const t=i.childNodes[i.childNodes.length-1];if(jx.isTextNode(t)){t.value+=e;return}}jx.appendChild(i,jx.createTextNode(e))},insertTextBefore(i,e,t){const n=i.childNodes[i.childNodes.indexOf(t)-1];n&&jx.isTextNode(n)?n.value+=e:jx.insertBefore(i,jx.createTextNode(e),t)},adoptAttributes(i,e){const t=new Set(i.attrs.map(n=>n.name));for(let n=0;ni.startsWith(t))}function WQe(i){return i.name===RNe&&i.publicId===null&&(i.systemId===null||i.systemId===OQe)}function VQe(i){if(i.name!==RNe)return hh.QUIRKS;const{systemId:e}=i;if(e&&e.toLowerCase()===jQe)return hh.QUIRKS;let{publicId:t}=i;if(t!==null){if(t=t.toLowerCase(),BQe.has(t))return hh.QUIRKS;let n=e===null?FQe:MNe;if(ope(t,n))return hh.QUIRKS;if(n=e===null?PNe:HQe,ope(t,n))return hh.LIMITED_QUIRKS}return hh.NO_QUIRKS}const ape={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},zQe="definitionurl",UQe="definitionURL",$Qe=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(i=>[i.toLowerCase(),i])),qQe=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:bt.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:bt.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:bt.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:bt.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:bt.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:bt.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:bt.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:bt.XML}],["xml:space",{prefix:"xml",name:"space",namespace:bt.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:bt.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:bt.XMLNS}]]),KQe=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(i=>[i.toLowerCase(),i])),GQe=new Set([O.B,O.BIG,O.BLOCKQUOTE,O.BODY,O.BR,O.CENTER,O.CODE,O.DD,O.DIV,O.DL,O.DT,O.EM,O.EMBED,O.H1,O.H2,O.H3,O.H4,O.H5,O.H6,O.HEAD,O.HR,O.I,O.IMG,O.LI,O.LISTING,O.MENU,O.META,O.NOBR,O.OL,O.P,O.PRE,O.RUBY,O.S,O.SMALL,O.SPAN,O.STRONG,O.STRIKE,O.SUB,O.SUP,O.TABLE,O.TT,O.U,O.UL,O.VAR]);function YQe(i){const e=i.tagID;return e===O.FONT&&i.attrs.some(({name:n})=>n===d1.COLOR||n===d1.SIZE||n===d1.FACE)||GQe.has(e)}function ONe(i){for(let e=0;e0&&this._setContextModes(e,t)}onItemPop(e,t){var n,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(s=(n=this.treeAdapter).onItemPop)===null||s===void 0||s.call(n,e,this.openElements.current),t){let r,o;this.openElements.stackTop===0&&this.fragmentContext?(r=this.fragmentContext,o=this.fragmentContextID):{current:r,currentTagId:o}=this.openElements,this._setContextModes(r,o)}}_setContextModes(e,t){const n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===bt.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,bt.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=fe.TEXT}switchToPlaintextParsing(){this.insertionMode=fe.TEXT,this.originalInsertionMode=fe.IN_BODY,this.tokenizer.state=Bo.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===Me.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==bt.HTML))switch(this.fragmentContextID){case O.TITLE:case O.TEXTAREA:{this.tokenizer.state=Bo.RCDATA;break}case O.STYLE:case O.XMP:case O.IFRAME:case O.NOEMBED:case O.NOFRAMES:case O.NOSCRIPT:{this.tokenizer.state=Bo.RAWTEXT;break}case O.SCRIPT:{this.tokenizer.state=Bo.SCRIPT_DATA;break}case O.PLAINTEXT:{this.tokenizer.state=Bo.PLAINTEXT;break}}}_setDocumentType(e){const t=e.name||"",n=e.publicId||"",s=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,t,n,s),e.location){const o=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));o&&this.treeAdapter.setNodeSourceCodeLocation(o,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){const n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const n=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(n??this.document,e)}}_appendElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){const n=this.treeAdapter.createElement(e,bt.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,bt.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(Me.HTML,bt.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,O.HTML)}_appendCommentNode(e,t){const n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;const s=this.treeAdapter.getChildNodes(t),r=n?s.lastIndexOf(n):s.length,o=s[r-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:l,endCol:c,endOffset:u}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:l,endCol:c,endOffset:u})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const n=t.location,s=this.treeAdapter.getTagName(e),r=t.type===Di.END_TAG&&s===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,r)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===O.SVG&&this.treeAdapter.getTagName(t)===Me.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===bt.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===O.MGLYPH||e.tagID===O.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,bt.HTML)}_processToken(e){switch(e.type){case Di.CHARACTER:{this.onCharacter(e);break}case Di.NULL_CHARACTER:{this.onNullCharacter(e);break}case Di.COMMENT:{this.onComment(e);break}case Di.DOCTYPE:{this.onDoctype(e);break}case Di.START_TAG:{this._processStartTag(e);break}case Di.END_TAG:{this.onEndTag(e);break}case Di.EOF:{this.onEof(e);break}case Di.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,t,n){const s=this.treeAdapter.getNamespaceURI(t),r=this.treeAdapter.getAttrList(t);return JQe(e,s,r,n)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const t=this.activeFormattingElements.entries.findIndex(s=>s.type===wf.Marker||this.openElements.contains(s.element)),n=t===-1?e-1:t-1;for(let s=n;s>=0;s--){const r=this.activeFormattingElements.entries[s];this._insertElement(r.token,this.treeAdapter.getNamespaceURI(r.element)),r.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=fe.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(O.P),this.openElements.popUntilTagNamePopped(O.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case O.TR:{this.insertionMode=fe.IN_ROW;return}case O.TBODY:case O.THEAD:case O.TFOOT:{this.insertionMode=fe.IN_TABLE_BODY;return}case O.CAPTION:{this.insertionMode=fe.IN_CAPTION;return}case O.COLGROUP:{this.insertionMode=fe.IN_COLUMN_GROUP;return}case O.TABLE:{this.insertionMode=fe.IN_TABLE;return}case O.BODY:{this.insertionMode=fe.IN_BODY;return}case O.FRAMESET:{this.insertionMode=fe.IN_FRAMESET;return}case O.SELECT:{this._resetInsertionModeForSelect(e);return}case O.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case O.HTML:{this.insertionMode=this.headElement?fe.AFTER_HEAD:fe.BEFORE_HEAD;return}case O.TD:case O.TH:{if(e>0){this.insertionMode=fe.IN_CELL;return}break}case O.HEAD:{if(e>0){this.insertionMode=fe.IN_HEAD;return}break}}this.insertionMode=fe.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const n=this.openElements.tagIDs[t];if(n===O.TEMPLATE)break;if(n===O.TABLE){this.insertionMode=fe.IN_SELECT_IN_TABLE;return}}this.insertionMode=fe.IN_SELECT}_isElementCausesFosterParenting(e){return FNe.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case O.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(t)===bt.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break}case O.TABLE:{const n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){const n=this.treeAdapter.getNamespaceURI(e);return CQe[n].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){RZe(this,e);return}switch(this.insertionMode){case fe.INITIAL:{_T(this,e);break}case fe.BEFORE_HTML:{W2(this,e);break}case fe.BEFORE_HEAD:{V2(this,e);break}case fe.IN_HEAD:{z2(this,e);break}case fe.IN_HEAD_NO_SCRIPT:{U2(this,e);break}case fe.AFTER_HEAD:{$2(this,e);break}case fe.IN_BODY:case fe.IN_CAPTION:case fe.IN_CELL:case fe.IN_TEMPLATE:{HNe(this,e);break}case fe.TEXT:case fe.IN_SELECT:case fe.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case fe.IN_TABLE:case fe.IN_TABLE_BODY:case fe.IN_ROW:{wU(this,e);break}case fe.IN_TABLE_TEXT:{qNe(this,e);break}case fe.IN_COLUMN_GROUP:{Dj(this,e);break}case fe.AFTER_BODY:{Tj(this,e);break}case fe.AFTER_AFTER_BODY:{y4(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){AZe(this,e);return}switch(this.insertionMode){case fe.INITIAL:{_T(this,e);break}case fe.BEFORE_HTML:{W2(this,e);break}case fe.BEFORE_HEAD:{V2(this,e);break}case fe.IN_HEAD:{z2(this,e);break}case fe.IN_HEAD_NO_SCRIPT:{U2(this,e);break}case fe.AFTER_HEAD:{$2(this,e);break}case fe.TEXT:{this._insertCharacters(e);break}case fe.IN_TABLE:case fe.IN_TABLE_BODY:case fe.IN_ROW:{wU(this,e);break}case fe.IN_COLUMN_GROUP:{Dj(this,e);break}case fe.AFTER_BODY:{Tj(this,e);break}case fe.AFTER_AFTER_BODY:{y4(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){AG(this,e);return}switch(this.insertionMode){case fe.INITIAL:case fe.BEFORE_HTML:case fe.BEFORE_HEAD:case fe.IN_HEAD:case fe.IN_HEAD_NO_SCRIPT:case fe.AFTER_HEAD:case fe.IN_BODY:case fe.IN_TABLE:case fe.IN_CAPTION:case fe.IN_COLUMN_GROUP:case fe.IN_TABLE_BODY:case fe.IN_ROW:case fe.IN_CELL:case fe.IN_SELECT:case fe.IN_SELECT_IN_TABLE:case fe.IN_TEMPLATE:case fe.IN_FRAMESET:case fe.AFTER_FRAMESET:{AG(this,e);break}case fe.IN_TABLE_TEXT:{yT(this,e);break}case fe.AFTER_BODY:{dXe(this,e);break}case fe.AFTER_AFTER_BODY:case fe.AFTER_AFTER_FRAMESET:{uXe(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case fe.INITIAL:{hXe(this,e);break}case fe.BEFORE_HEAD:case fe.IN_HEAD:case fe.IN_HEAD_NO_SCRIPT:case fe.AFTER_HEAD:{this._err(e,Je.misplacedDoctype);break}case fe.IN_TABLE_TEXT:{yT(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,Je.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?MZe(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case fe.INITIAL:{_T(this,e);break}case fe.BEFORE_HTML:{gXe(this,e);break}case fe.BEFORE_HEAD:{pXe(this,e);break}case fe.IN_HEAD:{Pg(this,e);break}case fe.IN_HEAD_NO_SCRIPT:{xXe(this,e);break}case fe.AFTER_HEAD:{_Xe(this,e);break}case fe.IN_BODY:{dc(this,e);break}case fe.IN_TABLE:{HE(this,e);break}case fe.IN_TABLE_TEXT:{yT(this,e);break}case fe.IN_CAPTION:{mZe(this,e);break}case fe.IN_COLUMN_GROUP:{Nse(this,e);break}case fe.IN_TABLE_BODY:{N7(this,e);break}case fe.IN_ROW:{E7(this,e);break}case fe.IN_CELL:{vZe(this,e);break}case fe.IN_SELECT:{YNe(this,e);break}case fe.IN_SELECT_IN_TABLE:{yZe(this,e);break}case fe.IN_TEMPLATE:{CZe(this,e);break}case fe.AFTER_BODY:{kZe(this,e);break}case fe.IN_FRAMESET:{NZe(this,e);break}case fe.AFTER_FRAMESET:{LZe(this,e);break}case fe.AFTER_AFTER_BODY:{TZe(this,e);break}case fe.AFTER_AFTER_FRAMESET:{IZe(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?PZe(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case fe.INITIAL:{_T(this,e);break}case fe.BEFORE_HTML:{fXe(this,e);break}case fe.BEFORE_HEAD:{mXe(this,e);break}case fe.IN_HEAD:{bXe(this,e);break}case fe.IN_HEAD_NO_SCRIPT:{vXe(this,e);break}case fe.AFTER_HEAD:{yXe(this,e);break}case fe.IN_BODY:{k7(this,e);break}case fe.TEXT:{oZe(this,e);break}case fe.IN_TABLE:{_A(this,e);break}case fe.IN_TABLE_TEXT:{yT(this,e);break}case fe.IN_CAPTION:{bZe(this,e);break}case fe.IN_COLUMN_GROUP:{xZe(this,e);break}case fe.IN_TABLE_BODY:{RG(this,e);break}case fe.IN_ROW:{GNe(this,e);break}case fe.IN_CELL:{_Ze(this,e);break}case fe.IN_SELECT:{QNe(this,e);break}case fe.IN_SELECT_IN_TABLE:{wZe(this,e);break}case fe.IN_TEMPLATE:{SZe(this,e);break}case fe.AFTER_BODY:{ZNe(this,e);break}case fe.IN_FRAMESET:{EZe(this,e);break}case fe.AFTER_FRAMESET:{DZe(this,e);break}case fe.AFTER_AFTER_BODY:{y4(this,e);break}}}onEof(e){switch(this.insertionMode){case fe.INITIAL:{_T(this,e);break}case fe.BEFORE_HTML:{W2(this,e);break}case fe.BEFORE_HEAD:{V2(this,e);break}case fe.IN_HEAD:{z2(this,e);break}case fe.IN_HEAD_NO_SCRIPT:{U2(this,e);break}case fe.AFTER_HEAD:{$2(this,e);break}case fe.IN_BODY:case fe.IN_TABLE:case fe.IN_CAPTION:case fe.IN_COLUMN_GROUP:case fe.IN_TABLE_BODY:case fe.IN_ROW:case fe.IN_CELL:case fe.IN_SELECT:case fe.IN_SELECT_IN_TABLE:{UNe(this,e);break}case fe.TEXT:{aZe(this,e);break}case fe.IN_TABLE_TEXT:{yT(this,e);break}case fe.IN_TEMPLATE:{XNe(this,e);break}case fe.AFTER_BODY:case fe.IN_FRAMESET:case fe.AFTER_FRAMESET:case fe.AFTER_AFTER_BODY:case fe.AFTER_AFTER_FRAMESET:{kse(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===ae.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case fe.IN_HEAD:case fe.IN_HEAD_NO_SCRIPT:case fe.AFTER_HEAD:case fe.TEXT:case fe.IN_COLUMN_GROUP:case fe.IN_SELECT:case fe.IN_SELECT_IN_TABLE:case fe.IN_FRAMESET:case fe.AFTER_FRAMESET:{this._insertCharacters(e);break}case fe.IN_BODY:case fe.IN_CAPTION:case fe.IN_CELL:case fe.IN_TEMPLATE:case fe.AFTER_BODY:case fe.AFTER_AFTER_BODY:case fe.AFTER_AFTER_FRAMESET:{BNe(this,e);break}case fe.IN_TABLE:case fe.IN_TABLE_BODY:case fe.IN_ROW:{wU(this,e);break}case fe.IN_TABLE_TEXT:{$Ne(this,e);break}}}};function sXe(i,e){let t=i.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return t?i.openElements.contains(t.element)?i.openElements.hasInScope(e.tagID)||(t=null):(i.activeFormattingElements.removeEntry(t),t=null):zNe(i,e),t}function rXe(i,e){let t=null,n=i.openElements.stackTop;for(;n>=0;n--){const s=i.openElements.items[n];if(s===e.element)break;i._isSpecialElement(s,i.openElements.tagIDs[n])&&(t=s)}return t||(i.openElements.shortenToLength(Math.max(n,0)),i.activeFormattingElements.removeEntry(e)),t}function oXe(i,e,t){let n=e,s=i.openElements.getCommonAncestor(e);for(let r=0,o=s;o!==t;r++,o=s){s=i.openElements.getCommonAncestor(o);const a=i.activeFormattingElements.getElementEntry(o),l=a&&r>=nXe;!a||l?(l&&i.activeFormattingElements.removeEntry(a),i.openElements.remove(o)):(o=aXe(i,a),n===e&&(i.activeFormattingElements.bookmark=a),i.treeAdapter.detachNode(n),i.treeAdapter.appendChild(o,n),n=o)}return n}function aXe(i,e){const t=i.treeAdapter.getNamespaceURI(e.element),n=i.treeAdapter.createElement(e.token.tagName,t,e.token.attrs);return i.openElements.replace(e.element,n),e.element=n,n}function lXe(i,e,t){const n=i.treeAdapter.getTagName(e),s=HL(n);if(i._isElementCausesFosterParenting(s))i._fosterParentElement(t);else{const r=i.treeAdapter.getNamespaceURI(e);s===O.TEMPLATE&&r===bt.HTML&&(e=i.treeAdapter.getTemplateContent(e)),i.treeAdapter.appendChild(e,t)}}function cXe(i,e,t){const n=i.treeAdapter.getNamespaceURI(t.element),{token:s}=t,r=i.treeAdapter.createElement(s.tagName,n,s.attrs);i._adoptNodes(e,r),i.treeAdapter.appendChild(e,r),i.activeFormattingElements.insertElementAfterBookmark(r,s),i.activeFormattingElements.removeEntry(t),i.openElements.remove(t.element),i.openElements.insertAfter(e,r,s.tagID)}function Sse(i,e){for(let t=0;t=t;n--)i._setEndLocation(i.openElements.items[n],e);if(!i.fragmentContext&&i.openElements.stackTop>=0){const n=i.openElements.items[0],s=i.treeAdapter.getNodeSourceCodeLocation(n);if(s&&!s.endTag&&(i._setEndLocation(n,e),i.openElements.stackTop>=1)){const r=i.openElements.items[1],o=i.treeAdapter.getNodeSourceCodeLocation(r);o&&!o.endTag&&i._setEndLocation(r,e)}}}}function hXe(i,e){i._setDocumentType(e);const t=e.forceQuirks?hh.QUIRKS:VQe(e);WQe(e)||i._err(e,Je.nonConformingDoctype),i.treeAdapter.setDocumentMode(i.document,t),i.insertionMode=fe.BEFORE_HTML}function _T(i,e){i._err(e,Je.missingDoctype,!0),i.treeAdapter.setDocumentMode(i.document,hh.QUIRKS),i.insertionMode=fe.BEFORE_HTML,i._processToken(e)}function gXe(i,e){e.tagID===O.HTML?(i._insertElement(e,bt.HTML),i.insertionMode=fe.BEFORE_HEAD):W2(i,e)}function fXe(i,e){const t=e.tagID;(t===O.HTML||t===O.HEAD||t===O.BODY||t===O.BR)&&W2(i,e)}function W2(i,e){i._insertFakeRootElement(),i.insertionMode=fe.BEFORE_HEAD,i._processToken(e)}function pXe(i,e){switch(e.tagID){case O.HTML:{dc(i,e);break}case O.HEAD:{i._insertElement(e,bt.HTML),i.headElement=i.openElements.current,i.insertionMode=fe.IN_HEAD;break}default:V2(i,e)}}function mXe(i,e){const t=e.tagID;t===O.HEAD||t===O.BODY||t===O.HTML||t===O.BR?V2(i,e):i._err(e,Je.endTagWithoutMatchingOpenElement)}function V2(i,e){i._insertFakeElement(Me.HEAD,O.HEAD),i.headElement=i.openElements.current,i.insertionMode=fe.IN_HEAD,i._processToken(e)}function Pg(i,e){switch(e.tagID){case O.HTML:{dc(i,e);break}case O.BASE:case O.BASEFONT:case O.BGSOUND:case O.LINK:case O.META:{i._appendElement(e,bt.HTML),e.ackSelfClosing=!0;break}case O.TITLE:{i._switchToTextParsing(e,Bo.RCDATA);break}case O.NOSCRIPT:{i.options.scriptingEnabled?i._switchToTextParsing(e,Bo.RAWTEXT):(i._insertElement(e,bt.HTML),i.insertionMode=fe.IN_HEAD_NO_SCRIPT);break}case O.NOFRAMES:case O.STYLE:{i._switchToTextParsing(e,Bo.RAWTEXT);break}case O.SCRIPT:{i._switchToTextParsing(e,Bo.SCRIPT_DATA);break}case O.TEMPLATE:{i._insertTemplate(e),i.activeFormattingElements.insertMarker(),i.framesetOk=!1,i.insertionMode=fe.IN_TEMPLATE,i.tmplInsertionModeStack.unshift(fe.IN_TEMPLATE);break}case O.HEAD:{i._err(e,Je.misplacedStartTagForHeadElement);break}default:z2(i,e)}}function bXe(i,e){switch(e.tagID){case O.HEAD:{i.openElements.pop(),i.insertionMode=fe.AFTER_HEAD;break}case O.BODY:case O.BR:case O.HTML:{z2(i,e);break}case O.TEMPLATE:{yC(i,e);break}default:i._err(e,Je.endTagWithoutMatchingOpenElement)}}function yC(i,e){i.openElements.tmplCount>0?(i.openElements.generateImpliedEndTagsThoroughly(),i.openElements.currentTagId!==O.TEMPLATE&&i._err(e,Je.closingOfElementWithOpenChildElements),i.openElements.popUntilTagNamePopped(O.TEMPLATE),i.activeFormattingElements.clearToLastMarker(),i.tmplInsertionModeStack.shift(),i._resetInsertionMode()):i._err(e,Je.endTagWithoutMatchingOpenElement)}function z2(i,e){i.openElements.pop(),i.insertionMode=fe.AFTER_HEAD,i._processToken(e)}function xXe(i,e){switch(e.tagID){case O.HTML:{dc(i,e);break}case O.BASEFONT:case O.BGSOUND:case O.HEAD:case O.LINK:case O.META:case O.NOFRAMES:case O.STYLE:{Pg(i,e);break}case O.NOSCRIPT:{i._err(e,Je.nestedNoscriptInHead);break}default:U2(i,e)}}function vXe(i,e){switch(e.tagID){case O.NOSCRIPT:{i.openElements.pop(),i.insertionMode=fe.IN_HEAD;break}case O.BR:{U2(i,e);break}default:i._err(e,Je.endTagWithoutMatchingOpenElement)}}function U2(i,e){const t=e.type===Di.EOF?Je.openElementsLeftAfterEof:Je.disallowedContentInNoscriptInHead;i._err(e,t),i.openElements.pop(),i.insertionMode=fe.IN_HEAD,i._processToken(e)}function _Xe(i,e){switch(e.tagID){case O.HTML:{dc(i,e);break}case O.BODY:{i._insertElement(e,bt.HTML),i.framesetOk=!1,i.insertionMode=fe.IN_BODY;break}case O.FRAMESET:{i._insertElement(e,bt.HTML),i.insertionMode=fe.IN_FRAMESET;break}case O.BASE:case O.BASEFONT:case O.BGSOUND:case O.LINK:case O.META:case O.NOFRAMES:case O.SCRIPT:case O.STYLE:case O.TEMPLATE:case O.TITLE:{i._err(e,Je.abandonedHeadElementChild),i.openElements.push(i.headElement,O.HEAD),Pg(i,e),i.openElements.remove(i.headElement);break}case O.HEAD:{i._err(e,Je.misplacedStartTagForHeadElement);break}default:$2(i,e)}}function yXe(i,e){switch(e.tagID){case O.BODY:case O.HTML:case O.BR:{$2(i,e);break}case O.TEMPLATE:{yC(i,e);break}default:i._err(e,Je.endTagWithoutMatchingOpenElement)}}function $2(i,e){i._insertFakeElement(Me.BODY,O.BODY),i.insertionMode=fe.IN_BODY,S7(i,e)}function S7(i,e){switch(e.type){case Di.CHARACTER:{HNe(i,e);break}case Di.WHITESPACE_CHARACTER:{BNe(i,e);break}case Di.COMMENT:{AG(i,e);break}case Di.START_TAG:{dc(i,e);break}case Di.END_TAG:{k7(i,e);break}case Di.EOF:{UNe(i,e);break}}}function BNe(i,e){i._reconstructActiveFormattingElements(),i._insertCharacters(e)}function HNe(i,e){i._reconstructActiveFormattingElements(),i._insertCharacters(e),i.framesetOk=!1}function wXe(i,e){i.openElements.tmplCount===0&&i.treeAdapter.adoptAttributes(i.openElements.items[0],e.attrs)}function CXe(i,e){const t=i.openElements.tryPeekProperlyNestedBodyElement();t&&i.openElements.tmplCount===0&&(i.framesetOk=!1,i.treeAdapter.adoptAttributes(t,e.attrs))}function SXe(i,e){const t=i.openElements.tryPeekProperlyNestedBodyElement();i.framesetOk&&t&&(i.treeAdapter.detachNode(t),i.openElements.popAllUpToHtmlElement(),i._insertElement(e,bt.HTML),i.insertionMode=fe.IN_FRAMESET)}function kXe(i,e){i.openElements.hasInButtonScope(O.P)&&i._closePElement(),i._insertElement(e,bt.HTML)}function NXe(i,e){i.openElements.hasInButtonScope(O.P)&&i._closePElement(),i.openElements.currentTagId!==void 0&&IG.has(i.openElements.currentTagId)&&i.openElements.pop(),i._insertElement(e,bt.HTML)}function EXe(i,e){i.openElements.hasInButtonScope(O.P)&&i._closePElement(),i._insertElement(e,bt.HTML),i.skipNextNewLine=!0,i.framesetOk=!1}function LXe(i,e){const t=i.openElements.tmplCount>0;(!i.formElement||t)&&(i.openElements.hasInButtonScope(O.P)&&i._closePElement(),i._insertElement(e,bt.HTML),t||(i.formElement=i.openElements.current))}function DXe(i,e){i.framesetOk=!1;const t=e.tagID;for(let n=i.openElements.stackTop;n>=0;n--){const s=i.openElements.tagIDs[n];if(t===O.LI&&s===O.LI||(t===O.DD||t===O.DT)&&(s===O.DD||s===O.DT)){i.openElements.generateImpliedEndTagsWithExclusion(s),i.openElements.popUntilTagNamePopped(s);break}if(s!==O.ADDRESS&&s!==O.DIV&&s!==O.P&&i._isSpecialElement(i.openElements.items[n],s))break}i.openElements.hasInButtonScope(O.P)&&i._closePElement(),i._insertElement(e,bt.HTML)}function TXe(i,e){i.openElements.hasInButtonScope(O.P)&&i._closePElement(),i._insertElement(e,bt.HTML),i.tokenizer.state=Bo.PLAINTEXT}function IXe(i,e){i.openElements.hasInScope(O.BUTTON)&&(i.openElements.generateImpliedEndTags(),i.openElements.popUntilTagNamePopped(O.BUTTON)),i._reconstructActiveFormattingElements(),i._insertElement(e,bt.HTML),i.framesetOk=!1}function AXe(i,e){const t=i.activeFormattingElements.getElementEntryInScopeWithTagName(Me.A);t&&(Sse(i,e),i.openElements.remove(t.element),i.activeFormattingElements.removeEntry(t)),i._reconstructActiveFormattingElements(),i._insertElement(e,bt.HTML),i.activeFormattingElements.pushElement(i.openElements.current,e)}function RXe(i,e){i._reconstructActiveFormattingElements(),i._insertElement(e,bt.HTML),i.activeFormattingElements.pushElement(i.openElements.current,e)}function MXe(i,e){i._reconstructActiveFormattingElements(),i.openElements.hasInScope(O.NOBR)&&(Sse(i,e),i._reconstructActiveFormattingElements()),i._insertElement(e,bt.HTML),i.activeFormattingElements.pushElement(i.openElements.current,e)}function PXe(i,e){i._reconstructActiveFormattingElements(),i._insertElement(e,bt.HTML),i.activeFormattingElements.insertMarker(),i.framesetOk=!1}function OXe(i,e){i.treeAdapter.getDocumentMode(i.document)!==hh.QUIRKS&&i.openElements.hasInButtonScope(O.P)&&i._closePElement(),i._insertElement(e,bt.HTML),i.framesetOk=!1,i.insertionMode=fe.IN_TABLE}function WNe(i,e){i._reconstructActiveFormattingElements(),i._appendElement(e,bt.HTML),i.framesetOk=!1,e.ackSelfClosing=!0}function VNe(i){const e=TNe(i,d1.TYPE);return e!=null&&e.toLowerCase()===eXe}function jXe(i,e){i._reconstructActiveFormattingElements(),i._appendElement(e,bt.HTML),VNe(e)||(i.framesetOk=!1),e.ackSelfClosing=!0}function FXe(i,e){i._appendElement(e,bt.HTML),e.ackSelfClosing=!0}function BXe(i,e){i.openElements.hasInButtonScope(O.P)&&i._closePElement(),i._appendElement(e,bt.HTML),i.framesetOk=!1,e.ackSelfClosing=!0}function HXe(i,e){e.tagName=Me.IMG,e.tagID=O.IMG,WNe(i,e)}function WXe(i,e){i._insertElement(e,bt.HTML),i.skipNextNewLine=!0,i.tokenizer.state=Bo.RCDATA,i.originalInsertionMode=i.insertionMode,i.framesetOk=!1,i.insertionMode=fe.TEXT}function VXe(i,e){i.openElements.hasInButtonScope(O.P)&&i._closePElement(),i._reconstructActiveFormattingElements(),i.framesetOk=!1,i._switchToTextParsing(e,Bo.RAWTEXT)}function zXe(i,e){i.framesetOk=!1,i._switchToTextParsing(e,Bo.RAWTEXT)}function dpe(i,e){i._switchToTextParsing(e,Bo.RAWTEXT)}function UXe(i,e){i._reconstructActiveFormattingElements(),i._insertElement(e,bt.HTML),i.framesetOk=!1,i.insertionMode=i.insertionMode===fe.IN_TABLE||i.insertionMode===fe.IN_CAPTION||i.insertionMode===fe.IN_TABLE_BODY||i.insertionMode===fe.IN_ROW||i.insertionMode===fe.IN_CELL?fe.IN_SELECT_IN_TABLE:fe.IN_SELECT}function $Xe(i,e){i.openElements.currentTagId===O.OPTION&&i.openElements.pop(),i._reconstructActiveFormattingElements(),i._insertElement(e,bt.HTML)}function qXe(i,e){i.openElements.hasInScope(O.RUBY)&&i.openElements.generateImpliedEndTags(),i._insertElement(e,bt.HTML)}function KXe(i,e){i.openElements.hasInScope(O.RUBY)&&i.openElements.generateImpliedEndTagsWithExclusion(O.RTC),i._insertElement(e,bt.HTML)}function GXe(i,e){i._reconstructActiveFormattingElements(),ONe(e),Cse(e),e.selfClosing?i._appendElement(e,bt.MATHML):i._insertElement(e,bt.MATHML),e.ackSelfClosing=!0}function YXe(i,e){i._reconstructActiveFormattingElements(),jNe(e),Cse(e),e.selfClosing?i._appendElement(e,bt.SVG):i._insertElement(e,bt.SVG),e.ackSelfClosing=!0}function upe(i,e){i._reconstructActiveFormattingElements(),i._insertElement(e,bt.HTML)}function dc(i,e){switch(e.tagID){case O.I:case O.S:case O.B:case O.U:case O.EM:case O.TT:case O.BIG:case O.CODE:case O.FONT:case O.SMALL:case O.STRIKE:case O.STRONG:{RXe(i,e);break}case O.A:{AXe(i,e);break}case O.H1:case O.H2:case O.H3:case O.H4:case O.H5:case O.H6:{NXe(i,e);break}case O.P:case O.DL:case O.OL:case O.UL:case O.DIV:case O.DIR:case O.NAV:case O.MAIN:case O.MENU:case O.ASIDE:case O.CENTER:case O.FIGURE:case O.FOOTER:case O.HEADER:case O.HGROUP:case O.DIALOG:case O.DETAILS:case O.ADDRESS:case O.ARTICLE:case O.SEARCH:case O.SECTION:case O.SUMMARY:case O.FIELDSET:case O.BLOCKQUOTE:case O.FIGCAPTION:{kXe(i,e);break}case O.LI:case O.DD:case O.DT:{DXe(i,e);break}case O.BR:case O.IMG:case O.WBR:case O.AREA:case O.EMBED:case O.KEYGEN:{WNe(i,e);break}case O.HR:{BXe(i,e);break}case O.RB:case O.RTC:{qXe(i,e);break}case O.RT:case O.RP:{KXe(i,e);break}case O.PRE:case O.LISTING:{EXe(i,e);break}case O.XMP:{VXe(i,e);break}case O.SVG:{YXe(i,e);break}case O.HTML:{wXe(i,e);break}case O.BASE:case O.LINK:case O.META:case O.STYLE:case O.TITLE:case O.SCRIPT:case O.BGSOUND:case O.BASEFONT:case O.TEMPLATE:{Pg(i,e);break}case O.BODY:{CXe(i,e);break}case O.FORM:{LXe(i,e);break}case O.NOBR:{MXe(i,e);break}case O.MATH:{GXe(i,e);break}case O.TABLE:{OXe(i,e);break}case O.INPUT:{jXe(i,e);break}case O.PARAM:case O.TRACK:case O.SOURCE:{FXe(i,e);break}case O.IMAGE:{HXe(i,e);break}case O.BUTTON:{IXe(i,e);break}case O.APPLET:case O.OBJECT:case O.MARQUEE:{PXe(i,e);break}case O.IFRAME:{zXe(i,e);break}case O.SELECT:{UXe(i,e);break}case O.OPTION:case O.OPTGROUP:{$Xe(i,e);break}case O.NOEMBED:case O.NOFRAMES:{dpe(i,e);break}case O.FRAMESET:{SXe(i,e);break}case O.TEXTAREA:{WXe(i,e);break}case O.NOSCRIPT:{i.options.scriptingEnabled?dpe(i,e):upe(i,e);break}case O.PLAINTEXT:{TXe(i,e);break}case O.COL:case O.TH:case O.TD:case O.TR:case O.HEAD:case O.FRAME:case O.TBODY:case O.TFOOT:case O.THEAD:case O.CAPTION:case O.COLGROUP:break;default:upe(i,e)}}function QXe(i,e){if(i.openElements.hasInScope(O.BODY)&&(i.insertionMode=fe.AFTER_BODY,i.options.sourceCodeLocationInfo)){const t=i.openElements.tryPeekProperlyNestedBodyElement();t&&i._setEndLocation(t,e)}}function XXe(i,e){i.openElements.hasInScope(O.BODY)&&(i.insertionMode=fe.AFTER_BODY,ZNe(i,e))}function ZXe(i,e){const t=e.tagID;i.openElements.hasInScope(t)&&(i.openElements.generateImpliedEndTags(),i.openElements.popUntilTagNamePopped(t))}function JXe(i){const e=i.openElements.tmplCount>0,{formElement:t}=i;e||(i.formElement=null),(t||e)&&i.openElements.hasInScope(O.FORM)&&(i.openElements.generateImpliedEndTags(),e?i.openElements.popUntilTagNamePopped(O.FORM):t&&i.openElements.remove(t))}function eZe(i){i.openElements.hasInButtonScope(O.P)||i._insertFakeElement(Me.P,O.P),i._closePElement()}function tZe(i){i.openElements.hasInListItemScope(O.LI)&&(i.openElements.generateImpliedEndTagsWithExclusion(O.LI),i.openElements.popUntilTagNamePopped(O.LI))}function nZe(i,e){const t=e.tagID;i.openElements.hasInScope(t)&&(i.openElements.generateImpliedEndTagsWithExclusion(t),i.openElements.popUntilTagNamePopped(t))}function iZe(i){i.openElements.hasNumberedHeaderInScope()&&(i.openElements.generateImpliedEndTags(),i.openElements.popUntilNumberedHeaderPopped())}function sZe(i,e){const t=e.tagID;i.openElements.hasInScope(t)&&(i.openElements.generateImpliedEndTags(),i.openElements.popUntilTagNamePopped(t),i.activeFormattingElements.clearToLastMarker())}function rZe(i){i._reconstructActiveFormattingElements(),i._insertFakeElement(Me.BR,O.BR),i.openElements.pop(),i.framesetOk=!1}function zNe(i,e){const t=e.tagName,n=e.tagID;for(let s=i.openElements.stackTop;s>0;s--){const r=i.openElements.items[s],o=i.openElements.tagIDs[s];if(n===o&&(n!==O.UNKNOWN||i.treeAdapter.getTagName(r)===t)){i.openElements.generateImpliedEndTagsWithExclusion(n),i.openElements.stackTop>=s&&i.openElements.shortenToLength(s);break}if(i._isSpecialElement(r,o))break}}function k7(i,e){switch(e.tagID){case O.A:case O.B:case O.I:case O.S:case O.U:case O.EM:case O.TT:case O.BIG:case O.CODE:case O.FONT:case O.NOBR:case O.SMALL:case O.STRIKE:case O.STRONG:{Sse(i,e);break}case O.P:{eZe(i);break}case O.DL:case O.UL:case O.OL:case O.DIR:case O.DIV:case O.NAV:case O.PRE:case O.MAIN:case O.MENU:case O.ASIDE:case O.BUTTON:case O.CENTER:case O.FIGURE:case O.FOOTER:case O.HEADER:case O.HGROUP:case O.DIALOG:case O.ADDRESS:case O.ARTICLE:case O.DETAILS:case O.SEARCH:case O.SECTION:case O.SUMMARY:case O.LISTING:case O.FIELDSET:case O.BLOCKQUOTE:case O.FIGCAPTION:{ZXe(i,e);break}case O.LI:{tZe(i);break}case O.DD:case O.DT:{nZe(i,e);break}case O.H1:case O.H2:case O.H3:case O.H4:case O.H5:case O.H6:{iZe(i);break}case O.BR:{rZe(i);break}case O.BODY:{QXe(i,e);break}case O.HTML:{XXe(i,e);break}case O.FORM:{JXe(i);break}case O.APPLET:case O.OBJECT:case O.MARQUEE:{sZe(i,e);break}case O.TEMPLATE:{yC(i,e);break}default:zNe(i,e)}}function UNe(i,e){i.tmplInsertionModeStack.length>0?XNe(i,e):kse(i,e)}function oZe(i,e){var t;e.tagID===O.SCRIPT&&((t=i.scriptHandler)===null||t===void 0||t.call(i,i.openElements.current)),i.openElements.pop(),i.insertionMode=i.originalInsertionMode}function aZe(i,e){i._err(e,Je.eofInElementThatCanContainOnlyText),i.openElements.pop(),i.insertionMode=i.originalInsertionMode,i.onEof(e)}function wU(i,e){if(i.openElements.currentTagId!==void 0&&FNe.has(i.openElements.currentTagId))switch(i.pendingCharacterTokens.length=0,i.hasNonWhitespacePendingCharacterToken=!1,i.originalInsertionMode=i.insertionMode,i.insertionMode=fe.IN_TABLE_TEXT,e.type){case Di.CHARACTER:{qNe(i,e);break}case Di.WHITESPACE_CHARACTER:{$Ne(i,e);break}}else UM(i,e)}function lZe(i,e){i.openElements.clearBackToTableContext(),i.activeFormattingElements.insertMarker(),i._insertElement(e,bt.HTML),i.insertionMode=fe.IN_CAPTION}function cZe(i,e){i.openElements.clearBackToTableContext(),i._insertElement(e,bt.HTML),i.insertionMode=fe.IN_COLUMN_GROUP}function dZe(i,e){i.openElements.clearBackToTableContext(),i._insertFakeElement(Me.COLGROUP,O.COLGROUP),i.insertionMode=fe.IN_COLUMN_GROUP,Nse(i,e)}function uZe(i,e){i.openElements.clearBackToTableContext(),i._insertElement(e,bt.HTML),i.insertionMode=fe.IN_TABLE_BODY}function hZe(i,e){i.openElements.clearBackToTableContext(),i._insertFakeElement(Me.TBODY,O.TBODY),i.insertionMode=fe.IN_TABLE_BODY,N7(i,e)}function gZe(i,e){i.openElements.hasInTableScope(O.TABLE)&&(i.openElements.popUntilTagNamePopped(O.TABLE),i._resetInsertionMode(),i._processStartTag(e))}function fZe(i,e){VNe(e)?i._appendElement(e,bt.HTML):UM(i,e),e.ackSelfClosing=!0}function pZe(i,e){!i.formElement&&i.openElements.tmplCount===0&&(i._insertElement(e,bt.HTML),i.formElement=i.openElements.current,i.openElements.pop())}function HE(i,e){switch(e.tagID){case O.TD:case O.TH:case O.TR:{hZe(i,e);break}case O.STYLE:case O.SCRIPT:case O.TEMPLATE:{Pg(i,e);break}case O.COL:{dZe(i,e);break}case O.FORM:{pZe(i,e);break}case O.TABLE:{gZe(i,e);break}case O.TBODY:case O.TFOOT:case O.THEAD:{uZe(i,e);break}case O.INPUT:{fZe(i,e);break}case O.CAPTION:{lZe(i,e);break}case O.COLGROUP:{cZe(i,e);break}default:UM(i,e)}}function _A(i,e){switch(e.tagID){case O.TABLE:{i.openElements.hasInTableScope(O.TABLE)&&(i.openElements.popUntilTagNamePopped(O.TABLE),i._resetInsertionMode());break}case O.TEMPLATE:{yC(i,e);break}case O.BODY:case O.CAPTION:case O.COL:case O.COLGROUP:case O.HTML:case O.TBODY:case O.TD:case O.TFOOT:case O.TH:case O.THEAD:case O.TR:break;default:UM(i,e)}}function UM(i,e){const t=i.fosterParentingEnabled;i.fosterParentingEnabled=!0,S7(i,e),i.fosterParentingEnabled=t}function $Ne(i,e){i.pendingCharacterTokens.push(e)}function qNe(i,e){i.pendingCharacterTokens.push(e),i.hasNonWhitespacePendingCharacterToken=!0}function yT(i,e){let t=0;if(i.hasNonWhitespacePendingCharacterToken)for(;t0&&i.openElements.currentTagId===O.OPTION&&i.openElements.tagIDs[i.openElements.stackTop-1]===O.OPTGROUP&&i.openElements.pop(),i.openElements.currentTagId===O.OPTGROUP&&i.openElements.pop();break}case O.OPTION:{i.openElements.currentTagId===O.OPTION&&i.openElements.pop();break}case O.SELECT:{i.openElements.hasInSelectScope(O.SELECT)&&(i.openElements.popUntilTagNamePopped(O.SELECT),i._resetInsertionMode());break}case O.TEMPLATE:{yC(i,e);break}}}function yZe(i,e){const t=e.tagID;t===O.CAPTION||t===O.TABLE||t===O.TBODY||t===O.TFOOT||t===O.THEAD||t===O.TR||t===O.TD||t===O.TH?(i.openElements.popUntilTagNamePopped(O.SELECT),i._resetInsertionMode(),i._processStartTag(e)):YNe(i,e)}function wZe(i,e){const t=e.tagID;t===O.CAPTION||t===O.TABLE||t===O.TBODY||t===O.TFOOT||t===O.THEAD||t===O.TR||t===O.TD||t===O.TH?i.openElements.hasInTableScope(t)&&(i.openElements.popUntilTagNamePopped(O.SELECT),i._resetInsertionMode(),i.onEndTag(e)):QNe(i,e)}function CZe(i,e){switch(e.tagID){case O.BASE:case O.BASEFONT:case O.BGSOUND:case O.LINK:case O.META:case O.NOFRAMES:case O.SCRIPT:case O.STYLE:case O.TEMPLATE:case O.TITLE:{Pg(i,e);break}case O.CAPTION:case O.COLGROUP:case O.TBODY:case O.TFOOT:case O.THEAD:{i.tmplInsertionModeStack[0]=fe.IN_TABLE,i.insertionMode=fe.IN_TABLE,HE(i,e);break}case O.COL:{i.tmplInsertionModeStack[0]=fe.IN_COLUMN_GROUP,i.insertionMode=fe.IN_COLUMN_GROUP,Nse(i,e);break}case O.TR:{i.tmplInsertionModeStack[0]=fe.IN_TABLE_BODY,i.insertionMode=fe.IN_TABLE_BODY,N7(i,e);break}case O.TD:case O.TH:{i.tmplInsertionModeStack[0]=fe.IN_ROW,i.insertionMode=fe.IN_ROW,E7(i,e);break}default:i.tmplInsertionModeStack[0]=fe.IN_BODY,i.insertionMode=fe.IN_BODY,dc(i,e)}}function SZe(i,e){e.tagID===O.TEMPLATE&&yC(i,e)}function XNe(i,e){i.openElements.tmplCount>0?(i.openElements.popUntilTagNamePopped(O.TEMPLATE),i.activeFormattingElements.clearToLastMarker(),i.tmplInsertionModeStack.shift(),i._resetInsertionMode(),i.onEof(e)):kse(i,e)}function kZe(i,e){e.tagID===O.HTML?dc(i,e):Tj(i,e)}function ZNe(i,e){var t;if(e.tagID===O.HTML){if(i.fragmentContext||(i.insertionMode=fe.AFTER_AFTER_BODY),i.options.sourceCodeLocationInfo&&i.openElements.tagIDs[0]===O.HTML){i._setEndLocation(i.openElements.items[0],e);const n=i.openElements.items[1];n&&!(!((t=i.treeAdapter.getNodeSourceCodeLocation(n))===null||t===void 0)&&t.endTag)&&i._setEndLocation(n,e)}}else Tj(i,e)}function Tj(i,e){i.insertionMode=fe.IN_BODY,S7(i,e)}function NZe(i,e){switch(e.tagID){case O.HTML:{dc(i,e);break}case O.FRAMESET:{i._insertElement(e,bt.HTML);break}case O.FRAME:{i._appendElement(e,bt.HTML),e.ackSelfClosing=!0;break}case O.NOFRAMES:{Pg(i,e);break}}}function EZe(i,e){e.tagID===O.FRAMESET&&!i.openElements.isRootHtmlElementCurrent()&&(i.openElements.pop(),!i.fragmentContext&&i.openElements.currentTagId!==O.FRAMESET&&(i.insertionMode=fe.AFTER_FRAMESET))}function LZe(i,e){switch(e.tagID){case O.HTML:{dc(i,e);break}case O.NOFRAMES:{Pg(i,e);break}}}function DZe(i,e){e.tagID===O.HTML&&(i.insertionMode=fe.AFTER_AFTER_FRAMESET)}function TZe(i,e){e.tagID===O.HTML?dc(i,e):y4(i,e)}function y4(i,e){i.insertionMode=fe.IN_BODY,S7(i,e)}function IZe(i,e){switch(e.tagID){case O.HTML:{dc(i,e);break}case O.NOFRAMES:{Pg(i,e);break}}}function AZe(i,e){e.chars=Gr,i._insertCharacters(e)}function RZe(i,e){i._insertCharacters(e),i.framesetOk=!1}function JNe(i){for(;i.treeAdapter.getNamespaceURI(i.openElements.current)!==bt.HTML&&i.openElements.currentTagId!==void 0&&!i._isIntegrationPoint(i.openElements.currentTagId,i.openElements.current);)i.openElements.pop()}function MZe(i,e){if(YQe(e))JNe(i),i._startTagOutsideForeignContent(e);else{const t=i._getAdjustedCurrentElement(),n=i.treeAdapter.getNamespaceURI(t);n===bt.MATHML?ONe(e):n===bt.SVG&&(QQe(e),jNe(e)),Cse(e),e.selfClosing?i._appendElement(e,n):i._insertElement(e,n),e.ackSelfClosing=!0}}function PZe(i,e){if(e.tagID===O.P||e.tagID===O.BR){JNe(i),i._endTagOutsideForeignContent(e);return}for(let t=i.openElements.stackTop;t>0;t--){const n=i.openElements.items[t];if(i.treeAdapter.getNamespaceURI(n)===bt.HTML){i._endTagOutsideForeignContent(e);break}const s=i.treeAdapter.getTagName(n);if(s.toLowerCase()===e.tagName){e.tagName=s,i.openElements.shortenToLength(t);break}}}Me.AREA,Me.BASE,Me.BASEFONT,Me.BGSOUND,Me.BR,Me.COL,Me.EMBED,Me.FRAME,Me.HR,Me.IMG,Me.INPUT,Me.KEYGEN,Me.LINK,Me.META,Me.PARAM,Me.SOURCE,Me.TRACK,Me.WBR;const OZe=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,jZe=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),hpe={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function eEe(i,e){const t=KZe(i),n=iNe("type",{handlers:{root:FZe,element:BZe,text:HZe,comment:nEe,doctype:WZe,raw:zZe},unknown:UZe}),s={parser:t?new cpe(hpe):cpe.getFragmentParser(void 0,hpe),handle(a){n(a,s)},stitches:!1,options:e||{}};n(i,s),WL(s,vp());const r=t?s.parser.document:s.parser.getFragment(),o=GYe(r,{file:s.options.file});return s.stitches&&C7(o,"comment",function(a,l,c){const u=a;if(u.value.stitch&&c&&l!==void 0){const h=c.children;return h[l]=u.value.stitch,l}}),o.type==="root"&&o.children.length===1&&o.children[0].type===i.type?o.children[0]:o}function tEe(i,e){let t=-1;if(i)for(;++t4&&(e.parser.tokenizer.state=0);const t={type:Di.CHARACTER,chars:i.value,location:$M(i)};WL(e,vp(i)),e.parser.currentToken=t,e.parser._processToken(e.parser.currentToken)}function WZe(i,e){const t={type:Di.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:$M(i)};WL(e,vp(i)),e.parser.currentToken=t,e.parser._processToken(e.parser.currentToken)}function VZe(i,e){e.stitches=!0;const t=GZe(i);if("children"in i&&"children"in t){const n=eEe({type:"root",children:i.children},e.options);t.children=n.children}nEe({type:"comment",value:{stitch:t}},e)}function nEe(i,e){const t=i.value,n={type:Di.COMMENT,data:t,location:$M(i)};WL(e,vp(i)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function zZe(i,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,iEe(e,vp(i)),e.parser.tokenizer.write(e.options.tagfilter?i.value.replace(OZe,"<$1$2"):i.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const t=e.parser.tokenizer._consume();e.parser.tokenizer._callState(t)}}function UZe(i,e){const t=i;if(e.options.passThrough&&e.options.passThrough.includes(t.type))VZe(t,e);else{let n="";throw jZe.has(t.type)&&(n=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+t.type+"` node"+n)}}function WL(i,e){iEe(i,e);const t=i.parser.tokenizer.currentCharacterToken;t&&t.location&&(t.location.endLine=i.parser.tokenizer.preprocessor.line,t.location.endCol=i.parser.tokenizer.preprocessor.col+1,t.location.endOffset=i.parser.tokenizer.preprocessor.offset+1,i.parser.currentToken=t,i.parser._processToken(i.parser.currentToken)),i.parser.tokenizer.paused=!1,i.parser.tokenizer.inLoop=!1,i.parser.tokenizer.active=!1,i.parser.tokenizer.returnState=Bo.DATA,i.parser.tokenizer.charRefCode=-1,i.parser.tokenizer.consumedAfterSnapshot=-1,i.parser.tokenizer.currentLocation=null,i.parser.tokenizer.currentCharacterToken=null,i.parser.tokenizer.currentToken=null,i.parser.tokenizer.currentAttr={name:"",value:""}}function iEe(i,e){if(e&&e.offset!==void 0){const t={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};i.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,i.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,i.parser.tokenizer.preprocessor.line=e.line,i.parser.tokenizer.currentLocation=t}}function $Ze(i,e){const t=i.tagName.toLowerCase();if(e.parser.tokenizer.state===Bo.PLAINTEXT)return;WL(e,vp(i));const n=e.parser.openElements.current;let s="namespaceURI"in n?n.namespaceURI:Oy.html;s===Oy.html&&t==="svg"&&(s=Oy.svg);const r=JYe({...i,children:[]},{space:s===Oy.svg?"svg":"html"}),o={type:Di.START_TAG,tagName:t,tagID:HL(t),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in r?r.attrs:[],location:$M(i)};e.parser.currentToken=o,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=t}function qZe(i,e){const t=i.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&aQe.includes(t)||e.parser.tokenizer.state===Bo.PLAINTEXT)return;WL(e,b7(i));const n={type:Di.END_TAG,tagName:t,tagID:HL(t),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:$M(i)};e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken),t===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===Bo.RCDATA||e.parser.tokenizer.state===Bo.RAWTEXT||e.parser.tokenizer.state===Bo.SCRIPT_DATA)&&(e.parser.tokenizer.state=Bo.DATA)}function KZe(i){const e=i.type==="root"?i.children[0]:i;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function $M(i){const e=vp(i)||{line:void 0,column:void 0,offset:void 0},t=b7(i)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:t.line,endCol:t.column,endOffset:t.offset}}function GZe(i){return"children"in i?BE({...i,children:[]}):BE(i)}function Ese(i){return function(e,t){return eEe(e,{...i,file:t})}}function YZe(i){return new Date(i).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function QZe(i){return new Date(i).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}const sEe=L.memo(function({message:e}){const t=e.role==="user",[n,s]=L.useState(!1);return d.jsxs("div",{className:be("group relative flex gap-3 px-4 py-3",t?"flex-row-reverse":"flex-row"),onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[d.jsx("div",{className:be("flex h-8 w-8 shrink-0 items-center justify-center rounded-full",t?"bg-primary text-primary-foreground":"bg-accent/20 text-accent"),children:t?d.jsx($ie,{className:"h-4 w-4"}):d.jsx(ai,{className:"h-4 w-4"})}),d.jsxs("div",{className:be("flex flex-col gap-1 max-w-[75%]",t&&"items-end"),children:[d.jsx("div",{className:be("rounded-2xl px-4 py-2.5 text-sm leading-relaxed",t?"bg-primary text-primary-foreground rounded-ee-md":"bg-card border border-border text-card-foreground rounded-es-md",e.isStreaming&&"animate-pulse"),children:t?d.jsx("p",{className:"whitespace-pre-wrap",children:e.content}):d.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-3 [&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs",children:e.content?d.jsx(mse,{remarkPlugins:[_se],rehypePlugins:[Ese],children:e.content}):e.isStreaming?d.jsx(ZZe,{}):d.jsx("p",{className:"text-muted-foreground italic",children:"No response"})})}),d.jsxs("div",{className:be("flex items-center gap-1.5 px-1",t?"flex-row-reverse":"flex-row"),children:[d.jsx("span",{className:"text-[10px] text-muted-foreground/60 select-none",title:QZe(e.timestamp),children:YZe(e.timestamp)}),!t&&e.content&&n&&d.jsx(XZe,{content:e.content})]})]})]})});function XZe({content:i}){const[e,t]=L.useState(!1),n=L.useCallback(()=>{navigator.clipboard.writeText(i),t(!0),setTimeout(()=>t(!1),1500)},[i]);return d.jsx("button",{onClick:n,className:be("inline-flex items-center gap-0.5 rounded-md px-1.5 py-0.5 text-[10px] transition-colors",e?"text-emerald-500":"text-muted-foreground/50 hover:text-foreground hover:bg-muted/50"),title:"Copy message","data-testid":"copy-message",children:e?d.jsxs(d.Fragment,{children:[d.jsx(Ns,{className:"h-3 w-3"}),d.jsx("span",{children:"Copied"})]}):d.jsxs(d.Fragment,{children:[d.jsx(mo,{className:"h-3 w-3"}),d.jsx("span",{children:"Copy"})]})})}function ZZe(){const{t:i}=xe();return d.jsxs("div",{className:"flex items-center gap-1 py-1","aria-label":i("chat.agentTyping","Agent is typing"),children:[d.jsx("span",{className:"h-2 w-2 animate-bounce rounded-full bg-muted-foreground/50 [animation-delay:0ms]"}),d.jsx("span",{className:"h-2 w-2 animate-bounce rounded-full bg-muted-foreground/50 [animation-delay:150ms]"}),d.jsx("span",{className:"h-2 w-2 animate-bounce rounded-full bg-muted-foreground/50 [animation-delay:300ms]"})]})}function rEe(){const{t:i}=xe(),e=Oi(n=>n.streamingEnabled),t=Oi(n=>n.toggleStreaming);return d.jsxs("button",{onClick:t,className:be("flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors",e?"border-primary/30 bg-primary/10 text-primary":"border-border bg-muted text-muted-foreground"),title:i("chat.streaming"),"aria-label":i("chat.streaming"),"aria-pressed":e,"data-testid":"streaming-toggle",children:[e?d.jsx(nc,{className:"h-3.5 w-3.5"}):d.jsx(bWe,{className:"h-3.5 w-3.5"}),i("chat.streaming")]})}const oEe="/auditstore";async function L7(i,e=0,t=100){return Oe.get(`${oEe}/${i}?skip=${e}&limit=${t}`)}async function JZe(i,e,t=0,n=100){const s=new URLSearchParams({skip:String(t),limit:String(n)});return e!=null&&s.set("agentVersion",String(e)),Oe.get(`${oEe}/agent/${i}?${s.toString()}`)}const eJe={parser:"bg-blue-500/80",expressions:"bg-blue-500/80",behavior:"bg-violet-500/80",rules:"bg-violet-500/80",httpcalls:"bg-amber-500/80",apicalls:"bg-amber-500/80",langchain:"bg-emerald-500/80",llm:"bg-emerald-500/80",output:"bg-rose-500/80",property:"bg-cyan-500/80",propertysetter:"bg-cyan-500/80",mcpcalls:"bg-orange-500/80",dictionary:"bg-indigo-500/80",rag:"bg-teal-500/80"};function tJe(i){const e=i.toLowerCase().replace("ai.labs.","");return eJe[e]??"bg-muted-foreground/60"}function nJe(i){return i.replace("ai.labs.","").replace(/store$/,"")}function iJe({conversationId:i}){const{t:e}=xe(),t=bu(g=>g.turns),n=bu(g=>g.currentTurnEvents),s=bu(g=>g.selectedTurnIndex),r=bu(g=>g.setSelectedTurn),{data:o,isError:a}=hn({queryKey:["audit","debugger",i],queryFn:()=>L7(i,0,200),enabled:!!i&&t.length===0,staleTime:3e4}),l=L.useMemo(()=>o!=null&&o.length?oJe(o):[],[o]),c=t.length>0?t:l,u=s!==null?c[s]:c[c.length-1],h=s===null&&n.length>0;return d.jsxs("div",{className:"flex flex-col gap-3 p-3","data-testid":"pipeline-trace",children:[c.length>1&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:e("debugDrawer.turn","Turn")}),d.jsxs("select",{value:s??"latest",onChange:g=>{const f=g.target.value;r(f==="latest"?null:Number(f))},"aria-label":e("debugDrawer.turn","Turn"),className:"rounded-md border border-input bg-card px-2 py-1 text-xs","data-testid":"turn-selector",children:[d.jsxs("option",{value:"latest",children:[e("debugDrawer.latest","Latest")," (",e("debugDrawer.turn","Turn")," ",c.length,")"]}),c.map((g,f)=>d.jsxs("option",{value:f,children:[e("debugDrawer.turn","Turn")," ",f+1," — ",jE(g.totalDurationMs)]},f))]})]}),a&&c.length===0&&!h&&d.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center","data-testid":"pipeline-trace-error",children:[d.jsx(Vi,{className:"h-8 w-8 text-destructive/50"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:e("debugDrawer.pipelineError","Failed to load pipeline trace")})]}),!a||c.length>0||h?h?d.jsx(rJe,{events:n}):u?d.jsx(sJe,{turn:u}):d.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center",children:[d.jsx(nc,{className:"h-8 w-8 text-muted-foreground/30"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:e("debugDrawer.noPipeline","Send a message to see the pipeline trace")})]}):null]})}function sJe({turn:i}){const{t:e}=xe(),t=L.useMemo(()=>lEe(i.events),[i.events]),n=Math.max(...t.map(s=>s.durationMs),1);return d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(Zr,{className:"h-3 w-3"}),e("debugDrawer.turn","Turn")," ",i.turnIndex+1]}),d.jsx("span",{className:"font-mono",children:jE(i.totalDurationMs)})]}),t.map((s,r)=>d.jsx(aEe,{task:s,maxDuration:n},r)),i.events.some(s=>{var r;return(r=s.actions)==null?void 0:r.length})&&d.jsxs("div",{className:"flex flex-wrap gap-1 pt-1",children:[d.jsxs("span",{className:"text-[10px] font-medium text-muted-foreground me-1",children:[e("debugDrawer.actions","Actions"),":"]}),i.events.flatMap(s=>s.actions??[]).filter((s,r,o)=>o.indexOf(s)===r).map(s=>d.jsx("span",{className:"rounded-full bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:s},s))]})]})}function rJe({events:i}){const{t:e}=xe(),t=L.useMemo(()=>lEe(i),[i]),n=Math.max(...t.map(s=>s.durationMs||100),1);return d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex items-center gap-1 text-xs text-primary animate-pulse",children:[d.jsx(nc,{className:"h-3 w-3"}),e("debugDrawer.processing","Processing...")]}),t.map((s,r)=>d.jsx(aEe,{task:s,maxDuration:n},r))]})}function aEe({task:i,maxDuration:e}){var o;const{t}=xe(),[n,s]=L.useState(!1),r=Math.max(i.durationMs/e*100,8);return d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>s(!n),"aria-expanded":n,className:"group flex w-full items-center gap-2 rounded-md px-1 py-0.5 text-start transition-colors hover:bg-muted/50","data-testid":"task-bar",children:[d.jsx("span",{className:"w-20 shrink-0 truncate text-[11px] font-medium text-foreground",children:nJe(i.taskType)}),d.jsx("div",{className:"flex-1 h-4 rounded-sm bg-muted/30 overflow-hidden",children:d.jsx("div",{className:be("h-full rounded-sm transition-all duration-500",tJe(i.taskType),i.isRunning&&"animate-pulse"),style:{width:`${r}%`}})}),d.jsx("span",{className:"w-14 shrink-0 text-end font-mono text-[10px] text-muted-foreground",children:i.isRunning?"...":jE(i.durationMs)}),d.jsx(Rn,{className:be("h-3 w-3 shrink-0 text-muted-foreground/50 transition-transform",n&&"rotate-180")})]}),n&&d.jsxs("div",{className:"ms-22 mb-1 rounded-md border border-border bg-card p-2 text-[10px] text-muted-foreground space-y-0.5",children:[(o=i.actions)!=null&&o.length?d.jsxs("p",{children:[d.jsxs("span",{className:"font-medium",children:[t("debugDrawer.actions","Actions"),":"]})," ",i.actions.join(", ")]}):null,i.confidence!=null&&d.jsxs("p",{children:[d.jsxs("span",{className:"font-medium",children:[t("debugDrawer.confidence","Confidence"),":"]})," ",(i.confidence*100).toFixed(0),"%"]}),d.jsxs("p",{children:[d.jsxs("span",{className:"font-medium",children:[t("debugDrawer.duration","Duration"),":"]})," ",jE(i.durationMs)]})]})]})}function lEe(i){const e=[],t=new Map;for(const n of i){const s=`${n.taskType}-${n.index}`;if(n.type==="task_start")t.set(s,n);else if(n.type==="task_complete"){const r=t.get(s);e.push({taskType:n.taskType,durationMs:n.durationMs??(r?n.timestamp-r.timestamp:0),actions:n.actions,confidence:n.confidence,isRunning:!1}),t.delete(s)}}for(const[,n]of t)e.push({taskType:n.taskType,durationMs:Date.now()-n.timestamp,isRunning:!0});return e}function oJe(i){const e=new Map;for(const n of i){const s=n.stepIndex??0;e.has(s)||e.set(s,[]),e.get(s).push(n)}const t=[];for(const[n,s]of e){const r=s.flatMap(a=>[{type:"task_start",taskId:a.taskId,taskType:a.taskType,index:a.taskIndex,timestamp:new Date(a.timestamp).getTime()},{type:"task_complete",taskId:a.taskId,taskType:a.taskType,index:a.taskIndex,durationMs:a.durationMs,actions:a.actions??void 0,timestamp:new Date(a.timestamp).getTime()+(a.durationMs??0)}]),o=s.reduce((a,l)=>a+(l.durationMs??0),0);t.push({turnIndex:n,events:r,totalDurationMs:o,startTime:new Date(s[0].timestamp).getTime()})}return t.sort((n,s)=>n.turnIndex-s.turnIndex)}const cEe="/llm/tools";async function aJe(i){try{return await Oe.get(`${cEe}/costs/conversation/${i}`)}catch(e){if(Iie(e)&&e.status===404)return null;throw e}}async function lJe(){return Oe.get(`${cEe}/cache/stats`)}const dEe=["toolMetrics"];function cJe(i,e=!0){return hn({queryKey:[...dEe,"costs",i],queryFn:()=>aJe(i),enabled:!!i&&e,refetchInterval:e?5e3:!1,staleTime:4e3})}function dJe(i=!1){return hn({queryKey:[...dEe,"cacheStats"],queryFn:lJe,enabled:i,staleTime:3e4})}function uJe({conversationId:i,isActive:e=!1}){const{t}=xe(),{data:n,isError:s}=cJe(i,e),{data:r}=dJe(e),{data:o}=hn({queryKey:["audit","costDash",i],queryFn:()=>L7(i,0,200),enabled:!!i,staleTime:1e4}),a=L.useMemo(()=>o!=null&&o.length?gJe(o):null,[o]),l=a==null?void 0:a.turns[a.turns.length-1];return d.jsxs("div",{className:"flex flex-col gap-3 p-3","data-testid":"cost-dashboard",children:[l&&d.jsxs(v5,{title:t("costDashboard.thisTurn","This Turn"),icon:d.jsx(nc,{className:"h-3.5 w-3.5"}),children:[d.jsx(I0,{label:t("costDashboard.tokens","Tokens"),value:`${TS(l.inputTokens)} ${t("costDashboard.in","in")} · ${TS(l.outputTokens)} ${t("costDashboard.out","out")} · ${TS(l.totalTokens)} ${t("costDashboard.total","total")}`}),l.cost>0&&d.jsx(I0,{label:t("costDashboard.cost","Cost"),value:gpe(l.cost)}),d.jsx(I0,{label:t("costDashboard.duration","Duration"),value:jE(l.durationMs)}),l.modelName&&d.jsx(I0,{label:t("costDashboard.model","Model"),value:l.modelName})]}),a&&d.jsxs(v5,{title:t("costDashboard.conversationTotal","Conversation Total"),icon:d.jsx(YSe,{className:"h-3.5 w-3.5"}),children:[d.jsx(I0,{label:t("costDashboard.tokens","Tokens"),value:`${TS(a.totalInput)} ${t("costDashboard.in","in")} · ${TS(a.totalOutput)} ${t("costDashboard.out","out")} · ${TS(a.totalTokens)} ${t("costDashboard.total","total")}`}),d.jsx(I0,{label:t("costDashboard.cost","Cost"),value:gpe(a.totalCost)}),(n==null?void 0:n.toolCallCount)!=null&&n.toolCallCount>0&&d.jsx(I0,{label:t("costDashboard.toolCalls","Tool Calls"),value:`${n.toolCallCount}`})]}),(n==null?void 0:n.toolUsage)&&Object.keys(n.toolUsage).length>0&&d.jsx(v5,{title:t("costDashboard.toolUsage","Tool Usage"),icon:d.jsx(l7,{className:"h-3.5 w-3.5"}),children:Object.entries(n.toolUsage).map(([c,u])=>d.jsx("div",{className:"space-y-0.5",children:d.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[d.jsx("span",{className:"font-medium text-foreground truncate",children:c}),d.jsxs("span",{className:"text-muted-foreground font-mono",children:[u," ",t("costDashboard.calls","calls")]})]})},c))}),r&&r.hitRate>0&&d.jsx(v5,{title:t("costDashboard.cacheStats","Cache"),icon:d.jsx(rb,{className:"h-3.5 w-3.5"}),children:d.jsxs("div",{className:"space-y-1",children:[d.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[d.jsx("span",{className:"text-foreground",children:t("costDashboard.hitRate","Hit Rate")}),d.jsxs("span",{className:"font-mono text-muted-foreground",children:[(r.hitRate*100).toFixed(1),"%"]})]}),d.jsx(hJe,{value:r.hitRate,variant:"success"})]})}),s&&!n&&d.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center","data-testid":"cost-dashboard-error",children:[d.jsx(Vi,{className:"h-8 w-8 text-destructive/50"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:t("costDashboard.error","Unable to load cost data from server")})]}),!a&&!n&&!s&&d.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center",children:[d.jsx(DSe,{className:"h-8 w-8 text-muted-foreground/30"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:t("costDashboard.empty","Send a message to see cost metrics")})]})]})}function v5({title:i,icon:e,children:t}){return d.jsxs("div",{className:"rounded-lg border border-border bg-card/50 p-2.5 space-y-1.5",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-foreground/80",children:[e,i]}),d.jsx("div",{className:"space-y-1",children:t})]})}function I0({label:i,value:e}){return d.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[d.jsx("span",{className:"text-muted-foreground",children:i}),d.jsx("span",{className:"font-mono text-foreground",children:e})]})}function hJe({value:i,max:e=1,variant:t="default"}){const n=Math.min(i/e*100,100),s=t==="critical"?"bg-destructive":t==="warning"?"bg-amber-500":t==="success"?"bg-emerald-500":"bg-primary";return d.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted/40 overflow-hidden",children:d.jsx("div",{className:be("h-full rounded-full transition-all duration-500",s),style:{width:`${n}%`}})})}function gJe(i){const e=new Map;for(const a of i){const l=a.stepIndex??0;e.has(l)||e.set(l,[]),e.get(l).push(a)}const t=[];let n=0,s=0,r=0;const o=Array.from(e.entries()).sort(([a],[l])=>a-l);for(const[,a]of o){let l=0,c=0,u=0,h=0,g=null;for(const f of a){const m=f.llmDetail;if(m){const x=m.tokenUsage;x&&(l+=x.inputTokens??0,c+=x.outputTokens??0),m.modelName&&(g=String(m.modelName))}u+=f.cost??0,h+=f.durationMs??0}t.push({inputTokens:l,outputTokens:c,totalTokens:l+c,cost:u,durationMs:h,modelName:g}),n+=l,s+=c,r+=u}return{turns:t,totalInput:n,totalOutput:s,totalTokens:n+s,totalCost:r}}function TS(i){return i.toLocaleString()}function gpe(i){return i===0?"$0.00":i<.01?`$${i.toFixed(4)}`:`$${i.toFixed(2)}`}function fJe({conversationId:i}){const{t:e}=xe(),{data:t,isLoading:n,isError:s,refetch:r}=hn({queryKey:["memory","detailed",i],queryFn:()=>ize(i),enabled:!!i,staleTime:1e4});if(!i)return d.jsx(fpe,{message:e("memoryInspector.noConversation","Start a conversation to inspect memory")});if(n)return d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx(xi,{className:"h-5 w-5 animate-spin text-muted-foreground"})});if(s&&!t)return d.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center","data-testid":"memory-inspector-error",children:[d.jsx(Vi,{className:"h-8 w-8 text-destructive/50"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:e("memoryInspector.error","Failed to load memory data")})]});const o=(t==null?void 0:t.conversationSteps)??[];return d.jsxs("div",{className:"flex flex-col gap-2 p-3","data-testid":"memory-inspector",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-xs font-semibold text-foreground/80",children:e("memoryInspector.title","Conversation Memory")}),d.jsx("button",{onClick:()=>r(),className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground",title:e("common.retry","Refresh"),"data-testid":"memory-refresh",children:d.jsx(xi,{className:"h-3 w-3"})})]}),o.length===0?d.jsx(fpe,{message:e("memoryInspector.empty","No memory data available")}):o.map((a,l)=>d.jsx(pJe,{step:a,stepIndex:l},l)),(t==null?void 0:t.conversationProperties)&&Object.keys(t.conversationProperties).length>0&&d.jsx(uEe,{label:e("memoryInspector.properties","Properties"),defaultOpen:!1,children:d.jsx("pre",{className:"text-[10px] font-mono text-muted-foreground whitespace-pre-wrap break-all",children:JSON.stringify(t.conversationProperties,null,2)})})]})}function pJe({step:i,stepIndex:e}){const{t}=xe(),n=L.useMemo(()=>{const s=new Map;for(const r of i.conversationStep??[]){const o=r.originWorkflowId??"input";s.has(o)||s.set(o,[]),s.get(o).push(r)}return Array.from(s.entries())},[i.conversationStep]);return d.jsx(uEe,{label:`${t("memoryInspector.step","Step")} ${e+1}`,badge:`${(i.conversationStep??[]).length} ${t("memoryInspector.keys","keys")}`,defaultOpen:e===0,children:n.map(([s,r])=>d.jsxs("div",{className:"ms-2 border-s border-border ps-2 space-y-0.5",children:[d.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:s==="input"?t("memoryInspector.input","Input"):s}),r.map((o,a)=>d.jsx(mJe,{item:o},a))]},s))})}function mJe({item:i}){const[e,t]=L.useState(!1),n=typeof i.value=="object"&&i.value!==null,s=!i.key.includes("private"),r=n?JSON.stringify(i.value,null,2):String(i.value),o=r.length>80;return d.jsxs("div",{className:"rounded-sm",children:[d.jsxs("button",{onClick:()=>o&&t(!e),className:be("flex w-full items-center gap-1 py-0.5 text-start text-[10px]",o&&"cursor-pointer hover:bg-muted/30 rounded px-1 -mx-1"),children:[s?d.jsx(Sh,{className:"h-2.5 w-2.5 shrink-0 text-emerald-500/60"}):d.jsx(_b,{className:"h-2.5 w-2.5 shrink-0 text-amber-500/60"}),d.jsx("span",{className:"font-mono font-medium text-primary/80 shrink-0",children:i.key}),d.jsx("span",{className:"text-muted-foreground/60 mx-0.5",children:"="}),!e&&d.jsxs("span",{className:"truncate font-mono text-foreground/70",children:[r.slice(0,80),o&&"…"]})]}),e&&d.jsx("pre",{className:"ms-5 mt-0.5 rounded border border-border bg-card p-1.5 text-[10px] font-mono text-foreground/70 whitespace-pre-wrap break-all max-h-48 overflow-y-auto",children:r})]})}function uEe({label:i,badge:e,defaultOpen:t=!1,children:n}){const[s,r]=L.useState(t);return d.jsxs("div",{className:"rounded-md border border-border bg-card/30",children:[d.jsxs("button",{onClick:()=>r(!s),"aria-expanded":s,className:"flex w-full items-center gap-1.5 px-2 py-1.5 text-xs font-medium text-foreground hover:bg-muted/30 rounded-t-md","data-testid":"expandable-node",children:[d.jsx(hs,{className:be("h-3 w-3 shrink-0 text-muted-foreground transition-transform",s&&"rotate-90")}),i,e&&d.jsx("span",{className:"ms-auto text-[10px] font-normal text-muted-foreground",children:e})]}),s&&d.jsx("div",{className:"px-2 pb-2 space-y-1",children:n})]})}function fpe({message:i}){return d.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center",children:[d.jsx(C_,{className:"h-8 w-8 text-muted-foreground/30"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:i})]})}class hEe{constructor(e,t={}){kt(this,"abortController",null);kt(this,"reconnectTimer",null);kt(this,"listeners",new Map);kt(this,"_closed",!1);kt(this,"onmessage",null);kt(this,"onerror",null);kt(this,"onopen",null);this.url=e,this.headers=t,this.connect()}addEventListener(e,t){this.listeners.has(e)||this.listeners.set(e,[]),this.listeners.get(e).push(t)}close(){var e;this._closed=!0,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(e=this.abortController)==null||e.abort(),this.abortController=null}async connect(){var e;if(!this._closed){this.abortController=new AbortController;try{const t=await fetch(this.url,{headers:{Accept:"text/event-stream",...this.headers},signal:this.abortController.signal});if(!t.ok||!t.body){this.scheduleReconnect();return}(e=this.onopen)==null||e.call(this);const n=t.body.getReader(),s=new TextDecoder;let r="";for(;!this._closed;){const{done:o,value:a}=await n.read();if(o)break;r+=s.decode(a,{stream:!0});const l=r.split(`
-
-`);r=l.pop()??"";for(const c of l){const u=this.parseBlock(c.trim());u&&this.dispatch(u)}}this._closed||this.scheduleReconnect()}catch(t){if(this._closed||t instanceof DOMException&&t.name==="AbortError")return;this.scheduleReconnect()}}}scheduleReconnect(){var e;(e=this.onerror)==null||e.call(this),this._closed||(this.reconnectTimer=setTimeout(()=>this.connect(),5e3))}parseBlock(e){if(!e)return null;let t="message";const n=[];for(const s of e.split(`
-`))s.startsWith("event:")?t=s.slice(6).trim():s.startsWith("data:")&&n.push(s.slice(5).trimStart());return n.length===0?null:new MessageEvent(t,{data:n.join(`
-`)})}dispatch(e){var n;const t=this.listeners.get(e.type);t&&t.forEach(s=>s(e)),(n=this.onmessage)==null||n.call(this,e)}}const D7="/administration/logs";async function bJe(i={}){const e=new URLSearchParams;i.agentId&&e.set("agentId",i.agentId),i.conversationId&&e.set("conversationId",i.conversationId),i.level&&e.set("level",i.level),i.limit&&e.set("limit",String(i.limit));const t=e.toString();return Oe.get(`${D7}${t?`?${t}`:""}`)}async function xJe(i={}){const e=new URLSearchParams;i.environment&&e.set("environment",i.environment),i.agentId&&e.set("agentId",i.agentId),i.agentVersion&&e.set("agentVersion",String(i.agentVersion)),i.conversationId&&e.set("conversationId",i.conversationId),i.userId&&e.set("userId",i.userId),i.instanceId&&e.set("instanceId",i.instanceId),i.skip&&e.set("skip",String(i.skip)),i.limit&&e.set("limit",String(i.limit));const t=e.toString();return Oe.get(`${D7}/history${t?`?${t}`:""}`)}async function vJe(){return Oe.get(`${D7}/instance`)}function Lse(i={}){const e=new URLSearchParams;i.agentId&&e.set("agentId",i.agentId),i.conversationId&&e.set("conversationId",i.conversationId),i.level&&e.set("level",i.level);const t=e.toString(),n=`${window.location.origin}${D7}/stream${t?`?${t}`:""}`;return new hEe(n,Oe.getAuthHeader())}const ppe=500,gEe={ERROR:"text-destructive",WARN:"text-amber-500",INFO:"text-emerald-500",DEBUG:"text-muted-foreground",TRACE:"text-muted-foreground/50"},fEe={ERROR:"bg-destructive/10",WARN:"bg-amber-500/10",INFO:"bg-emerald-500/10",DEBUG:"bg-muted/30",TRACE:"bg-muted/20"};function _Je({agentId:i,conversationId:e}){const{t}=xe(),[n,s]=L.useState([]),[r,o]=L.useState(!1),a=L.useRef(!1),[l,c]=L.useState(null),[u,h]=L.useState(""),[g,f]=L.useState(!1),m=L.useRef(null),x=L.useRef(null);L.useEffect(()=>{a.current=r},[r]),L.useEffect(()=>{if(!i)return;const w=Lse({agentId:i,conversationId:e??void 0}),k=C=>{if(!a.current)try{const E=JSON.parse(C.data);s(D=>{const T=[...D,E];return T.length>ppe?T.slice(-ppe):T})}catch{}};return w.addEventListener("log",k),w.onmessage=k,w.onopen=()=>f(!0),w.onerror=()=>f(!1),x.current=w,()=>{w.close(),x.current=null,f(!1)}},[i,e]),L.useEffect(()=>{i&&bJe({agentId:i,conversationId:e??void 0,limit:50}).then(w=>s(w)).catch(()=>{})},[i,e]),L.useEffect(()=>{var w;r||(w=m.current)==null||w.scrollTo({top:m.current.scrollHeight,behavior:"smooth"})},[n,r]);const v=L.useCallback(()=>s([]),[]),_=L.useMemo(()=>{let w=n;if(l&&(w=w.filter(k=>k.level===l)),u.trim()){const k=u.toLowerCase();w=w.filter(C=>C.message.toLowerCase().includes(k)||C.loggerName.toLowerCase().includes(k))}return w},[n,l,u]);return i?d.jsxs("div",{className:"flex flex-col","data-testid":"live-log-viewer",children:[d.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border px-3 py-1.5",children:[d.jsx(RE,{className:be("h-2 w-2 shrink-0 fill-current",g?"text-emerald-500":"text-destructive"),"aria-label":g?t("logViewer.connected","Connected"):t("logViewer.disconnected","Disconnected"),role:"status"}),["ERROR","WARN","INFO","DEBUG"].map(w=>d.jsx("button",{onClick:()=>c(l===w?null:w),"aria-pressed":l===w,className:be("rounded-full px-2 py-0.5 text-[10px] font-medium transition-colors",l===w?`${fEe[w]} ${gEe[w]}`:"text-muted-foreground hover:bg-muted"),"data-testid":`filter-${w}`,children:w},w)),d.jsx("div",{className:"flex-1"}),d.jsxs("div",{className:"relative",children:[d.jsx(br,{className:"absolute inset-s-1.5 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:u,onChange:w=>h(w.target.value),placeholder:t("logViewer.search","Search..."),className:"w-32 rounded border border-input bg-card py-0.5 ps-6 pe-2 text-[10px] focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"log-search"})]}),d.jsx("button",{onClick:()=>o(!r),className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground",title:r?t("logViewer.resume","Resume"):t("logViewer.pause","Pause"),"data-testid":"log-pause",children:r?d.jsx(Hie,{className:"h-3 w-3"}):d.jsx(Bie,{className:"h-3 w-3"})}),d.jsx("button",{onClick:v,className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground",title:t("logViewer.clear","Clear"),"data-testid":"log-clear",children:d.jsx(_n,{className:"h-3 w-3"})})]}),d.jsx("div",{ref:m,role:"log","aria-live":"polite","aria-label":t("logViewer.logOutput","Log output"),className:"overflow-y-auto font-mono text-[10px] leading-relaxed",style:{maxHeight:"35vh"},children:_.length===0?d.jsx("div",{className:"flex items-center justify-center py-8 text-muted-foreground text-xs",children:t("logViewer.waiting","Waiting for logs...")}):_.map((w,k)=>d.jsx(yJe,{entry:w},k))})]}):d.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center",children:[d.jsx($v,{className:"h-8 w-8 text-muted-foreground/30"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:t("logViewer.noAgent","Select an agent to view logs")})]})}function yJe({entry:i}){const e=i.level??"INFO",t=i.timestamp?new Date(i.timestamp).toLocaleTimeString(void 0,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}):"",n=i.loggerName?i.loggerName.split(".").pop()??i.loggerName:"";return d.jsxs("div",{className:be("flex items-start gap-1.5 border-b border-border/30 px-3 py-0.5 leading-tight",fEe[e]??"bg-transparent"),"data-testid":"log-entry",children:[d.jsx("span",{className:"shrink-0 text-muted-foreground/70 min-w-[70px]",children:t}),d.jsx("span",{className:be("shrink-0 w-10 font-bold",gEe[e]??"text-foreground"),children:e.padEnd(5)}),d.jsxs("span",{className:"shrink-0 text-primary/60 w-24 truncate",children:["[",n,"]"]}),d.jsx("span",{className:"text-foreground/80 break-all",children:i.message})]})}function wJe({conversationId:i}){const{t:e}=xe(),{data:t,isError:n}=hn({queryKey:["audit","promptViewer",i],queryFn:()=>L7(i,0,200),enabled:!!i,staleTime:1e4}),s=L.useMemo(()=>t?t.filter(l=>l.llmDetail!=null).sort((l,c)=>new Date(l.timestamp).getTime()-new Date(c.timestamp).getTime()):[],[t]),[r,o]=L.useState(null),a=r!==null?s[r]:s[s.length-1];return i?n&&!t?d.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center","data-testid":"prompt-viewer-error",children:[d.jsx(Vi,{className:"h-8 w-8 text-destructive/50"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:e("promptViewer.error","Failed to load prompt data")})]}):s.length===0?d.jsx(xpe,{message:e("promptViewer.noLlm","No LLM interactions found yet")}):d.jsxs("div",{className:"flex flex-col gap-3 p-3","data-testid":"prompt-viewer",children:[s.length>1&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:e("promptViewer.turn","Turn")}),d.jsxs("select",{value:r??"latest",onChange:l=>{const c=l.target.value;o(c==="latest"?null:Number(c))},className:"rounded-md border border-input bg-card px-2 py-1 text-xs","data-testid":"prompt-turn-selector",children:[d.jsxs("option",{value:"latest",children:[e("promptViewer.latest","Latest")," (",e("promptViewer.step","Step")," ",s.length,")"]}),s.map((l,c)=>d.jsxs("option",{value:c,children:[e("promptViewer.step","Step")," ",l.stepIndex+1," — ",l.taskType]},c))]})]}),a&&d.jsx(CJe,{entry:a,conversationId:i})]}):d.jsx(xpe,{message:e("promptViewer.noConversation","Start a conversation to inspect prompts")})}function CJe({entry:i,conversationId:e}){const{t}=xe(),[n,s]=L.useState(!1),[r,o]=L.useState(!1),a=i.llmDetail,l=a==null?void 0:a.compiledPrompt,c=a==null?void 0:a.modelResponse,u=a==null?void 0:a.modelName,h=a==null?void 0:a.tokenUsage,g=i.toolCalls,f=L.useMemo(()=>l?kJe(l):[],[l]),m=async()=>{const v=l??JSON.stringify(a,null,2);try{await navigator.clipboard.writeText(v),s(!0),setTimeout(()=>s(!1),2e3)}catch{}},x=async()=>{try{o(!0),await Oe.post(`/agents/${e}/rerun`)}catch{}finally{o(!1)}};return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[d.jsxs("span",{className:"font-medium text-foreground",children:[t("promptViewer.step","Step")," ",i.stepIndex+1]}),d.jsx("span",{className:"rounded bg-emerald-500/10 px-1.5 py-0.5 text-[10px] font-medium text-emerald-500",children:i.taskType}),i.durationMs>0&&d.jsx("span",{className:"font-mono",children:jE(i.durationMs)})]}),f.length>0?d.jsx("div",{className:"space-y-2",children:f.map((v,_)=>d.jsx(bpe,{role:v.role,content:v.content},_))}):l?d.jsx("div",{className:"rounded-lg border border-border bg-card p-3",children:d.jsx("pre",{className:"text-[11px] font-mono text-foreground/80 whitespace-pre-wrap break-all max-h-64 overflow-y-auto",children:l})}):null,c&&d.jsx(bpe,{role:"assistant",content:c}),g&&g.length>0&&d.jsx(SJe,{toolCalls:g}),d.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 rounded-lg border border-border bg-card/50 px-3 py-2 text-[10px] text-muted-foreground",children:[h&&d.jsxs("span",{children:[d.jsxs("strong",{className:"text-foreground",children:[t("promptViewer.tokens","Tokens"),":"]})," ",(h.inputTokens??0).toLocaleString()," ",t("costDashboard.in","in")," / ",(h.outputTokens??0).toLocaleString()," ",t("costDashboard.out","out")]}),u&&d.jsxs("span",{children:[d.jsxs("strong",{className:"text-foreground",children:[t("promptViewer.model","Model"),":"]})," ",u]}),i.cost>0&&d.jsxs("span",{children:[d.jsxs("strong",{className:"text-foreground",children:[t("promptViewer.cost","Cost"),":"]})," ","$",i.cost<.01?i.cost.toFixed(4):i.cost.toFixed(2)]})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("button",{onClick:m,className:"inline-flex items-center gap-1 rounded-md border border-input px-2.5 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-secondary","data-testid":"copy-prompt",children:[n?d.jsx(Ns,{className:"h-3 w-3 text-emerald-500"}):d.jsx(mo,{className:"h-3 w-3"}),n?t("promptViewer.copied","Copied!"):t("promptViewer.copy","Copy Prompt")]}),d.jsxs("button",{onClick:x,disabled:r,className:"inline-flex items-center gap-1 rounded-md border border-input px-2.5 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-secondary disabled:opacity-50","data-testid":"replay-turn",children:[d.jsx(S_,{className:be("h-3 w-3",r&&"animate-spin")}),t("promptViewer.replay","Replay This Turn")]})]})]})}const mpe={system:{icon:Mie,labelKey:"promptViewer.roleSystem",fallback:"System Prompt",color:"border-emerald-500/30 bg-emerald-500/5"},user:{icon:$ie,labelKey:"promptViewer.roleUser",fallback:"User",color:"border-blue-500/30 bg-blue-500/5"},assistant:{icon:ai,labelKey:"promptViewer.roleAssistant",fallback:"Assistant",color:"border-primary/30 bg-primary/5"},tool:{icon:zb,labelKey:"promptViewer.roleTool",fallback:"Tool Result",color:"border-amber-500/30 bg-amber-500/5"}};function bpe({role:i,content:e}){const{t}=xe(),[n,s]=L.useState(i==="system"||i==="user"),r=mpe[i]??mpe.assistant,o=r.icon,a=t(r.labelKey,r.fallback),l=e.length>300;return d.jsxs("div",{className:be("rounded-lg border p-2.5",r.color),children:[d.jsxs("button",{onClick:()=>s(!n),"aria-expanded":n,className:"flex w-full items-center gap-1.5 text-start",children:[d.jsx(o,{className:"h-3.5 w-3.5 shrink-0 text-foreground/60"}),d.jsx("span",{className:"text-[11px] font-semibold text-foreground/80",children:a}),l&&d.jsx(Rn,{className:be("ms-auto h-3 w-3 text-muted-foreground transition-transform",n&&"rotate-180")})]}),n&&d.jsx("pre",{className:"mt-1.5 text-[10px] font-mono text-foreground/70 whitespace-pre-wrap break-all max-h-48 overflow-y-auto",children:e})]})}function SJe({toolCalls:i}){const{t:e}=xe();return d.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-2.5 space-y-1",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-semibold text-foreground/80",children:[d.jsx(zb,{className:"h-3.5 w-3.5"}),e("promptViewer.toolCalls","Tool Calls")," (",i.length,")"]}),i.map((t,n)=>d.jsx("pre",{className:"text-[10px] font-mono text-foreground/70 whitespace-pre-wrap break-all",children:JSON.stringify(t,null,2)},n))]})}function kJe(i){try{const r=JSON.parse(i);if(Array.isArray(r))return r.map(o=>({role:o.role??"user",content:o.content??JSON.stringify(o)}))}catch{}const e=[],t=i.split(`
-`);let n="system",s=[];for(const r of t){const o=r.toLowerCase().trim();let a=null;if(o.startsWith("system:")||o==="[system]"?a="system":o.startsWith("user:")||o==="[user]"?a="user":o.startsWith("assistant:")||o==="[assistant]"?a="assistant":(o.startsWith("tool:")||o==="[tool]")&&(a="tool"),a){s.length>0&&(e.push({role:n,content:s.join(`
-`).trim()}),s=[]),n=a;const l=r.indexOf(":");l>=0&&l0&&e.push({role:n,content:s.join(`
-`).trim()}),e.length===1&&e[0].role==="system"?[{role:"system",content:i}]:e}function xpe({message:i}){return d.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center",children:[d.jsx(OSe,{className:"h-8 w-8 text-muted-foreground/30"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:i})]})}const A0=[{id:"pipeline",labelKey:"debugDrawer.tabPipeline",fallback:"Pipeline",icon:d.jsx(Vb,{className:"h-3.5 w-3.5"})},{id:"costs",labelKey:"debugDrawer.tabCosts",fallback:"Costs",icon:d.jsx(DSe,{className:"h-3.5 w-3.5"})},{id:"memory",labelKey:"debugDrawer.tabMemory",fallback:"Memory",icon:d.jsx(C_,{className:"h-3.5 w-3.5"})},{id:"logs",labelKey:"debugDrawer.tabLogs",fallback:"Logs",icon:d.jsx($v,{className:"h-3.5 w-3.5"})},{id:"prompt",labelKey:"debugDrawer.tabPrompt",fallback:"Prompt",icon:d.jsx(OSe,{className:"h-3.5 w-3.5"})}];function pEe({conversationId:i,agentId:e}){const{t}=xe(),n=bu(l=>l.isDebugOpen),s=bu(l=>l.activeTab),r=bu(l=>l.setActiveTab),o=bu(l=>l.toggleDebug),a=L.useCallback(l=>{const c=A0.findIndex(f=>f.id===s);let u=null;switch(l.key){case"ArrowRight":case"ArrowDown":u=(c+1)%A0.length;break;case"ArrowLeft":case"ArrowUp":u=(c-1+A0.length)%A0.length;break;case"Home":u=0;break;case"End":u=A0.length-1;break;default:return}l.preventDefault();const h=A0[u];r(h.id);const g=document.getElementById(`debug-tab-${h.id}`);g==null||g.focus()},[s,r]);return d.jsxs("div",{"data-testid":"debug-drawer",children:[d.jsxs("button",{onClick:o,"aria-expanded":n,"aria-controls":"debug-drawer-content",className:be("flex w-full items-center justify-center gap-1.5 border-t border-border px-4 py-1.5 text-xs font-medium transition-colors",n?"bg-primary/5 text-primary hover:bg-primary/10":"text-muted-foreground hover:bg-muted hover:text-foreground"),"data-testid":"debug-toggle",children:[n?d.jsx(Rn,{className:"h-3.5 w-3.5"}):d.jsx(Y_,{className:"h-3.5 w-3.5"}),t("debugDrawer.title","Debug")]}),n&&d.jsxs("div",{id:"debug-drawer-content",className:"flex flex-col border-t border-border bg-background",children:[d.jsx("div",{className:"flex border-b border-border overflow-x-auto",role:"tablist","aria-label":t("debugDrawer.title","Debug"),children:A0.map(l=>d.jsxs("button",{role:"tab","aria-selected":s===l.id,"aria-controls":`debug-tabpanel-${l.id}`,id:`debug-tab-${l.id}`,tabIndex:s===l.id?0:-1,onClick:()=>r(l.id),onKeyDown:a,className:be("flex items-center gap-1 whitespace-nowrap px-3 py-2 text-xs font-medium transition-colors",s===l.id?"border-b-2 border-primary text-primary":"text-muted-foreground hover:text-foreground"),"data-testid":`debug-tab-${l.id}`,children:[l.icon,d.jsx("span",{className:"hidden sm:inline",children:t(l.labelKey,l.fallback)})]},l.id))}),d.jsxs("div",{role:"tabpanel",id:`debug-tabpanel-${s}`,"aria-labelledby":`debug-tab-${s}`,className:"overflow-y-auto",style:{maxHeight:"40vh"},children:[s==="pipeline"&&d.jsx(iJe,{conversationId:i}),s==="costs"&&d.jsx(uJe,{conversationId:i,isActive:!0}),s==="memory"&&d.jsx(fJe,{conversationId:i}),s==="logs"&&d.jsx(_Je,{agentId:e,conversationId:i}),s==="prompt"&&d.jsx(wJe,{conversationId:i})]})]})]})}const NJe=["saving","deploying","starting","ready"];function vpe({current:i,error:e}){const{t}=xe(),n=[{key:"saving",label:t("chatDrawer.saving","Saving changes…")},{key:"deploying",label:t("chatDrawer.deploying","Deploying agent…")},{key:"starting",label:t("chatDrawer.starting","Starting conversation…")}];if(i==="error")return d.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 text-center",children:[d.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10",children:d.jsx(Lo,{className:"h-6 w-6 text-destructive"})}),d.jsx("p",{className:"text-sm font-medium text-destructive",children:e||t("chatDrawer.error","Something went wrong")})]});const s=NJe.indexOf(i);return d.jsx("div",{className:"space-y-3 py-6",children:n.map((r,o)=>{const a=s>o,l=s===o;return d.jsxs("div",{className:"flex items-center gap-3 px-4",children:[a?d.jsx(Xl,{className:"h-5 w-5 shrink-0 text-emerald-500"}):l?d.jsx(ni,{className:"h-5 w-5 shrink-0 animate-spin text-primary"}):d.jsx("div",{className:"h-5 w-5 shrink-0 rounded-full border-2 border-muted-foreground/30"}),d.jsx("span",{className:be("text-sm",a&&"text-emerald-600 dark:text-emerald-400 line-through opacity-70",l&&"font-medium text-foreground",!a&&!l&&"text-muted-foreground"),children:r.label})]},r.key)})})}function EJe(){const{t:i}=xe(),e=_c(w=>w.isOpen),t=_c(w=>w.agentName),n=_c(w=>w.agentId),s=_c(w=>w.step),r=_c(w=>w.errorMessage),o=_c(w=>w.close),a=Oi(w=>w.messages),l=Oi(w=>w.conversationId),c=Oi(w=>w.isProcessing),u=Oi(w=>w.isThinking),h=BM(),g=L.useRef(null);L.useEffect(()=>{var w;(w=g.current)==null||w.scrollIntoView({behavior:"smooth"})},[a]);const f=L.useCallback(()=>{n&&(Oi.getState().clearMessages(),_c.getState().setStep("starting"),h.mutate({agentId:n},{onSuccess:()=>_c.getState().setStep("ready")}))},[n,h]),m=L.useCallback(()=>{_c.getState().setStep("idle"),_c.getState().close()},[]),x=s==="ready",v=s==="saving"||s==="deploying"||s==="starting",_=s==="error";return d.jsx("div",{className:be("flex shrink-0 flex-col bg-background overflow-hidden transition-[width,opacity] duration-300 ease-in-out",e?"w-[420px] opacity-100 border-s border-border":"w-0 opacity-0"),"data-testid":"chat-drawer",role:"complementary","aria-label":i("chatDrawer.title","Test Chat"),children:e&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-4 py-2.5 shrink-0",children:[d.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-primary/10",children:d.jsx(ai,{className:"h-4 w-4 text-primary","aria-hidden":"true"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-semibold text-foreground truncate",children:i("chatDrawer.title","Test Chat")}),d.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t})]}),x&&d.jsx(rEe,{}),x&&d.jsx("button",{onClick:f,className:"flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:i("chatDrawer.newConversation","New Conversation"),"aria-label":i("chatDrawer.newConversation","New Conversation"),"data-testid":"drawer-new-conversation",children:d.jsx(Fie,{className:"h-4 w-4","aria-hidden":"true"})}),d.jsx("button",{onClick:o,className:"flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:i("common.close","Close"),"aria-label":i("common.close","Close"),"data-testid":"drawer-close",children:d.jsx(An,{className:"h-4 w-4","aria-hidden":"true"})})]}),d.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[v&&d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsx(vpe,{current:s,error:null})}),_&&d.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 p-6",children:[d.jsx(vpe,{current:"error",error:r}),d.jsxs("button",{onClick:m,className:"inline-flex items-center gap-1.5 rounded-lg border border-input px-3 py-2 text-sm font-medium text-foreground transition-colors hover:bg-secondary","data-testid":"drawer-retry",children:[d.jsx(xi,{className:"h-4 w-4"}),i("chatDrawer.retry","Try again")]})]}),s==="idle"&&!l&&d.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center",children:[d.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:d.jsx(Ih,{className:"h-8 w-8 text-primary"})}),d.jsx("p",{className:"text-sm text-muted-foreground",children:i("chatDrawer.ready","Ready — type a message to test")})]}),(x||s==="idle"&&l)&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex-1 overflow-y-auto","aria-live":"polite","aria-relevant":"additions",children:a.length===0?d.jsx("div",{className:"flex h-full items-center justify-center",children:d.jsxs("div",{className:"text-center",children:[d.jsx(ai,{className:"mx-auto h-10 w-10 text-muted-foreground/30"}),d.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:i("chatDrawer.ready","Ready — type a message to test")})]})}):d.jsxs("div",{className:"py-3",children:[a.map(w=>d.jsx(sEe,{message:w},w.id)),u&&d.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-sm text-muted-foreground animate-pulse",children:[d.jsx(ni,{className:"h-4 w-4 animate-spin"}),d.jsx("span",{className:"italic",children:i("chat.thinking")})]}),d.jsx("div",{ref:g})]})}),d.jsx(LJe,{}),l&&d.jsx(pEe,{conversationId:l,agentId:n}),d.jsx(DJe,{disabled:!l,isProcessing:c})]})]})]})})}function LJe(){const i=Oi(n=>n.quickReplies),e=Oi(n=>n.isProcessing),t=ise();return i.length===0||e?null:d.jsx("div",{className:"flex flex-wrap gap-1.5 border-t border-border px-3 py-2 shrink-0",children:i.map((n,s)=>d.jsx("button",{type:"button",onClick:()=>t.mutate({message:n}),className:"rounded-full border border-primary/30 bg-primary/5 px-2.5 py-1 text-xs font-medium text-primary transition-colors hover:bg-primary/15","data-testid":"drawer-quick-reply",children:n},`${n}-${s}`))})}function DJe({disabled:i=!1,isProcessing:e=!1}){const{t}=xe(),[n,s]=L.useState(""),r=L.useRef(null),o=ise(),a=L.useCallback(()=>{const u=n.trim();!u||i||e||(o.mutate({message:u}),s(""),r.current&&(r.current.style.height="auto"))},[n,i,e,o]),l=L.useCallback(()=>{const u=r.current;u&&(u.style.height="auto",u.style.height=`${Math.min(u.scrollHeight,120)}px`)},[]),c=n.trim().length>0&&!i&&!e;return d.jsx("div",{className:"border-t border-border bg-background p-3 shrink-0",children:d.jsxs("div",{className:"flex items-end gap-2",children:[d.jsx("textarea",{ref:r,"data-testid":"drawer-chat-input",value:n,onChange:u=>{s(u.target.value),l()},onKeyDown:u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),a())},placeholder:t("chat.placeholder"),disabled:i,rows:1,className:be("flex-1 resize-none rounded-xl border border-input bg-card px-3 py-2.5 text-sm","placeholder:text-muted-foreground","focus:outline-none focus:ring-2 focus:ring-ring","disabled:cursor-not-allowed disabled:opacity-50","max-h-[120px] min-h-[40px]")}),d.jsx("button",{onClick:a,disabled:!c,className:be("flex h-10 w-10 shrink-0 items-center justify-center rounded-xl transition-colors",c?"bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer":"bg-muted text-muted-foreground cursor-not-allowed"),"aria-label":t("chat.send"),"data-testid":"drawer-chat-send",children:e?d.jsx(ni,{className:"h-4 w-4 animate-spin"}):d.jsx(mA,{className:"h-4 w-4"})})]})})}const TJe=[{icon:ai,titleKey:"onboarding.welcome.buildAgents",descKey:"onboarding.welcome.buildAgentsDesc",gradient:"from-violet-500 to-indigo-600"},{icon:zb,titleKey:"onboarding.welcome.designWorkflows",descKey:"onboarding.welcome.designWorkflowsDesc",gradient:"from-emerald-500 to-teal-600"},{icon:Jf,titleKey:"onboarding.welcome.testRealtime",descKey:"onboarding.welcome.testRealtimeDesc",gradient:"from-blue-500 to-cyan-600"},{icon:l7,titleKey:"onboarding.welcome.monitorOperate",descKey:"onboarding.welcome.monitorOperateDesc",gradient:"from-amber-500 to-orange-600"}],wT=3;function IJe(){const{t:i}=xe(),e=$s(c=>c.showWelcome),t=$s(c=>c.dismissWelcome),n=$s(c=>c.startChapter),[s,r]=L.useState(0),o=L.useCallback(()=>{t(),n("dashboard")},[t,n]),a=L.useCallback(()=>{t()},[t]),l=L.useRef(null);return L.useEffect(()=>{var h;if(!e)return;const c=document.body.style.overflow;document.body.style.overflow="hidden";const u=g=>{switch(g.key){case"ArrowRight":g.preventDefault(),r(f=>Math.min(f+1,wT-1));break;case"ArrowLeft":g.preventDefault(),r(f=>Math.max(f-1,0));break;case"Escape":g.preventDefault(),a();break;case"Tab":{if(!l.current)break;const f=l.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(f.length===0)break;const m=f[0],x=f[f.length-1];if(!m||!x)break;g.shiftKey&&document.activeElement===m?(g.preventDefault(),x.focus()):!g.shiftKey&&document.activeElement===x&&(g.preventDefault(),m.focus());break}}};return document.addEventListener("keydown",u),(h=l.current)==null||h.focus(),()=>{document.removeEventListener("keydown",u),document.body.style.overflow=c}},[e,a]),e?hg.createPortal(d.jsx("div",{className:"welcome-modal-backdrop fixed inset-0 z-10000 flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-label":i("onboarding.welcome.title"),"data-testid":"welcome-modal",children:d.jsxs("div",{ref:l,className:"welcome-modal-card w-full max-w-xl rounded-2xl shadow-2xl outline-none",tabIndex:-1,children:[d.jsxs("div",{className:"relative min-h-[380px] p-8",children:[s===0&&d.jsxs("div",{className:"flex flex-col items-center text-center animate-[fadeIn_300ms_ease-out]",children:[d.jsxs("div",{className:"relative mb-6",children:[d.jsx("div",{className:"absolute -inset-4 rounded-full bg-primary/10 blur-xl"}),d.jsx("div",{className:"relative flex h-20 w-20 items-center justify-center rounded-2xl bg-linear-to-br from-primary to-primary/60 shadow-lg shadow-primary/25",children:d.jsx(Ll,{className:"h-10 w-10 text-primary-foreground"})})]}),d.jsx("h2",{className:"text-2xl font-bold text-white",children:i("onboarding.welcome.title")}),d.jsx("p",{className:"mt-2 text-lg text-sidebar-foreground/70",children:i("onboarding.welcome.subtitle")}),d.jsx("div",{className:"mt-4 h-0.5 w-16 rounded-full bg-linear-to-r from-transparent via-primary to-transparent"}),d.jsx("p",{className:"mt-4 max-w-sm text-sm leading-relaxed text-sidebar-foreground/50",children:i("onboarding.welcome.introText","EDDI Manager is your command center for building, testing, and operating conversational AI agents.")})]}),s===1&&d.jsxs("div",{className:"animate-[fadeIn_300ms_ease-out]",children:[d.jsx("h2",{className:"mb-2 text-center text-xl font-bold text-white",children:i("onboarding.welcome.capabilitiesTitle")}),d.jsx("p",{className:"mb-5 text-center text-sm text-sidebar-foreground/50",children:i("onboarding.welcome.capabilitiesSubtitle","Everything you need to build production-ready AI agents")}),d.jsx("div",{className:"grid grid-cols-2 gap-3",children:TJe.map(c=>{const u=c.icon;return d.jsxs("div",{className:"rounded-xl border border-sidebar-border/50 bg-sidebar-border/10 p-4",children:[d.jsx("div",{className:be("mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-linear-to-br text-white shadow-md",c.gradient),children:d.jsx(u,{className:"h-5 w-5"})}),d.jsx("p",{className:"text-sm font-semibold text-white",children:i(c.titleKey)}),d.jsx("p",{className:"mt-1 text-xs leading-relaxed text-sidebar-foreground/60",children:i(c.descKey)})]},c.titleKey)})})]}),s===2&&d.jsxs("div",{className:"flex flex-col items-center text-center animate-[fadeIn_300ms_ease-out]",children:[d.jsxs("div",{className:"relative mb-6",children:[d.jsx("div",{className:"absolute -inset-4 rounded-full bg-emerald-500/10 blur-xl"}),d.jsx("div",{className:"relative flex h-20 w-20 items-center justify-center rounded-2xl bg-linear-to-br from-emerald-500 to-teal-600 shadow-lg",children:d.jsx(wg,{className:"h-10 w-10 text-white"})})]}),d.jsx("h2",{className:"text-2xl font-bold text-white",children:i("onboarding.welcome.readyTitle")}),d.jsx("p",{className:"mt-2 text-sm text-sidebar-foreground/60",children:i("onboarding.welcome.readySubtitle")}),d.jsxs("div",{className:"mt-8 flex flex-col items-center gap-3 sm:flex-row",children:[d.jsxs("button",{onClick:o,className:"inline-flex items-center gap-2 rounded-xl bg-primary px-6 py-3 text-sm font-semibold text-primary-foreground shadow-lg shadow-primary/25 transition-all hover:bg-primary/90 hover:shadow-xl hover:shadow-primary/30 active:scale-[0.97]","data-testid":"welcome-start-tour",children:[d.jsx(Ll,{className:"h-4 w-4"}),i("onboarding.welcome.startTour")]}),d.jsx("button",{onClick:a,className:"inline-flex items-center gap-2 rounded-xl border border-sidebar-border px-6 py-3 text-sm font-medium text-sidebar-foreground/70 transition-colors hover:border-sidebar-foreground/30 hover:text-sidebar-foreground","data-testid":"welcome-explore",children:i("onboarding.welcome.exploreOwn")})]})]})]}),d.jsxs("div",{className:"flex items-center justify-between border-t border-sidebar-border px-6 py-4",children:[d.jsx("button",{onClick:()=>r(c=>Math.max(c-1,0)),disabled:s===0,className:be("rounded-lg p-1.5 transition-colors",s===0?"invisible":"text-sidebar-foreground/50 hover:text-sidebar-foreground hover:bg-sidebar-accent/10"),"aria-label":i("onboarding.tour.back"),children:d.jsx(El,{className:"h-4 w-4"})}),d.jsx("div",{className:"flex items-center gap-2",children:Array.from({length:wT}).map((c,u)=>d.jsx("button",{onClick:()=>r(u),className:be("carousel-dot h-2 rounded-full transition-all",u===s?"carousel-dot-active w-6 bg-primary":"w-2 bg-sidebar-foreground/30 hover:bg-sidebar-foreground/50"),"aria-label":`Panel ${u+1}`},u))}),d.jsx("button",{onClick:()=>r(c=>Math.min(c+1,wT-1)),disabled:s===wT-1,className:be("rounded-lg p-1.5 transition-colors",s===wT-1?"invisible":"text-sidebar-foreground/50 hover:text-sidebar-foreground hover:bg-sidebar-accent/10"),"aria-label":i("onboarding.tour.next"),children:d.jsx(wg,{className:"h-4 w-4"})})]})]})}),document.body):null}function AJe(i,e=8){const[t,n]=L.useState(null),s=L.useCallback(()=>{if(!i){n(null);return}const r=document.querySelector(i);if(!r){n(null);return}const o=r.getBoundingClientRect();n({top:o.top-e,left:o.left-e,width:o.width+e*2,height:o.height+e*2})},[i,e]);return L.useEffect(()=>{s();const r=()=>requestAnimationFrame(s);return window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),()=>{window.removeEventListener("resize",r),window.removeEventListener("scroll",r,!0)}},[s]),t}function RJe({targetSelector:i,padding:e=8,onOverlayClick:t}){const[n,s]=L.useState(null),r=L.useCallback(()=>{const o=document.querySelector(i);if(!o){s(null);return}const a=o.getBoundingClientRect(),l=window.innerHeight,c=window.innerWidth,u=Math.max(0,a.top)-e,h=Math.max(0,a.left)-e,g=Math.min(l,a.bottom)+e,f=Math.min(c,a.right)+e;s({top:u,left:h,width:f-h,height:g-u})},[i,e]);return L.useEffect(()=>{r();let o=0;const a=()=>{cancelAnimationFrame(o),o=requestAnimationFrame(r)};return window.addEventListener("resize",a),window.addEventListener("scroll",a,!0),()=>{cancelAnimationFrame(o),window.removeEventListener("resize",a),window.removeEventListener("scroll",a,!0)}},[r]),L.useEffect(()=>{const o=document.querySelector(i);if(!o)return;const a=o.getBoundingClientRect(),l=window.innerHeight,c=window.innerWidth,u=a.top>=-50&&a.top<=l-100,h=a.left>=0&&a.right<=c;(!u||!h)&&(o.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout(r,400))},[i,r]),n?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-9997",onClick:t,"data-testid":"tour-overlay-backdrop","aria-hidden":"true"}),d.jsx("div",{className:"tour-spotlight",style:{position:"fixed",top:n.top,left:n.left,width:n.width,height:n.height,zIndex:9998,pointerEvents:"none"},"data-testid":"tour-spotlight","aria-hidden":"true"})]}):null}const G0=340,$g=200,Yu=12,IS=16;function MJe(i,e){const t=window.innerWidth,n=window.innerHeight,s=Math.max(0,i.top),r=Math.min(n,i.top+i.height),o=Math.max(0,r-s),a=s+o/2,l=Math.max(0,i.left),c=Math.min(t,i.left+i.width),u=Math.max(0,c-l),h=l+u/2,g=n-r,f=s,m=t-c,x=l;let v;e==="auto"?g>=$g+Yu?v="bottom":f>=$g+Yu?v="top":m>=G0+Yu*2?v="right":x>=G0+Yu*2?v="left":v="bottom":(v=e,v==="bottom"&&g<$g+Yu?f>=$g+Yu&&(v="top"):v==="top"&&f<$g+Yu&&g>=$g+Yu&&(v="bottom"));let _=0,w=0;switch(v){case"bottom":_=r+Yu,w=h-G0/2;break;case"top":_=s-Yu,w=h-G0/2;break;case"right":_=a-$g/2,w=c+Yu;break;case"left":_=a-$g/2,w=l-G0-Yu;break}return w=Math.max(IS,Math.min(w,t-G0-IS)),v!=="top"?_=Math.max(IS,Math.min(_,n-$g-IS)):_=Math.max($g+IS,Math.min(_,n-IS)),{top:_,left:w,resolved:v}}function PJe({chapterTitleKey:i,titleKey:e,descriptionKey:t,currentStep:n,totalSteps:s,placement:r,targetRect:o,onNext:a,onPrev:l,onSkip:c,isFirstStep:u,isLastStep:h}){const{t:g}=xe(),{top:f,left:m,resolved:x}=MJe(o,r),v=(n+1)/s*100;return d.jsx("div",{className:be("tour-tooltip fixed z-9999",x==="top"&&"-translate-y-full"),style:{top:f,left:m,width:G0},role:"dialog","aria-label":g(e),"data-testid":"tour-tooltip",children:d.jsxs("div",{className:"rounded-xl border border-primary/20 bg-sidebar text-sidebar-foreground shadow-2xl shadow-black/30 overflow-hidden",children:[d.jsx("div",{className:"h-1 w-full bg-sidebar-border",children:d.jsx("div",{className:"h-full bg-primary transition-all duration-500 ease-out",style:{width:`${v}%`}})}),d.jsxs("div",{className:"p-4",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-primary",children:g(i)}),d.jsx("span",{className:"text-[11px] font-medium text-sidebar-foreground/50",children:g("onboarding.tour.stepOf",{current:n+1,total:s})})]}),d.jsx("h3",{className:"text-[15px] font-semibold text-white leading-tight",children:g(e)}),d.jsx("p",{className:"mt-1.5 text-[13px] leading-relaxed text-sidebar-foreground/70",children:g(t)}),d.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[d.jsxs("button",{onClick:l,disabled:u,className:be("inline-flex items-center gap-1 rounded-lg px-3 py-1.5 text-xs font-medium transition-colors",u?"invisible":"text-sidebar-foreground/60 hover:text-sidebar-foreground hover:bg-sidebar-accent/10"),"data-testid":"tour-back",children:[d.jsx(El,{className:"h-3.5 w-3.5"}),g("onboarding.tour.back")]}),d.jsxs("button",{onClick:c,className:"inline-flex items-center gap-1 rounded-lg px-3 py-1.5 text-xs font-medium text-sidebar-foreground/40 hover:text-sidebar-foreground/70 transition-colors","data-testid":"tour-skip",children:[d.jsx(An,{className:"h-3 w-3"}),g("onboarding.tour.skip")]}),d.jsx("button",{onClick:a,className:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-4 py-1.5 text-xs font-semibold text-primary-foreground shadow-sm transition-all hover:bg-primary/90 active:scale-[0.97]","data-testid":"tour-next",children:h?d.jsxs(d.Fragment,{children:[d.jsx(Ll,{className:"h-3.5 w-3.5"}),g("onboarding.tour.finish")]}):d.jsxs(d.Fragment,{children:[g("onboarding.tour.next"),d.jsx(wg,{className:"h-3.5 w-3.5"})]})})]})]})]})})}function OJe(){const i=$s(m=>m.activeChapter),e=$s(m=>m.currentStep),t=$s(m=>m.nextStep),n=$s(m=>m.prevStep),s=$s(m=>m.skipChapter),r=$s(m=>m.completeChapter),o=i?Xie[i]:null,a=(o==null?void 0:o.steps.length)??0,l=Math.min(e,Math.max(0,a-1)),c=(o==null?void 0:o.steps[l])??null,u=l===0,h=l===a-1,g=AJe((c==null?void 0:c.target)??"",(c==null?void 0:c.padding)??8),f=L.useCallback(()=>{h?r():t()},[h,r,t]);return L.useEffect(()=>{if(!i)return;const m=x=>{var _;const v=(_=x.target)==null?void 0:_.tagName;if(!(v==="INPUT"||v==="TEXTAREA"||v==="SELECT"))switch(x.key){case"ArrowRight":case"Enter":x.preventDefault(),f();break;case"ArrowLeft":x.preventDefault(),u||n();break;case"Escape":x.preventDefault(),s();break}};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[i,f,u,n,s]),L.useEffect(()=>{if(!i)return;const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}},[i]),!i||!o||!c||!g?null:hg.createPortal(d.jsxs(d.Fragment,{children:[d.jsx(RJe,{targetSelector:c.target,padding:c.padding??8}),d.jsx(PJe,{chapterTitleKey:o.titleKey,titleKey:c.titleKey,descriptionKey:c.descriptionKey,currentStep:l,totalSteps:a,placement:c.placement,targetRect:g,onNext:f,onPrev:n,onSkip:s,isFirstStep:u,isLastStep:h})]}),document.body)}function jJe(){const{t:i}=xe(),e=$s(f=>f.offeredChapter),t=$s(f=>f.acceptOffer),n=$s(f=>f.dismissOffer),s=$s(f=>f.dismissAllOffers),[r,o]=L.useState(!1),[a,l]=L.useState(!1),c=e?Xie[e]:null;L.useEffect(()=>{if(!e){o(!1),l(!1);return}const f=setTimeout(()=>o(!0),600),m=setTimeout(()=>{u()},12e3);return()=>{clearTimeout(f),clearTimeout(m)}},[e]);const u=()=>{l(!0),setTimeout(()=>{n(),l(!1),o(!1)},300)},h=()=>{l(!0),setTimeout(()=>{s(),l(!1),o(!1)},300)},g=()=>{o(!1),t()};return!e||!c||!r?null:hg.createPortal(d.jsx("div",{className:`fixed bottom-6 inset-x-0 z-50 flex justify-center pointer-events-none transition-all duration-300 ${a?"translate-y-4 opacity-0":"translate-y-0 opacity-100"}`,"data-testid":"tour-offer-bar",children:d.jsxs("div",{className:"pointer-events-auto flex items-center gap-3 rounded-xl border border-primary/20 bg-sidebar px-4 py-2.5 shadow-xl shadow-black/20 backdrop-blur-sm",children:[d.jsx(Ll,{className:"h-4 w-4 text-primary shrink-0"}),d.jsx("span",{className:"text-sm text-sidebar-foreground/80",children:i("onboarding.offer.message",{page:i(c.titleKey),defaultValue:"New here? Take the {{page}}"})}),d.jsx("button",{onClick:g,className:"rounded-lg bg-primary px-3 py-1 text-xs font-semibold text-primary-foreground transition-all hover:bg-primary/90 active:scale-[0.97]","data-testid":"tour-offer-accept",children:i("onboarding.offer.accept","Show me")}),d.jsx("button",{onClick:h,className:"text-[11px] text-sidebar-foreground/40 hover:text-sidebar-foreground/70 transition-colors whitespace-nowrap","data-testid":"tour-offer-dismiss-all",children:i("onboarding.offer.dontAsk","Don't ask again")}),d.jsx("button",{onClick:u,className:"rounded p-0.5 text-sidebar-foreground/30 hover:text-sidebar-foreground/60 transition-colors","aria-label":i("common.close","Close"),"data-testid":"tour-offer-dismiss",children:d.jsx(An,{className:"h-3.5 w-3.5"})})]})}),document.body)}function FJe(){const{t:i}=xe(),[e,t]=L.useState(!1);return!window.__EDDI_MOCK_ACTIVE__||new URLSearchParams(window.location.search).get("hideMockBanner")==="true"||e?null:d.jsxs("div",{className:"relative flex items-center justify-center gap-2 bg-amber-500/90 px-4 py-1.5 text-xs font-medium text-amber-950 dark:bg-amber-600/90 dark:text-amber-50",children:[d.jsx(Vi,{className:"h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:i("mockBanner.message","Demo Mode — Displaying sample data. Connect an EDDI backend for real data.")}),d.jsx("button",{onClick:()=>t(!0),className:"absolute inset-e-2 top-1/2 -translate-y-1/2 rounded p-0.5 hover:bg-amber-600/30 dark:hover:bg-amber-800/40 transition-colors","aria-label":i("common.dismiss","Dismiss"),children:d.jsx(An,{className:"h-3.5 w-3.5"})})]})}function BJe(){const i=mp(),{t:e}=xe();L.useEffect(()=>{const t=i.pathname.replace(/^\/manage\/?/,"").split("/").filter(Boolean),n={agents:e("nav.agents"),workflows:e("nav.packages"),conversations:e("nav.conversations"),chat:e("nav.chat"),resources:e("nav.resources"),groups:e("nav.groups","Groups"),coordinator:e("nav.coordinator","Coordinator"),schedules:e("nav.schedules","Schedules"),logs:e("nav.logs","Logs"),orphans:e("nav.orphans","Orphans"),secrets:e("nav.secrets","Secrets"),audit:e("nav.audit","Audit Trail"),quotas:e("nav.quotas","Quotas"),userdata:e("userData.title","User Data"),triggers:e("nav.triggers","Triggers"),capabilities:e("nav.capabilities","Capabilities"),sync:e("nav.sync","Sync"),gdpr:e("nav.gdpr","GDPR"),wizard:e("wizard.title","Agent Wizard"),studio:e("nav.studio","Agent Studio"),properties:e("nav.properties","Properties")};if(t.length===0)document.title=`${e("nav.dashboard")} — EDDI Manager`;else{const s=t[0].replace(/view$/,""),r=n[s]??s;document.title=`${r} — EDDI Manager`}},[i.pathname,e])}function HJe(){const{t:i}=xe();BJe();const[e,t]=L.useState(!1),[n,s]=L.useState(!1),[r,o]=L.useState(!1);return L.useEffect(()=>{const a=()=>o(window.innerWidth<768);return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),L.useEffect(()=>{r||s(!1)},[r]),L.useEffect(()=>{if(!n)return;const a=l=>{l.key==="Escape"&&s(!1)};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[n]),d.jsxs("div",{className:"flex h-screen overflow-hidden","data-testid":"app-layout",children:[d.jsx("a",{href:"#main-content",className:"skip-to-main",children:i("common.skipToMain","Skip to main content")}),!r&&d.jsx(nfe,{collapsed:e,onToggle:()=>t(a=>!a)}),r&&n&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 transition-opacity",onClick:()=>s(!1),"aria-hidden":"true","data-testid":"sidebar-overlay"}),d.jsx("div",{className:"fixed inset-y-0 start-0 z-50 w-64",children:d.jsx(nfe,{collapsed:!1,onToggle:()=>s(!1)})})]}),d.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[d.jsx(FJe,{}),d.jsx(VVe,{onMenuClick:()=>s(!0),sidebarVisible:n}),d.jsx("main",{id:"main-content",className:be("flex-1 overflow-auto bg-background p-6","transition-all duration-300"),children:d.jsx("div",{className:"@container/main mx-auto max-w-screen-2xl",children:d.jsx(T6e,{})})})]}),d.jsx(EJe,{}),d.jsx(IJe,{}),d.jsx(OJe,{}),d.jsx(jJe,{})]})}class WJe extends L.Component{constructor(t){super(t);kt(this,"reset",()=>{this.setState({error:null})});this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){}componentDidUpdate(t){this.props.resetKey!==t.resetKey&&this.state.error!==null&&this.setState({error:null})}render(){return this.state.error?this.props.fallback?this.props.fallback(this.state.error,this.reset):d.jsx(VJe,{error:this.state.error,onReset:this.reset}):this.props.children}}function VJe({error:i,onReset:e}){const{t}=xe();return d.jsxs("div",{className:"flex min-h-[200px] flex-col items-center justify-center gap-4 rounded-xl border border-destructive/30 bg-destructive/5 p-8",role:"alert","data-testid":"error-boundary-fallback",children:[d.jsx("div",{className:"rounded-full bg-destructive/10 p-3",children:d.jsx(Vi,{className:"h-6 w-6 text-destructive"})}),d.jsxs("div",{className:"text-center",children:[d.jsx("h3",{className:"text-sm font-semibold text-foreground",children:t("errorBoundary.title","Something went wrong")}),d.jsx("p",{className:"mt-1 max-w-md text-xs text-muted-foreground",children:i.message})]}),d.jsxs("button",{onClick:e,className:"inline-flex items-center gap-1.5 rounded-lg border border-border px-4 py-2 text-xs font-medium text-foreground transition-colors hover:bg-muted",children:[d.jsx(S_,{className:"h-3.5 w-3.5"}),t("errorBoundary.retry","Try Again")]})]})}function T7(i=100,e=0,t=""){const n=new URLSearchParams({limit:String(i),index:String(e)});return t&&n.set("filter",t),Oe.get(`/workflowstore/workflows/descriptors?${n.toString()}`)}function qM(i,e){return Oe.get(`/workflowstore/workflows/${i}?version=${e}`)}function zJe(i){return Oe.post("/workflowstore/workflows",i)}function Dse(i,e,t){return Oe.put(`/workflowstore/workflows/${i}?version=${e}`,t)}function UJe(i,e,t){const n=new URLSearchParams({version:String(e)});return Oe.delete(`/workflowstore/workflows/${i}?${n}`)}async function $Je(i){const t=await Oe.get(`/workflowstore/workflows/${i}/currentversion`)??1,s=(await Promise.all(Array.from({length:t},(r,o)=>o+1).map(async r=>{try{return await Oe.get(`/workflowstore/workflows/descriptors?filter=${i}&version=${r}`)}catch{return[]}}))).flat();return s.length===0?Oe.get(`/workflowstore/workflows/descriptors?filter=${i}`):s}function qJe(i,e,t=!1){const n=new URLSearchParams({version:String(e),deepCopy:String(t)});return Oe.post(`/workflowstore/workflows/${i}?${n}`)}async function KJe(){const[i,e,t]=await Promise.all([OL(1e3,0).catch(()=>[]),T7(1e3,0).catch(()=>[]),PL(1e3,0).catch(()=>[])]),n=new Set(i.map(r=>uo(r.resource).id)),s=new Set(e.map(r=>uo(r.resource).id));return{agentCount:n.size,workflowCount:s.size,conversationCount:t.length,resourceCount:0}}function Tse(i,e,t){const n={operation:"SET",document:t};return Oe.patch(`/descriptorstore/descriptors/${i}?version=${e}`,n)}const Ah=["agents"],CU=50;function e0(i=20,e=0,t=""){return hn({queryKey:[...Ah,"descriptors",{limit:i,index:e,filter:t}],queryFn:()=>OL(i,e,t)})}function I7(i=""){return rSe({queryKey:[...Ah,"descriptors-infinite",{filter:i}],queryFn:({pageParam:e=0})=>OL(CU,e,i),initialPageParam:0,getNextPageParam:(e,t)=>{if(e.length===CU)return t.length*CU}})}function GJe(i,e){return hn({queryKey:[...Ah,i,e],queryFn:()=>vC(i,e),enabled:!!i,placeholderData:Nie})}function mEe(i,e,t="production"){return hn({queryKey:[...Ah,"deployment",t,i,e],queryFn:()=>FM(t,i,e),enabled:!!i&&e>0,placeholderData:Nie,refetchInterval:n=>{var s;return((s=n.state.data)==null?void 0:s.status)==="IN_PROGRESS"?3e3:!1}})}function bEe(i){return hn({queryKey:[...Ah,"versions",i],queryFn:()=>sze(i),enabled:!!i,select:e=>e.map(t=>({version:uo(t.resource).version,lastModifiedOn:t.lastModifiedOn,name:t.name})).sort((t,n)=>n.version-t.version)})}function wC(){const i=cn();return Kt({mutationFn:({id:e,version:t,agent:n})=>jM(e,t,n),onSuccess:()=>{i.invalidateQueries({queryKey:Ah})}})}function YJe(i,e){return hn({queryKey:[...Ah,"deploymentStatuses",i,e],queryFn:()=>lze(i,e),enabled:!!i&&e>0,placeholderData:Nie,refetchInterval:t=>{const n=t.state.data;return n!=null&&n.some(s=>s.status==="IN_PROGRESS")?3e3:!1}})}function QJe(){const i=cn();return Kt({mutationFn:async({agent:e,name:t,description:n})=>{const s=await rze(e);if((t||n)&&s.location){const r=new URL(s.location,"http://dummy"),o=r.pathname.split("/").filter(Boolean),a=o[o.length-1],l=parseInt(r.searchParams.get("version")||"1",10);await Tse(a,l,{name:t,description:n})}return s},onSuccess:()=>{i.invalidateQueries({queryKey:Ah})}})}function xEe(){const i=cn();return Kt({mutationFn:({id:e,version:t})=>mke(e,t),onSuccess:()=>{i.invalidateQueries({queryKey:Ah})}})}function vEe(){const i=cn();return Kt({mutationFn:({id:e,version:t,deepCopy:n})=>oze(e,t,n),onSuccess:()=>{i.invalidateQueries({queryKey:Ah})}})}function _Ee(){const i=cn();return Kt({mutationFn:({environment:e="production",agentId:t,version:n})=>ese(e,t,n),onSuccess:()=>{i.invalidateQueries({queryKey:Ah}),i.invalidateQueries({queryKey:["chat","deployedAgents"]})}})}function yEe(){const i=cn();return Kt({mutationFn:({environment:e="production",agentId:t,version:n})=>aze(e,t,n),onSuccess:()=>{i.invalidateQueries({queryKey:Ah}),i.invalidateQueries({queryKey:["chat","deployedAgents"]})}})}function Cg(i){const e=new Map;for(const t of i){const{id:n,version:s}=uo(t.resource),r=e.get(n);(!r||s>r.version)&&e.set(n,{...t,id:n,version:s})}return Array.from(e.values()).sort((t,n)=>n.lastModifiedOn-t.lastModifiedOn)}const VL="/administration/coordinator";async function wEe(){return Oe.get(`${VL}/status`)}async function XJe(){return Oe.get(`${VL}/dead-letters`)}async function ZJe(i){return Oe.post(`${VL}/dead-letters/${i}/replay`)}async function JJe(i){return Oe.delete(`${VL}/dead-letters/${i}`)}async function eet(){return Oe.delete(`${VL}/dead-letters`)}function tet(){return new hEe(`${window.location.origin}${VL}/stream`,Oe.getAuthHeader())}function net(){return hn({queryKey:["dashboard","stats"],queryFn:KJe,staleTime:3e4})}function iet(){return e0(4,0)}function set(i=5){return hn({queryKey:["dashboard","recent-conversations",i],queryFn:()=>PL(i),staleTime:3e4})}function ret(){return hn({queryKey:["dashboard","coordinator-status"],queryFn:wEe,staleTime:6e4,retry:1})}const KM="/secretstore/secrets";async function oet(i){const e=await fetch(`${Oe.getBaseUrl()}${KM}/${i}`,{headers:Oe.getAuthHeader()});return e.ok?e.json():[]}async function CEe(i,e,t,n,s){const r={value:t};n&&(r.description=n),s&&(r.allowedAgents=s);const o=await fetch(`${Oe.getBaseUrl()}${KM}/${i}/${e}`,{method:"PUT",headers:{"Content-Type":"application/json",...Oe.getAuthHeader()},body:JSON.stringify(r)});if(!o.ok){if(o.status===503)throw new Error("Secrets vault is not configured. Set up a secret provider in the EDDI backend.");const a=await o.json().catch(()=>({error:"Unknown error"}));throw new Error(a.error||`Failed to store secret (HTTP ${o.status})`)}return o.json()}async function aet(i,e){const t=await fetch(`${Oe.getBaseUrl()}${KM}/${i}/${e}`,{method:"DELETE",headers:Oe.getAuthHeader()});if(!t.ok&&t.status!==204){if(t.status===503)throw new Error("Secrets vault is not configured. Set up a secret provider in the EDDI backend.");const n=await t.json().catch(()=>({error:"Unknown error"}));throw new Error(n.error||`Failed to delete secret (HTTP ${t.status})`)}}async function cet(){try{const i=await fetch(`${Oe.getBaseUrl()}${KM}/health`,{headers:Oe.getAuthHeader()}),e=await i.json();return i.status===503?{status:"DOWN",provider:e.provider??"unknown",available:!1,error:e.error,reason:e.reason,action:e.action,docs:e.docs}:e}catch{return{status:"DOWN",provider:"unknown",available:!1}}}async function det(i,e,t,n){const s={value:t};n&&(s.description=n);const r=await fetch(`${Oe.getBaseUrl()}${KM}/${i}/${e}/rotate`,{method:"POST",headers:{"Content-Type":"application/json",...Oe.getAuthHeader()},body:JSON.stringify(s)});if(!r.ok){if(r.status===503)throw new Error("Secrets vault is not configured. Set up a secret provider in the EDDI backend.");if(r.status===404||r.status===405)return CEe(i,e,t,n);const o=await r.json().catch(()=>({error:"Unknown error"}));throw new Error(o.error||`Failed to rotate secret (HTTP ${r.status})`)}return r.json()}const GM={all:["secrets"],list:i=>["secrets","list",i],health:["secrets","health"]};function SEe(i){return hn({queryKey:GM.list(i),queryFn:()=>oet(i),enabled:!!i})}function kEe(){const i=cn();return Kt({mutationFn:e=>CEe(e.tenantId,e.keyName,e.value,e.description,e.allowedAgents),onSuccess:(e,t)=>{i.invalidateQueries({queryKey:GM.list(t.tenantId)})}})}function uet(){const i=cn();return Kt({mutationFn:e=>aet(e.tenantId,e.keyName),onSuccess:(e,t)=>{i.invalidateQueries({queryKey:GM.list(t.tenantId)})}})}function Ise(){return hn({queryKey:GM.health,queryFn:cet,refetchInterval:3e4})}function het(){const i=cn();return Kt({mutationFn:e=>det(e.tenantId,e.keyName,e.newValue,e.description),onSuccess:(e,t)=>{i.invalidateQueries({queryKey:GM.list(t.tenantId)})}})}const cm=L.forwardRef(({className:i,...e},t)=>d.jsx("div",{ref:t,className:be("rounded-xl border border-border bg-card text-card-foreground shadow-sm",i),...e}));cm.displayName="Card";const NEe=L.forwardRef(({className:i,...e},t)=>d.jsx("div",{ref:t,className:be("flex flex-col space-y-1.5 p-5 pb-0",i),...e}));NEe.displayName="CardHeader";const EEe=L.forwardRef(({className:i,...e},t)=>d.jsx("h3",{ref:t,className:be("text-lg font-semibold leading-none tracking-tight",i),...e}));EEe.displayName="CardTitle";const get=L.forwardRef(({className:i,...e},t)=>d.jsx("p",{ref:t,className:be("text-sm text-muted-foreground",i),...e}));get.displayName="CardDescription";const dm=L.forwardRef(({className:i,...e},t)=>d.jsx("div",{ref:t,className:be("p-5",i),...e}));dm.displayName="CardContent";const fet=L.forwardRef(({className:i,...e},t)=>d.jsx("div",{ref:t,className:be("flex items-center p-5 pt-0",i),...e}));fet.displayName="CardFooter";function _pe(i,e){if(typeof i=="function")return i(e);i!=null&&(i.current=e)}function yb(...i){return e=>{let t=!1;const n=i.map(s=>{const r=_pe(s,e);return!t&&typeof r=="function"&&(t=!0),r});if(t)return()=>{for(let s=0;s{let{children:r,...o}=n;LEe(r)&&typeof Ij=="function"&&(r=Ij(r._payload));const a=L.Children.toArray(r),l=a.find(yet);if(l){const c=l.props.children,u=a.map(h=>h===l?L.Children.count(c)>1?L.Children.only(null):L.isValidElement(c)?c.props.children:null:h);return d.jsx(e,{...o,ref:s,children:L.isValidElement(c)?L.cloneElement(c,void 0,u):null})}return d.jsx(e,{...o,ref:s,children:r})});return t.displayName=`${i}.Slot`,t}var xet=bet("Slot");function vet(i){const e=L.forwardRef((t,n)=>{let{children:s,...r}=t;if(LEe(s)&&typeof Ij=="function"&&(s=Ij(s._payload)),L.isValidElement(s)){const o=Cet(s),a=wet(r,s.props);return s.type!==L.Fragment&&(a.ref=n?yb(n,o):o),L.cloneElement(s,a)}return L.Children.count(s)>1?L.Children.only(null):null});return e.displayName=`${i}.SlotClone`,e}var _et=Symbol("radix.slottable");function yet(i){return L.isValidElement(i)&&typeof i.type=="function"&&"__radixId"in i.type&&i.type.__radixId===_et}function wet(i,e){const t={...e};for(const n in e){const s=i[n],r=e[n];/^on[A-Z]/.test(n)?s&&r?t[n]=(...a)=>{const l=r(...a);return s(...a),l}:s&&(t[n]=s):n==="style"?t[n]={...s,...r}:n==="className"&&(t[n]=[s,r].filter(Boolean).join(" "))}return{...i,...t}}function Cet(i){var n,s;let e=(n=Object.getOwnPropertyDescriptor(i.props,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?i.ref:(e=(s=Object.getOwnPropertyDescriptor(i,"ref"))==null?void 0:s.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?i.props.ref:i.props.ref||i.ref)}const ype=i=>typeof i=="boolean"?`${i}`:i===0?"0":i,wpe=XSe,DEe=(i,e)=>t=>{var n;if((e==null?void 0:e.variants)==null)return wpe(i,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:s,defaultVariants:r}=e,o=Object.keys(s).map(c=>{const u=t==null?void 0:t[c],h=r==null?void 0:r[c];if(u===null)return null;const g=ype(u)||ype(h);return s[c][g]}),a=t&&Object.entries(t).reduce((c,u)=>{let[h,g]=u;return g===void 0||(c[h]=g),c},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:h,className:g,...f}=u;return Object.entries(f).every(m=>{let[x,v]=m;return Array.isArray(v)?v.includes({...r,...a}[x]):{...r,...a}[x]===v})?[...c,h,g]:c},[]);return wpe(i,o,l,t==null?void 0:t.class,t==null?void 0:t.className)},ket=DEe("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",{variants:{variant:{primary:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 hover:shadow-md",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-secondary hover:text-secondary-foreground",ghost:"hover:bg-secondary hover:text-secondary-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{sm:"h-8 px-3 text-xs",md:"h-10 px-4 py-2.5",lg:"h-11 px-6 text-base",icon:"h-10 w-10"}},defaultVariants:{variant:"primary",size:"md"}}),Yt=L.forwardRef(({className:i,variant:e,size:t,asChild:n=!1,...s},r)=>{const o=n?xet:"button";return d.jsx(o,{className:be(ket({variant:e,size:t,className:i})),ref:r,...s})});Yt.displayName="Button";function bi({className:i,...e}){return d.jsx("div",{className:be("animate-pulse rounded-md bg-muted",i),...e})}const Cpe={READY:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",IN_PROGRESS:"bg-blue-500/10 text-blue-600 dark:text-blue-400",ERROR:"bg-red-500/10 text-red-600 dark:text-red-400",ENDED:"bg-gray-500/10 text-gray-500"};function Net(){const{t:i}=xe(),{data:e,isLoading:t}=net(),{data:n,isLoading:s}=iet(),{data:r,isLoading:o}=set(5),{data:a}=ret(),l=gke(),{data:c}=Ise(),{data:u=[]}=e0(50),h=L.useMemo(()=>n?Cg(n).slice(0,4):[],[n]),g=L.useMemo(()=>{const v=new Map;if(u.length>0)for(const _ of Cg(u))_.name&&v.set(_.id,_.name);return v},[u]),f=$s(v=>v.maybeAutoStart);L.useEffect(()=>{const v=setTimeout(()=>f("dashboard"),500);return()=>clearTimeout(v)},[f]);const x=[{label:i("pages.dashboard.activeAgents"),value:(e==null?void 0:e.agentCount)??0,icon:ai,gradient:"from-amber-500/10 to-primary/5",iconColor:"text-primary bg-primary/10",to:"/manage/agents"},{label:i("pages.dashboard.totalWorkflows"),value:(e==null?void 0:e.workflowCount)??0,icon:Ed,gradient:"from-emerald-500/10 to-emerald-500/5",iconColor:"text-emerald-600 dark:text-emerald-400 bg-emerald-500/10",to:"/manage/workflows"},{label:i("pages.dashboard.totalConversations"),value:(e==null?void 0:e.conversationCount)??0,icon:Zl,gradient:"from-blue-500/10 to-blue-500/5",iconColor:"text-blue-600 dark:text-blue-400 bg-blue-500/10",to:"/manage/conversations"},{label:i("pages.dashboard.totalResources"),value:(e==null?void 0:e.resourceCount)??0,icon:bp,gradient:"from-violet-500/10 to-violet-500/5",iconColor:"text-violet-600 dark:text-violet-400 bg-violet-500/10",to:"/manage/resources"}].filter(v=>v.to!=="/manage/resources"||v.value>0);return d.jsxs("div",{className:"space-y-8",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-2 text-3xl font-bold text-foreground",children:[d.jsx(_j,{className:"h-8 w-8 text-primary"}),i("pages.dashboard.title")]}),d.jsx("p",{className:"mt-1 text-muted-foreground",children:i("pages.dashboard.subtitle")})]}),d.jsxs("div",{className:"flex w-fit flex-wrap items-center gap-3 rounded-xl border border-border bg-card/50 px-4 py-2.5",role:"status","aria-label":i("dashboard.platformHealth","Platform health"),"data-testid":"platform-health-strip",children:[d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx("span",{className:`inline-flex h-2 w-2 rounded-full ${l.status==="online"?"bg-emerald-500 animate-pulse":l.status==="offline"?"bg-red-500":"bg-muted-foreground animate-pulse"}`}),d.jsx("span",{className:"font-medium text-foreground",children:i("dashboard.platform","Platform")}),d.jsx("span",{className:"text-muted-foreground",children:l.status==="online"?i("dashboard.online","Online"):l.status==="offline"?i("dashboard.offline","Offline"):i("dashboard.checking","Checking…")})]}),d.jsx("div",{className:"h-4 w-px bg-border"}),d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a?a.coordinatorType==="nats"?d.jsx(ESe,{className:"h-3.5 w-3.5 text-blue-500"}):d.jsx(rb,{className:"h-3.5 w-3.5 text-purple-500"}):d.jsx(AE,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsx("span",{className:"text-muted-foreground",children:a?a.connected?i("dashboard.coordConnected","Coordinator connected"):i("dashboard.coordDisconnected","Coordinator disconnected"):i("dashboard.coordUnknown","Coordinator —")})]}),d.jsx("div",{className:"h-4 w-px bg-border"}),d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c!=null&&c.available?d.jsx(Xl,{className:"h-3.5 w-3.5 text-emerald-500"}):d.jsx(Vi,{className:"h-3.5 w-3.5 text-amber-500"}),d.jsx("span",{className:"text-muted-foreground",children:c!=null&&c.available?i("dashboard.vaultUp","Vault ready"):i("dashboard.vaultDown","Vault unavailable")})]})]}),d.jsx("div",{className:"cq-stat-grid","data-tour":"dashboard-stats",children:t?Array.from({length:4}).map((v,_)=>d.jsx(cm,{children:d.jsxs(dm,{className:"flex items-center gap-4",children:[d.jsx(bi,{className:"h-12 w-12 rounded-lg"}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(bi,{className:"h-3 w-20"}),d.jsx(bi,{className:"h-7 w-12"})]})]})},_)):x.map(v=>d.jsx(Kn,{to:v.to,"aria-label":`${v.label}: ${v.value}`,children:d.jsxs(cm,{className:"group relative overflow-hidden transition-all hover:shadow-lg hover:-translate-y-0.5 active:translate-y-0",children:[d.jsx("div",{className:be("absolute inset-0 bg-linear-to-br opacity-0 transition-opacity group-hover:opacity-100",v.gradient)}),d.jsxs(dm,{className:"relative flex items-center gap-4",children:[d.jsx("div",{className:be("rounded-lg p-3",v.iconColor),children:d.jsx(v.icon,{className:"h-6 w-6"})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:v.label}),d.jsx("p",{className:"text-2xl font-bold text-foreground tabular-nums",children:v.value>0?v.value.toLocaleString():d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground/50",children:["0 ",d.jsx(Gt,{className:"h-3 w-3"})]})})]})]})]})},v.label))}),d.jsxs("div",{children:[d.jsx("h2",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:i("pages.dashboard.quickActions")}),d.jsxs("div",{className:"flex flex-wrap gap-2","data-tour":"dashboard-actions",children:[d.jsx(Yt,{variant:"outline",asChild:!0,children:d.jsxs(Kn,{to:"/manage/agents/wizard",children:[d.jsx(RL,{className:"h-4 w-4"}),i("wizard.title")]})}),d.jsx(Yt,{variant:"outline",asChild:!0,children:d.jsxs(Kn,{to:"/manage/chat",children:[d.jsx(Jf,{className:"h-4 w-4"}),i("nav.chat")]})}),d.jsx(Yt,{variant:"outline",asChild:!0,children:d.jsxs(Kn,{to:"/manage/logs",children:[d.jsx(IL,{className:"h-4 w-4"}),i("dashboard.viewLogs","View Logs")]})}),d.jsx(Yt,{variant:"outline",asChild:!0,children:d.jsxs(Kn,{to:"/manage/audit",children:[d.jsx(bh,{className:"h-4 w-4"}),i("dashboard.auditTrail","Audit Trail")]})}),d.jsx(Yt,{variant:"outline",asChild:!0,children:d.jsxs(Kn,{to:"/manage/secrets",children:[d.jsx(Uv,{className:"h-4 w-4"}),i("dashboard.secretVault","Secret Vault")]})}),d.jsx(Yt,{variant:"outline",asChild:!0,children:d.jsxs(Kn,{to:"/manage/groups/wizard",children:[d.jsx(pA,{className:"h-4 w-4"}),i("dashboard.createGroup","Create Group")]})})]})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[d.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:i("dashboard.recentConversations","Recent Conversations")}),d.jsxs(Kn,{to:"/manage/conversations",className:"inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline",children:[i("nav.conversations"),d.jsx(wg,{className:"h-3 w-3"})]})]}),o?d.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((v,_)=>d.jsx(cm,{children:d.jsxs(dm,{className:"flex items-center gap-3 py-3",children:[d.jsx(bi,{className:"h-8 w-8 rounded-lg"}),d.jsxs("div",{className:"flex-1 space-y-1.5",children:[d.jsx(bi,{className:"h-3 w-40"}),d.jsx(bi,{className:"h-3 w-24"})]})]})},_))}):!r||r.length===0?d.jsx(cm,{children:d.jsxs(dm,{className:"flex items-center gap-3 py-6 text-muted-foreground",children:[d.jsx(Zl,{className:"h-8 w-8 text-muted-foreground/30"}),d.jsx("p",{className:"text-sm",children:i("dashboard.noConversations","No conversations yet")})]})}):d.jsx("div",{className:"flex flex-col gap-4","data-testid":"recent-conversations",children:r.map(v=>{const _=dg(v.resource),w=g.get(v.agentId),k=v.name||w||i("agents.unnamed","Unnamed Agent");return d.jsx(Kn,{to:`/manage/conversationview/${_}`,children:d.jsx(cm,{className:"transition-all hover:shadow-sm hover:border-primary/20",children:d.jsxs(dm,{className:"flex items-center gap-3 py-3",children:[d.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10",children:d.jsx(ai,{className:"h-4 w-4 text-primary"})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:k}),d.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:[_.slice(0,12),"… · v",v.agentVersion]})]}),d.jsx("span",{className:be("shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide",Cpe[v.conversationState]??Cpe.ENDED),children:v.conversationState}),d.jsx("span",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:v.lastModifiedOn?Tw(v.lastModifiedOn):"—"})]})})},_)})})]}),d.jsxs("div",{"data-testid":"recent-agents",children:[d.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[d.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:i("pages.dashboard.recentAgents")}),d.jsxs(Kn,{to:"/manage/agents",className:"inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline",children:[i("nav.agents"),d.jsx(wg,{className:"h-3 w-3"})]})]}),s?d.jsx("div",{className:"cq-stat-grid",children:Array.from({length:4}).map((v,_)=>d.jsx(cm,{children:d.jsxs(dm,{className:"space-y-3",children:[d.jsx(bi,{className:"h-5 w-3/4"}),d.jsx(bi,{className:"h-4 w-1/2"}),d.jsx(bi,{className:"h-4 w-full"})]})},_))}):h.length===0?d.jsx(cm,{children:d.jsxs(dm,{className:"flex flex-col items-center py-8",children:[d.jsx(ai,{className:"h-10 w-10 text-muted-foreground/50"}),d.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:i("pages.dashboard.noRecentAgents")}),d.jsx(Yt,{variant:"outline",size:"sm",className:"mt-3",asChild:!0,children:d.jsxs(Kn,{to:"/manage/agents/wizard",children:[d.jsx(Gt,{className:"h-4 w-4"}),i("agents.createAgent")]})})]})}):d.jsx("div",{className:"cq-card-grid",children:h.map(v=>d.jsx(Kn,{to:`/manage/agentview/${v.id}`,children:d.jsxs(cm,{className:"group relative overflow-hidden transition-all hover:shadow-md hover:border-primary/30 hover:-translate-y-0.5 active:translate-y-0",children:[d.jsx("div",{className:"absolute inset-0 bg-linear-to-br from-primary/5 to-transparent opacity-0 transition-opacity group-hover:opacity-100"}),d.jsx(NEe,{className:"relative",children:d.jsx(EEe,{className:"truncate text-base",children:v.name||i("agents.unnamed","Unnamed Agent")})}),d.jsxs(dm,{className:"relative pt-0",children:[d.jsx("p",{className:"text-xs text-muted-foreground truncate",children:v.description||"—"}),d.jsx("p",{className:"mt-2 text-xs text-muted-foreground/70",children:v.lastModifiedOn?Tw(v.lastModifiedOn):"—"})]})]})},v.id))})]})]})}const Eet={READY:{icon:Ih,color:"text-emerald-500",bg:"bg-emerald-500/10",ring:"ring-emerald-500/20"},IN_PROGRESS:{icon:Zr,color:"text-amber-500",bg:"bg-amber-500/10",ring:"ring-amber-500/20"},ERROR:{icon:Vi,color:"text-destructive",bg:"bg-destructive/10",ring:"ring-destructive/20"},NOT_FOUND:{icon:qSe,color:"text-muted-foreground",bg:"bg-muted",ring:"ring-border"}};function Let({agent:i,onDuplicate:e,onDelete:t,onExport:n}){const{t:s}=xe(),[r,o]=L.useState(!1),a=L.useRef(null),{data:l}=mEe(i.id,i.version),c=_Ee(),u=yEe(),h=BM(),g=L.useCallback(()=>{o(!1),requestAnimationFrame(()=>{var T;return(T=a.current)==null?void 0:T.focus()})},[]),f=(l==null?void 0:l.status)??"NOT_FOUND",m=Eet[f],x=m.icon,_={READY:s("status.deployed","Deployed"),IN_PROGRESS:s("status.deploying","Deploying..."),ERROR:s("status.error","Error"),NOT_FOUND:s("status.notDeployed","Not deployed")}[f]??f,w=f==="READY",k=c.isPending||u.isPending||f==="IN_PROGRESS";function C(){c.mutate({agentId:i.id,version:i.version},{onSuccess:()=>ze.success(s("agents.deploySuccess","Agent deployed successfully")),onError:()=>ze.error(s("agents.deployError","Deploy failed"))})}function E(){u.mutate({agentId:i.id,version:i.version},{onSuccess:()=>ze.success(s("agents.undeploySuccess","Agent undeployed")),onError:()=>ze.error(s("agents.undeployError","Undeploy failed"))})}const D=Tw(i.lastModifiedOn);return d.jsxs("div",{className:be("group relative flex flex-col rounded-xl border bg-card p-5 shadow-sm transition-all duration-200","hover:shadow-md hover:border-primary/30",`ring-1 ${m.ring}`),"data-testid":`agent-card-${i.id}`,children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{className:be("inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium ring-1",m.bg,m.color,m.ring),children:[d.jsx(x,{className:"h-3.5 w-3.5"}),_]}),d.jsxs("div",{className:"relative",children:[d.jsx("button",{ref:a,onClick:()=>o(!r),className:"rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-secondary hover:text-foreground group-hover:opacity-100 focus:opacity-100 group-focus-within:opacity-100","data-testid":`agent-menu-${i.id}`,"aria-label":s("common.moreActions","More actions"),"aria-haspopup":"true","aria-expanded":r,children:d.jsx(c7,{className:"h-4 w-4","aria-hidden":"true"})}),r&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-40",onClick:g,"aria-hidden":"true"}),d.jsx(Det,{onDuplicate:()=>{e(i.id,i.version),o(!1)},onExport:()=>{n==null||n(i.id,i.version),o(!1)},onDelete:()=>{t(i.id,i.version),o(!1)},onClose:g})]})]})]}),d.jsxs("div",{className:"mt-4 flex-1",children:[d.jsxs(Kn,{to:`/manage/agentview/${i.id}`,className:"text-lg font-semibold text-foreground hover:text-primary transition-colors",children:[i.name||s("agents.unnamed","Unnamed Agent"),d.jsx(To,{className:"ms-1 inline h-3.5 w-3.5 opacity-0 group-hover:opacity-50"})]}),d.jsx("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground/70 truncate",title:i.id,children:i.id}),d.jsx("p",{className:"mt-1 line-clamp-2 text-sm text-muted-foreground",children:i.description||s("agents.noDescription","No description")})]}),d.jsxs("div",{className:"mt-4 flex items-center justify-between border-t border-border pt-3",children:[d.jsx("span",{className:"text-xs text-muted-foreground",title:new Date(i.lastModifiedOn).toLocaleString(),children:D}),d.jsxs("div",{className:"flex items-center gap-2",children:[w&&d.jsxs("div",{className:"inline-flex",children:[d.jsxs("button",{onClick:async()=>{const T=_c.getState(),I=Oi.getState(),R=i.name||s("agents.unnamed","Unnamed Agent");T.open(i.id,R),T.setStep("starting"),I.clearMessages(),I.setSelectedAgent(i.id,R);try{await h.mutateAsync({agentId:i.id}),T.setStep("ready")}catch(P){T.setStep("error",Vs(P))}},className:"inline-flex items-center gap-1.5 rounded-s-lg bg-emerald-500/10 px-3 py-1.5 text-xs font-medium text-emerald-600 hover:bg-emerald-500/20 transition-colors dark:text-emerald-400","data-testid":`agent-chat-${i.id}`,"aria-label":s("agents.chat","Chat"),children:[d.jsx(Zl,{className:"h-3.5 w-3.5","aria-hidden":"true"}),s("agents.chat","Chat")]}),d.jsx("a",{href:`/chat/production/${i.id}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center rounded-e-lg border-s border-emerald-500/20 bg-emerald-500/10 px-1.5 py-1.5 text-emerald-600 hover:bg-emerald-500/20 transition-colors dark:text-emerald-400",title:s("agents.openExternalChat","Open in new tab"),"aria-label":s("agents.openExternalChat","Open in new tab"),"data-testid":`agent-external-chat-${i.id}`,children:d.jsx(To,{className:"h-3 w-3","aria-hidden":"true"})})]}),d.jsx("button",{onClick:w?E:C,disabled:k,className:be("rounded-lg px-3 py-1.5 text-xs font-medium transition-colors",w?"bg-destructive/10 text-destructive hover:bg-destructive/20":"bg-primary/10 text-primary hover:bg-primary/20",k&&"cursor-not-allowed opacity-50"),children:k?s("common.loading"):w?s("agents.undeploy","Undeploy"):s("agents.deploy","Deploy")})]})]})]})}function Det({onDuplicate:i,onExport:e,onDelete:t,onClose:n}){const{t:s}=xe(),r=L.useRef(null);L.useEffect(()=>{requestAnimationFrame(()=>{var l;const a=(l=r.current)==null?void 0:l.querySelector('[role="menuitem"]');a==null||a.focus()})},[]);const o=L.useCallback(a=>{var g,f;if(a.key==="Escape"){a.preventDefault(),n();return}const l=(g=r.current)==null?void 0:g.querySelectorAll('[role="menuitem"]');if(!l||l.length===0)return;const c=Array.from(l),u=c.indexOf(document.activeElement);let h=null;switch(a.key){case"ArrowDown":h=(u+1)%c.length;break;case"ArrowUp":h=(u-1+c.length)%c.length;break;case"Home":h=0;break;case"End":h=c.length-1;break;default:return}a.preventDefault(),(f=c[h])==null||f.focus()},[n]);return d.jsxs("div",{ref:r,className:"absolute inset-e-0 z-50 mt-1 w-44 rounded-lg border bg-popover py-1 shadow-lg",role:"menu","aria-label":s("common.moreActions","More actions"),onKeyDown:o,children:[d.jsxs("button",{onClick:i,className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-popover-foreground hover:bg-secondary focus:bg-secondary",role:"menuitem",tabIndex:-1,children:[d.jsx(mo,{className:"h-4 w-4","aria-hidden":"true"}),s("common.duplicate","Duplicate")]}),d.jsxs("button",{onClick:e,className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-popover-foreground hover:bg-secondary focus:bg-secondary disabled:opacity-50",role:"menuitem",tabIndex:-1,children:[d.jsx(Q_,{className:"h-4 w-4","aria-hidden":"true"}),s("agents.export","Export")]}),d.jsxs("button",{onClick:t,className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-destructive hover:bg-destructive/10 focus:bg-destructive/10",role:"menuitem",tabIndex:-1,children:[d.jsx(_n,{className:"h-4 w-4","aria-hidden":"true"}),s("common.delete")]})]})}function YM({open:i,onClose:e,title:t,children:n,testId:s,maxWidth:r="max-w-md",showClose:o=!0}){const{t:a}=xe(),l=L.useRef(null),c=L.useRef(null),u=L.useId();L.useEffect(()=>{var g;i?(c.current=document.activeElement,requestAnimationFrame(()=>{var m;const f=(m=l.current)==null?void 0:m.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');f==null||f.focus()})):(g=c.current)==null||g.focus()},[i]),L.useEffect(()=>{if(!i)return;const g=f=>{f.key==="Escape"&&(f.stopPropagation(),e())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[i,e]);const h=L.useCallback(g=>{if(g.key!=="Tab")return;const f=l.current;if(!f)return;const m=f.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(m.length===0)return;const x=m[0],v=m[m.length-1];g.shiftKey&&document.activeElement===x?(g.preventDefault(),v.focus()):!g.shiftKey&&document.activeElement===v&&(g.preventDefault(),x.focus())},[]);return i?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",onClick:e,"aria-hidden":"true"}),d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:d.jsxs("div",{ref:l,role:"dialog","aria-modal":"true","aria-labelledby":u,className:`w-full ${r} rounded-xl border bg-card shadow-2xl`,onClick:g=>g.stopPropagation(),onKeyDown:h,"data-testid":s,children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border p-5",children:[d.jsx("h2",{id:u,className:"text-lg font-semibold text-foreground",children:t}),o&&d.jsx("button",{onClick:e,"aria-label":a("common.close","Close"),className:"rounded-md p-1 text-muted-foreground hover:bg-secondary hover:text-foreground",children:d.jsx(An,{className:"h-5 w-5"})})]}),n]})})]}):null}function Tet({open:i,onClose:e}){const{t}=xe(),n=il(),[s,r]=L.useState(""),[o,a]=L.useState(""),l=QJe();async function c(u){u.preventDefault();try{const h=await l.mutateAsync({agent:{workflows:[],channels:[]},name:s,description:o});if(ze.success(t("agents.createSuccess","Agent created successfully")),r(""),a(""),e(),h.location){const f=new URL(h.location,"http://dummy").pathname.split("/").filter(Boolean),m=f[f.length-1];m&&n(`/manage/agents/${m}`)}}catch(h){ze.error(Vs(h))}}return d.jsx(YM,{open:i,onClose:e,title:t("agents.createTitle","Create New Agent"),testId:"create-agent-dialog",children:d.jsxs("form",{onSubmit:c,className:"space-y-4 p-5",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"agent-name",className:"mb-1.5 block text-sm font-medium text-foreground",children:t("agents.name","Name")}),d.jsx("input",{id:"agent-name",type:"text",value:s,onChange:u=>r(u.target.value),placeholder:t("agents.namePlaceholder","My Agent"),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",autoFocus:!0})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"agent-description",className:"mb-1.5 block text-sm font-medium text-foreground",children:t("agents.description","Description")}),d.jsx("textarea",{id:"agent-description",value:o,onChange:u=>a(u.target.value),placeholder:t("agents.descriptionPlaceholder","Describe what this agent does..."),rows:3,className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-none"})]}),l.isError&&d.jsx("p",{className:"text-sm text-destructive",role:"alert",children:t("common.error")}),d.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[d.jsx("button",{type:"button",onClick:e,className:"rounded-lg px-4 py-2 text-sm font-medium text-muted-foreground hover:bg-secondary transition-colors",children:t("common.cancel")}),d.jsx("button",{type:"submit",disabled:l.isPending,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",children:l.isPending?t("common.loading"):t("common.create")})]})]})})}function w4(i){try{const e=i.startsWith("eddi://")?i.replace("eddi://","http://"):i,t=new URL(e,"http://dummy"),n=t.pathname.split("/").filter(Boolean),s=n[n.length-1]||i,r=t.searchParams.get("version"),o=r?parseInt(r,10):NaN,a=Number.isFinite(o)?o:null;return{id:s,version:a}}catch{const e=i.split("/");return{id:e[e.length-1]||i,version:null}}}function QM(i){return{...Oe.getAuthHeader(),...i?{"X-Source-Authorization":i}:{}}}async function Iet(i){const e=i.startsWith("http")?i:`${Oe.getBaseUrl()}${i}`,t=await fetch(e,{headers:Oe.getAuthHeader()});if(!t.ok)throw new Error(`Download failed: ${t.statusText}`);const n=await t.blob(),s=i.split("/").pop()||"agent-export.zip",r=document.createElement("a");r.href=URL.createObjectURL(n),r.download=s,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(r.href)}async function Aet(i){const e=await fetch(`${Oe.getBaseUrl()}/backup/import`,{method:"POST",headers:{"Content-Type":"application/zip",...Oe.getAuthHeader()},body:i});if(!e.ok)throw new Error(`Import failed: ${e.statusText}`);return e.headers.get("Location")||""}async function Ret(i){const e=await fetch(`${Oe.getBaseUrl()}/backup/import/preview`,{method:"POST",headers:{"Content-Type":"application/zip",...Oe.getAuthHeader()},body:i});if(!e.ok)throw new Error(`Preview failed: ${e.statusText}`);return e.json()}async function Met(i,e){const t=new URLSearchParams({strategy:"merge"});e&&e.length>0&&t.set("selectedResources",e.join(","));const n=await fetch(`${Oe.getBaseUrl()}/backup/import?${t}`,{method:"POST",headers:{"Content-Type":"application/zip",...Oe.getAuthHeader()},body:i});if(!n.ok)throw new Error(`Merge import failed: ${n.statusText}`);return n.headers.get("Location")||""}async function Pet(i,e=1){return Oe.post(`/backup/export/${i}/preview?agentVersion=${e}`)}async function Oet(i,e,t){const n=new URLSearchParams({agentVersion:String(e)});t.length>0&&n.set("selectedResources",t.join(","));const s=await fetch(`${Oe.getBaseUrl()}/backup/export/${i}?${n}`,{method:"POST",headers:Oe.getAuthHeader()});if(!s.ok)throw new Error(`Export failed: ${s.statusText}`);const r=s.headers.get("Location");r&&await Iet(r)}async function jet(i,e){const t=new URLSearchParams({targetAgentId:e}),n=await fetch(`${Oe.getBaseUrl()}/backup/import/preview?${t}`,{method:"POST",headers:{"Content-Type":"application/zip",...Oe.getAuthHeader()},body:i});if(!n.ok)throw new Error(`Upgrade preview failed: ${n.statusText}`);return n.json()}async function Fet(i,e,t,n){const s=new URLSearchParams({strategy:"upgrade",targetAgentId:e});t!=null&&t.length&&s.set("selectedResources",t.join(",")),n!=null&&n.length&&s.set("workflowOrder",n.join(","));const r=await fetch(`${Oe.getBaseUrl()}/backup/import?${s}`,{method:"POST",headers:{"Content-Type":"application/zip",...Oe.getAuthHeader()},body:i});if(!r.ok)throw new Error(`Upgrade import failed: ${r.statusText}`);return r.headers.get("Location")||""}async function Bet(i,e){const t=new URLSearchParams({sourceUrl:i}),n=await fetch(`${Oe.getBaseUrl()}/backup/import/sync/agents?${t}`,{headers:QM(e)});if(!n.ok)throw new Error(`Failed to list remote agents: ${n.statusText}`);return n.json()}async function Het(i,e,t,n,s){const r=new URLSearchParams({sourceUrl:i,sourceAgentId:e});t!=null&&r.set("sourceAgentVersion",String(t)),n&&r.set("targetAgentId",n);const o=await fetch(`${Oe.getBaseUrl()}/backup/import/sync/preview?${r}`,{method:"POST",headers:QM(s)});if(!o.ok)throw new Error(`Sync preview failed: ${o.statusText}`);return o.json()}async function Wet(i,e,t){const n=new URLSearchParams({sourceUrl:i}),s=await fetch(`${Oe.getBaseUrl()}/backup/import/sync/preview/batch?${n}`,{method:"POST",headers:{"Content-Type":"application/json",...QM(t)},body:JSON.stringify(e)});if(!s.ok)throw new Error(`Batch preview failed: ${s.statusText}`);return s.json()}async function Vet(i,e,t,n,s,r,o){const a=new URLSearchParams({sourceUrl:i,sourceAgentId:e});t!=null&&a.set("sourceAgentVersion",String(t)),n&&a.set("targetAgentId",n),s!=null&&s.length&&a.set("selectedResources",s.join(",")),r!=null&&r.length&&a.set("workflowOrder",r.join(","));const l=await fetch(`${Oe.getBaseUrl()}/backup/import/sync?${a}`,{method:"POST",headers:QM(o)});if(!l.ok)throw new Error(`Sync execute failed: ${l.statusText}`)}async function zet(i,e,t){const n=new URLSearchParams({sourceUrl:i}),s=await fetch(`${Oe.getBaseUrl()}/backup/import/sync/batch?${n}`,{method:"POST",headers:{"Content-Type":"application/json",...QM(t)},body:JSON.stringify(e)});if(!s.ok)throw new Error(`Batch sync failed: ${s.statusText}`)}const XM=["agents"];function Uet(){const i=cn();return Kt({mutationFn:e=>Aet(e),onSuccess:()=>{i.invalidateQueries({queryKey:XM})}})}function $et(){return Kt({mutationFn:i=>Ret(i)})}function qet(){const i=cn();return Kt({mutationFn:({file:e,selectedSourceIds:t})=>Met(e,t),onSuccess:()=>{i.invalidateQueries({queryKey:XM})}})}function Ket(i,e,t){return hn({queryKey:["export-preview",i,e],queryFn:()=>Pet(i,e),enabled:t,staleTime:3e4})}function Get(){return Kt({mutationFn:({agentId:i,version:e,selectedResourceIds:t})=>Oet(i,e,t)})}function Yet(){return Kt({mutationFn:({file:i,targetAgentId:e})=>jet(i,e)})}function Qet(){const i=cn();return Kt({mutationFn:({file:e,targetAgentId:t,selectedSourceIds:n,workflowOrder:s})=>Fet(e,t,n,s),onSuccess:()=>{i.invalidateQueries({queryKey:XM})}})}function Xet(){return Kt({mutationFn:({sourceUrl:i,sourceAuth:e})=>Bet(i,e)})}function Zet(){return Kt({mutationFn:({sourceUrl:i,sourceAgentId:e,sourceVersion:t,targetAgentId:n,sourceAuth:s})=>Het(i,e,t,n,s)})}function Jet(){return Kt({mutationFn:({sourceUrl:i,mappings:e,sourceAuth:t})=>Wet(i,e,t)})}function ett(){const i=cn();return Kt({mutationFn:({sourceUrl:e,sourceAgentId:t,sourceVersion:n,targetAgentId:s,selectedResources:r,workflowOrder:o,sourceAuth:a})=>Vet(e,t,n,s,r,o,a),onSuccess:()=>{i.invalidateQueries({queryKey:XM})}})}function ttt(){const i=cn();return Kt({mutationFn:({sourceUrl:e,requests:t,sourceAuth:n})=>zet(e,t,n),onSuccess:()=>{i.invalidateQueries({queryKey:XM})}})}function TEe({url:i,auth:e,onUrlChange:t,onAuthChange:n,onConnected:s}){const{t:r}=xe(),[o,a]=L.useState(!1),[l,c]=L.useState("idle"),[u,h]=L.useState(0),[g,f]=L.useState(null),m=Xet();function x(){i.trim()&&(c("connecting"),f(null),m.mutate({sourceUrl:i.trim(),sourceAuth:e.trim()},{onSuccess:v=>{c("connected"),h(v.length),s(v)},onError:v=>{c("error"),f(v.message)}}))}return d.jsxs("form",{className:"space-y-3","data-testid":"sync-config-panel",onSubmit:v=>{v.preventDefault(),x()},children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-foreground",children:r("syncPage.sourceUrl","Source EDDI Instance URL")}),d.jsx("input",{type:"url",value:i,onChange:v=>{t(v.target.value),l!=="idle"&&c("idle")},placeholder:"https://staging.eddi.example.com",className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"sync-url-input"})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-foreground",children:r("syncPage.authToken","Authorization Token")}),d.jsxs("div",{className:"relative",children:[d.jsx("input",{type:o?"text":"password",value:e,onChange:v=>n(v.target.value),placeholder:"Bearer eyJhb...",className:"w-full rounded-lg border border-input bg-background px-3 py-2 pe-10 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"sync-auth-input"}),d.jsx("button",{type:"button",onClick:()=>a(!o),className:"absolute end-2 top-1/2 -translate-y-1/2 rounded p-1 text-muted-foreground hover:text-foreground",children:o?d.jsx(_b,{className:"h-4 w-4"}):d.jsx(Sh,{className:"h-4 w-4"})})]}),d.jsx("p",{className:"text-[11px] text-muted-foreground",children:r("syncPage.authHint","Optional. Sent as X-Source-Authorization header.")})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs(Yt,{type:"submit",disabled:!i.trim()||m.isPending,"data-testid":"sync-connect-btn",children:[m.isPending?d.jsx(ni,{className:"h-4 w-4 animate-spin"}):d.jsx(Su,{className:"h-4 w-4"}),r("syncPage.connect","Connect")]}),l==="connected"&&d.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-emerald-600 dark:text-emerald-400",children:[d.jsx(Rie,{className:"h-4 w-4"}),r("syncPage.connected","Connected")," — ",u," ",r("syncPage.agentsFound","agents")]}),l==="error"&&d.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-destructive",children:[d.jsx(Lo,{className:"h-4 w-4"}),g||r("syncPage.connectionFailed","Connection failed")]})]})]})}function ntt({dragging:i,onDragging:e,onFile:t}){const{t:n}=xe(),s=L.useRef(null);function r(a){a.preventDefault(),e(!1);const l=a.dataTransfer.files[0];l!=null&&l.name.endsWith(".zip")&&t(l)}function o(a){var c;const l=(c=a.target.files)==null?void 0:c[0];l!=null&&l.name.endsWith(".zip")&&t(l)}return d.jsxs("div",{className:`flex-1 flex flex-col items-center justify-center gap-4 rounded-lg border-2 border-dashed p-8 transition-colors cursor-pointer ${i?"border-primary bg-primary/5 scale-[1.01]":"border-border hover:border-primary/50"}`,onDragOver:a=>a.preventDefault(),onDragEnter:()=>e(!0),onDragLeave:()=>e(!1),onDrop:r,onClick:()=>{var a;return(a=s.current)==null?void 0:a.click()},"data-testid":"import-drop-zone",children:[d.jsx(Pie,{className:"h-12 w-12 text-muted-foreground"}),d.jsxs("div",{className:"text-center",children:[d.jsx("p",{className:"text-sm font-medium text-foreground",children:n("importDialog.dropZone","Drop a .zip file here or click to browse")}),d.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:n("importDialog.dropZoneHint","Exported agent archive (.zip)")})]}),d.jsx("input",{ref:s,type:"file",accept:".zip",onChange:o,className:"hidden","data-testid":"import-file-input"})]})}function itt({file:i,strategy:e,onStrategyChange:t,onBack:n,onNext:s,isLoading:r,isPreviewing:o,error:a}){const{t:l}=xe();return d.jsxs("div",{className:"flex-1 space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-3 rounded-lg bg-secondary/50 p-3",children:[d.jsx(Pie,{className:"h-5 w-5 text-primary shrink-0"}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:i.name}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:[(i.size/1024).toFixed(1)," KB"]})]})]}),d.jsxs("fieldset",{className:"space-y-2",children:[d.jsx("legend",{className:"text-sm font-medium text-foreground mb-2",children:l("importDialog.strategyLabel","Import Strategy")}),d.jsx(_5,{value:"create",current:e,onChange:t,icon:d.jsx(Gt,{className:"h-4 w-4 text-emerald-500"}),label:l("importDialog.createNew","Create as new agent"),desc:l("importDialog.createNewDesc","Creates a fresh copy with new IDs. Best for first-time import."),testId:"strategy-create"}),d.jsx(_5,{value:"merge",current:e,onChange:t,icon:d.jsx(xi,{className:"h-4 w-4 text-blue-500"}),label:l("importDialog.mergeSync","Merge / sync with existing"),desc:l("importDialog.mergeSyncDesc","Updates existing resources if previously imported. Creates new ones if not found."),testId:"strategy-merge"}),d.jsx(_5,{value:"upgrade",current:e,onChange:t,icon:d.jsx(qv,{className:"h-4 w-4 text-amber-500"}),label:l("importDialog.upgradeExisting","Upgrade existing agent"),desc:l("importDialog.upgradeDesc","Match resources structurally against a target agent. Best for promoting across environments."),testId:"strategy-upgrade"}),d.jsx(_5,{value:"sync",current:e,onChange:t,icon:d.jsx(Su,{className:"h-4 w-4 text-violet-500"}),label:l("importDialog.syncRemote","Sync from remote instance"),desc:l("importDialog.syncDesc","Connect to another EDDI instance and sync a specific agent live."),testId:"strategy-sync"})]}),a&&d.jsx("p",{className:"text-sm text-destructive",children:a}),d.jsxs("div",{className:"flex justify-between pt-2",children:[d.jsxs(Yt,{variant:"ghost",onClick:n,disabled:r,children:[d.jsx(El,{className:"h-4 w-4"}),l("common.back","Back")]}),d.jsxs(Yt,{onClick:s,disabled:r,"data-testid":"import-confirm-strategy",children:[o?l("common.loading","Loading..."):e==="create"?l("importDialog.importNow","Import Now"):e==="merge"?l("importDialog.previewChanges","Preview Changes"):l("common.next","Next"),d.jsx(wg,{className:"h-4 w-4"})]})]})]})}function _5({value:i,current:e,onChange:t,icon:n,label:s,desc:r,testId:o}){return d.jsxs("label",{className:`flex items-start gap-3 rounded-lg border p-3 cursor-pointer transition-colors ${e===i?"border-primary bg-primary/5":"border-border hover:border-primary/30"}`,"data-testid":o,children:[d.jsx("input",{type:"radio",name:"strategy",value:i,checked:e===i,onChange:()=>t(i),className:"mt-0.5 accent-primary"}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[n,d.jsx("span",{className:"text-sm font-medium text-foreground",children:s})]}),d.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:r})]})]})}const stt={agent:"bg-purple-500/10 text-purple-500",workflow:"bg-blue-500/10 text-blue-500",behavior:"bg-amber-500/10 text-amber-500",rules:"bg-amber-500/10 text-amber-500",httpcalls:"bg-green-500/10 text-green-500",apicalls:"bg-green-500/10 text-green-500",langchain:"bg-pink-500/10 text-pink-500",llm:"bg-pink-500/10 text-pink-500",output:"bg-cyan-500/10 text-cyan-500",property:"bg-orange-500/10 text-orange-500",propertysetter:"bg-orange-500/10 text-orange-500",dictionary:"bg-teal-500/10 text-teal-500",regulardictionary:"bg-teal-500/10 text-teal-500",mcpcalls:"bg-indigo-500/10 text-indigo-500",rag:"bg-violet-500/10 text-violet-500",snippet:"bg-rose-500/10 text-rose-500",snippets:"bg-rose-500/10 text-rose-500"};function Ase({type:i}){const e=i.replace(/\.json$/,"");return d.jsx("span",{className:`inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${stt[e]||"bg-secondary text-muted-foreground"}`,children:e})}function IEe({action:i}){const{t:e}=xe();switch(i){case"CREATE":return d.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-emerald-500",children:[d.jsx(Gt,{className:"h-3 w-3"})," ",e("sync.actionCreate","New")]});case"UPDATE":return d.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-blue-500",children:[d.jsx(xi,{className:"h-3 w-3"})," ",e("sync.actionUpdate","Update")]});case"SKIP":return d.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-muted-foreground",children:[d.jsx(Ns,{className:"h-3 w-3"})," ",e("sync.actionSkip","Up to date")]});case"CONFLICT":return d.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-destructive",children:[d.jsx(Vi,{className:"h-3 w-3"})," ",e("sync.actionConflict","Conflict")]});default:return d.jsx("span",{className:"text-xs text-muted-foreground",children:i})}}class rtt{diff(e,t,n={}){let s;typeof n=="function"?(s=n,n={}):"callback"in n&&(s=n.callback);const r=this.castInput(e,n),o=this.castInput(t,n),a=this.removeEmpty(this.tokenize(r,n)),l=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,l,n,s)}diffWithOptionsObj(e,t,n,s){var r;const o=w=>{if(w=this.postProcess(w,n),s){setTimeout(function(){s(w)},0);return}else return w},a=t.length,l=e.length;let c=1,u=a+l;n.maxEditLength!=null&&(u=Math.min(u,n.maxEditLength));const h=(r=n.timeout)!==null&&r!==void 0?r:1/0,g=Date.now()+h,f=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(f[0],t,e,0,n);if(f[0].oldPos+1>=l&&m+1>=a)return o(this.buildValues(f[0].lastComponent,t,e));let x=-1/0,v=1/0;const _=()=>{for(let w=Math.max(x,-c);w<=Math.min(v,c);w+=2){let k;const C=f[w-1],E=f[w+1];C&&(f[w-1]=void 0);let D=!1;if(E){const I=E.oldPos-w;D=E&&0<=I&&I=l&&m+1>=a)return o(this.buildValues(k.lastComponent,t,e))||!0;f[w]=k,k.oldPos+1>=l&&(v=Math.min(v,w-1)),m+1>=a&&(x=Math.max(x,w+1))}c++};if(s)(function w(){setTimeout(function(){if(c>u||Date.now()>g)return s(void 0);_()||w()},0)})();else for(;c<=u&&Date.now()<=g;){const w=_();if(w)return w}}addToPath(e,t,n,s,r){const o=e.lastComponent;return o&&!r.oneChangePerToken&&o.added===t&&o.removed===n?{oldPos:e.oldPos+s,lastComponent:{count:o.count+1,added:t,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+s,lastComponent:{count:1,added:t,removed:n,previousComponent:o}}}extractCommon(e,t,n,s,r){const o=t.length,a=n.length;let l=e.oldPos,c=l-s,u=0;for(;c+1g.length?m:g}),u.value=this.join(h)}else u.value=this.join(t.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return s}}class ott extends rtt{constructor(){super(...arguments),this.tokenize=ctt}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
-`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
-`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
-`)&&(e=e.slice(0,-1)),t.endsWith(`
-`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}}const att=new ott;function ltt(i,e,t){return att.diff(i,e,t)}function ctt(i,e){e.stripTrailingCr&&(i=i.replace(/\r\n/g,`
-`));const t=[],n=i.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let s=0;s{if(!i&&!e)return null;const s=Spe(i),r=Spe(e);return s===r?"identical":ltt(r||"",s||"")},[i,e]);return n===null?null:n==="identical"?d.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 text-sm text-muted-foreground bg-secondary/30 rounded-lg",children:[d.jsx(WBe,{className:"h-4 w-4"}),t("importDialog.contentIdentical","Content identical")]}):d.jsxs("div",{className:"overflow-auto rounded-lg border bg-card text-xs font-mono max-h-80",children:[d.jsx("div",{className:"flex items-center justify-between px-3 py-1.5 border-b bg-secondary/50 text-[10px] text-muted-foreground",children:d.jsxs("span",{children:[t("importDialog.targetContent","Target")," → ",t("importDialog.sourceContent","Source")]})}),d.jsx("div",{className:"p-0",children:n.map((s,r)=>s.value.split(`
-`).filter((a,l,c)=>!(l===c.length-1&&a==="")).map((a,l)=>d.jsxs("div",{className:s.added?"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400 border-s-2 border-emerald-500":s.removed?"bg-red-500/10 text-red-700 dark:text-red-400 border-s-2 border-red-500":"text-muted-foreground border-s-2 border-transparent",children:[d.jsx("span",{className:"inline-block w-6 text-end pe-2 text-muted-foreground/50 select-none",children:s.added?"+":s.removed?"−":" "}),a]},`${r}-${l}`)))})]})}function Spe(i){if(!i)return"";try{const e=JSON.parse(i);return JSON.stringify(MG(e),null,2)}catch{return i}}function MG(i){return Array.isArray(i)?i.map(MG):i!==null&&typeof i=="object"?Object.keys(i).sort().reduce((e,t)=>(e[t]=MG(i[t]),e),{}):i}function dtt({preview:i,strategy:e,selected:t,expandedDiff:n,workflowOrder:s,isLoading:r,error:o,onToggleResource:a,onToggleAll:l,onExpandDiff:c,onMoveWorkflow:u,onBack:h,onExecute:g}){const{t:f}=xe(),m=e==="upgrade"||e==="sync";return d.jsxs("div",{className:"flex-1 flex flex-col space-y-4 min-h-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Pie,{className:"h-5 w-5 text-primary shrink-0"}),d.jsxs("p",{className:"text-sm font-semibold text-foreground",children:[i.sourceAgentName||i.sourceAgentId||"Agent",i.targetAgentName&&d.jsxs("span",{className:"text-muted-foreground font-normal",children:[" → ",i.targetAgentName]})]})]}),d.jsx("div",{className:"flex-1 overflow-auto rounded-lg border min-h-0",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"sticky top-0 bg-secondary/80 backdrop-blur-sm",children:d.jsxs("tr",{children:[d.jsx("th",{className:"px-3 py-2 text-start w-8",children:d.jsx("input",{type:"checkbox",checked:t.size===i.resources.length,onChange:l,className:"accent-primary"})}),d.jsx("th",{className:"px-3 py-2 text-start text-xs font-medium text-muted-foreground uppercase",children:f("importDialog.resource","Resource")}),d.jsx("th",{className:"px-3 py-2 text-start text-xs font-medium text-muted-foreground uppercase",children:f("importDialog.type","Type")}),m&&d.jsx("th",{className:"px-3 py-2 text-start text-xs font-medium text-muted-foreground uppercase",children:f("importDialog.match","Match")}),d.jsx("th",{className:"px-3 py-2 text-start text-xs font-medium text-muted-foreground uppercase",children:f("importDialog.action","Action")}),m&&d.jsx("th",{className:"px-3 py-2 text-start text-xs font-medium text-muted-foreground uppercase w-8"})]})}),d.jsx("tbody",{className:"divide-y divide-border",children:i.resources.map(x=>d.jsx(htt,{resource:x,checked:t.has(x.sourceId),onToggle:()=>a(x.sourceId),showMatch:m,showDiff:m,expanded:n===x.sourceId,onExpand:()=>c(n===x.sourceId?null:x.sourceId),workflowOrder:s,onMoveWorkflow:u},x.sourceId))})]})}),d.jsxs("div",{className:"flex gap-3 text-xs text-muted-foreground",children:[d.jsxs("span",{children:[i.resources.filter(x=>x.action==="CREATE").length," ",f("importDialog.new","new")]}),d.jsxs("span",{children:[i.resources.filter(x=>x.action==="UPDATE").length," ",f("importDialog.updated","updated")]}),d.jsxs("span",{children:[i.resources.filter(x=>x.action==="SKIP").length," ",f("importDialog.unchanged","unchanged")]}),d.jsxs("span",{children:[t.size," ",f("importDialog.selected","selected")]})]}),o&&d.jsx("p",{className:"text-sm text-destructive",children:o}),d.jsxs("div",{className:"flex justify-between pt-2",children:[d.jsxs(Yt,{variant:"ghost",onClick:h,disabled:r,children:[d.jsx(El,{className:"h-4 w-4"}),f("common.back","Back")]}),d.jsxs(Yt,{onClick:g,disabled:r||t.size===0,"data-testid":"import-confirm-merge",children:[e==="sync"?f("importDialog.syncNow","Sync Now"):e==="upgrade"?f("importDialog.upgradeNow","Upgrade Now"):f("importDialog.mergeNow","Import Selected"),d.jsx(Ns,{className:"h-4 w-4"})]})]})]})}function utt({strategy:i}){if(!i)return null;const e={position:"pos",type:"type",name:"name",originId:"ID"};return d.jsx("span",{className:"inline-flex rounded-full bg-secondary px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:e[i]||i})}function htt({resource:i,checked:e,onToggle:t,showMatch:n,showDiff:s,expanded:r,onExpand:o,workflowOrder:a,onMoveWorkflow:l}){const c=i.action==="UPDATE"&&(i.sourceContent||i.targetContent),u=i.resourceType==="workflow"&&i.action==="CREATE",h=a.indexOf(i.sourceId);return d.jsxs(L.Fragment,{children:[d.jsxs("tr",{className:`transition-colors ${e?"bg-primary/5":""}`,children:[d.jsx("td",{className:"px-3 py-2",children:d.jsx("input",{type:"checkbox",checked:e,onChange:t,className:"accent-primary"})}),d.jsx("td",{className:"px-3 py-2 font-medium text-foreground",children:d.jsxs("div",{className:"flex items-center gap-1.5",children:[i.name||i.sourceId.substring(0,12),u&&h>=0&&d.jsxs("span",{className:"flex items-center gap-0.5 ms-1",children:[d.jsx("button",{onClick:()=>l(i.sourceId,-1),disabled:h===0,className:"rounded p-0.5 text-muted-foreground hover:text-foreground disabled:opacity-30",title:"Move up",children:d.jsx(zv,{className:"h-3 w-3"})}),d.jsx("button",{onClick:()=>l(i.sourceId,1),disabled:h===a.length-1,className:"rounded p-0.5 text-muted-foreground hover:text-foreground disabled:opacity-30",title:"Move down",children:d.jsx(zf,{className:"h-3 w-3"})})]})]})}),d.jsx("td",{className:"px-3 py-2",children:d.jsx(Ase,{type:i.resourceType})}),n&&d.jsx("td",{className:"px-3 py-2",children:d.jsx(utt,{strategy:i.matchStrategy})}),d.jsx("td",{className:"px-3 py-2",children:d.jsx(IEe,{action:i.action})}),s&&d.jsx("td",{className:"px-3 py-2",children:c&&d.jsx("button",{onClick:o,className:"rounded p-0.5 text-muted-foreground hover:text-foreground",children:r?d.jsx(Rn,{className:"h-4 w-4"}):d.jsx(hs,{className:"h-4 w-4"})})})]}),r&&c&&d.jsx("tr",{children:d.jsx("td",{colSpan:n?6:5,className:"px-3 py-2",children:d.jsx(AEe,{sourceContent:i.sourceContent,targetContent:i.targetContent})})})]})}function gtt({open:i,onClose:e,onSuccess:t}){const{t:n}=xe(),[s,r]=L.useState("upload"),[o,a]=L.useState(null),[l,c]=L.useState("create"),[u,h]=L.useState(null),[g,f]=L.useState(new Set),[m,x]=L.useState(null),[v,_]=L.useState(null),[w,k]=L.useState([]),[C,E]=L.useState(!1),[D,T]=L.useState(null),[I,R]=L.useState(""),[P,j]=L.useState(""),[B,U]=L.useState([]),[$,K]=L.useState(null),[z,G]=L.useState(null),[ne,te]=L.useState(null),H=Uet(),Q=$et(),Y=qet(),V=Yet(),ue=Qet(),he=Zet(),Te=ett(),nt=L.useCallback(()=>{r("upload"),a(null),c("create"),h(null),f(new Set),x(null),_(null),k([]),E(!1),T(null),R(""),j(""),U([]),K(null),G(null),te(null)},[]);function ge(){nt(),e()}function _e(It){a(It),r("strategy")}function $e(){x(null),l==="create"&&o?(r("importing"),H.mutate(o,{onSuccess:()=>{t(),ge()},onError:It=>{x(It.message),r("strategy")}})):l==="merge"&&o?Q.mutate(o,{onSuccess:It=>{h(It);const Zt=new Set(It.resources.map(En=>En.sourceId));f(Zt),r("preview")},onError:It=>x(It.message)}):(l==="upgrade"||l==="sync")&&r("target")}function Ke(){x(null),l==="upgrade"&&o&&D?V.mutate({file:o,targetAgentId:D},{onSuccess:It=>{h(It);const Zt=new Set(It.resources.map(Xi=>Xi.sourceId));f(Zt);const En=It.resources.filter(Xi=>Xi.resourceType==="workflow"&&Xi.action==="CREATE").sort((Xi,zi)=>Xi.workflowIndex-zi.workflowIndex).map(Xi=>Xi.sourceId);k(En),r("preview")},onError:It=>x(It.message)}):l==="sync"&&$&&I&&he.mutate({sourceUrl:I,sourceAgentId:$,sourceVersion:z,targetAgentId:ne,sourceAuth:P},{onSuccess:It=>{h(It);const Zt=new Set(It.resources.map(En=>En.sourceId));f(Zt),r("preview")},onError:It=>x(It.message)})}function ht(){x(null),r("importing");const It=Array.from(g);l==="merge"&&o?Y.mutate({file:o,selectedSourceIds:It},{onSuccess:()=>{t(),ge()},onError:Zt=>{x(Zt.message),r("preview")}}):l==="upgrade"&&o&&D?ue.mutate({file:o,targetAgentId:D,selectedSourceIds:It,workflowOrder:w},{onSuccess:()=>{t(),ge()},onError:Zt=>{x(Zt.message),r("preview")}}):l==="sync"&&$&&I&&Te.mutate({sourceUrl:I,sourceAgentId:$,sourceVersion:z,targetAgentId:ne,selectedResources:It,workflowOrder:w.length>0?w:null,sourceAuth:P},{onSuccess:()=>{t(),ge()},onError:Zt=>{x(Zt.message),r("preview")}})}function Ct(It){f(Zt=>{const En=new Set(Zt);return En.has(It)?En.delete(It):En.add(It),En})}function Ft(){u&&(g.size===u.resources.length?f(new Set):f(new Set(u.resources.map(It=>It.sourceId))))}function Ve(It,Zt){k(En=>{const Xi=En.indexOf(It);if(Xi<0)return En;const zi=Xi+Zt;if(zi<0||zi>=En.length)return En;const Tr=[...En];return[Tr[Xi],Tr[zi]]=[Tr[zi],Tr[Xi]],Tr})}if(!i)return null;const tt=H.isPending||Q.isPending||Y.isPending||V.isPending||ue.isPending||he.isPending||Te.isPending,qt=l==="upgrade"&&!!D||l==="sync"&&!!$;return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",onClick:tt?void 0:ge}),d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:d.jsxs("div",{className:"w-full max-w-2xl rounded-xl border bg-card p-6 shadow-2xl max-h-[85vh] flex flex-col",onClick:It=>It.stopPropagation(),"data-testid":"import-agent-dialog",children:[d.jsxs("div",{className:"flex items-center justify-between mb-6",children:[d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:n("importDialog.title","Import Agent")}),d.jsx("button",{onClick:ge,disabled:tt,className:"rounded-md p-1 text-muted-foreground hover:bg-secondary hover:text-foreground disabled:opacity-50",children:d.jsx(An,{className:"h-5 w-5"})})]}),s==="upload"&&d.jsx(ntt,{dragging:C,onDragging:E,onFile:_e}),s==="strategy"&&o&&d.jsx(itt,{file:o,strategy:l,onStrategyChange:c,onBack:()=>{a(null),r("upload")},onNext:$e,isLoading:tt,isPreviewing:Q.isPending,error:m}),s==="target"&&d.jsx(ftt,{strategy:l,targetAgentId:D,onSelectTarget:T,syncUrl:I,syncAuth:P,remoteAgents:B,sourceAgent:$,syncTargetId:ne,onSyncUrlChange:R,onSyncAuthChange:j,onRemoteAgents:U,onSourceAgent:(It,Zt)=>{K(It),G(Zt)},onSyncTarget:te,error:m,isLoading:tt,isPreviewing:V.isPending||he.isPending,canNext:qt,onBack:()=>r("strategy"),onNext:Ke}),s==="preview"&&u&&d.jsx(dtt,{preview:u,strategy:l,selected:g,expandedDiff:v,workflowOrder:w,isLoading:tt,error:m,onToggleResource:Ct,onToggleAll:Ft,onExpandDiff:_,onMoveWorkflow:Ve,onBack:()=>r(l==="merge"?"strategy":"target"),onExecute:ht}),s==="importing"&&d.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 py-8",children:[d.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-muted-foreground border-t-primary"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:n("importDialog.importing","Importing agent...")})]})]})})]})}function ftt({strategy:i,targetAgentId:e,onSelectTarget:t,syncUrl:n,syncAuth:s,remoteAgents:r,sourceAgent:o,syncTargetId:a,onSyncUrlChange:l,onSyncAuthChange:c,onRemoteAgents:u,onSourceAgent:h,onSyncTarget:g,error:f,isLoading:m,isPreviewing:x,canNext:v,onBack:_,onNext:w}){const{t:k}=xe();return d.jsxs("div",{className:"flex-1 space-y-4",children:[i==="upgrade"&&d.jsx(ptt,{targetAgentId:e,onSelect:t}),i==="sync"&&d.jsx(mtt,{syncUrl:n,syncAuth:s,remoteAgents:r,sourceAgent:o,syncTargetId:a,onUrlChange:l,onAuthChange:c,onRemoteAgents:u,onSourceAgent:h,onSyncTarget:g}),f&&d.jsx("p",{className:"text-sm text-destructive",children:f}),d.jsxs("div",{className:"flex justify-between pt-2",children:[d.jsxs(Yt,{variant:"ghost",onClick:_,disabled:m,children:[d.jsx(El,{className:"h-4 w-4"}),k("common.back","Back")]}),d.jsxs(Yt,{onClick:w,disabled:m||!v,"data-testid":"import-target-next",children:[x?k("common.loading","Loading..."):k("importDialog.previewChanges","Preview Changes"),d.jsx(wg,{className:"h-4 w-4"})]})]})]})}function ptt({targetAgentId:i,onSelect:e}){const{t}=xe(),{data:n}=I7(),s=Cg((n==null?void 0:n.pages.flat())??[]);return d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium text-foreground",children:t("importDialog.selectTargetAgent","Select target agent")}),d.jsx("p",{className:"text-xs text-muted-foreground",children:t("importDialog.upgradeTargetHint","The imported resources will be structurally matched against this agent.")}),d.jsxs("select",{value:i||"",onChange:r=>e(r.target.value),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"upgrade-target-select",children:[d.jsx("option",{value:"",children:t("importDialog.chooseAgent","— Choose an agent —")}),s.map(r=>d.jsxs("option",{value:r.id,children:[r.name||r.id," (v",r.version,")"]},r.id))]})]})}function mtt({syncUrl:i,syncAuth:e,remoteAgents:t,sourceAgent:n,syncTargetId:s,onUrlChange:r,onAuthChange:o,onRemoteAgents:a,onSourceAgent:l,onSyncTarget:c}){const{t:u}=xe(),{data:h}=I7(),g=Cg((h==null?void 0:h.pages.flat())??[]);return d.jsxs("div",{className:"space-y-4",children:[d.jsx(TEe,{url:i,auth:e,onUrlChange:r,onAuthChange:o,onConnected:a}),t.length>0&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium text-foreground",children:u("importDialog.sourceAgent","Source agent (remote)")}),d.jsxs("select",{value:n||"",onChange:f=>{const m=t.find(x=>{const{id:v}=w4(x.resource);return v===f.target.value});if(m){const{id:x,version:v}=w4(m.resource);l(x,v)}},className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"sync-source-select",children:[d.jsx("option",{value:"",children:u("importDialog.chooseAgent","— Choose an agent —")}),t.map(f=>{const{id:m}=w4(f.resource);return d.jsx("option",{value:m,children:f.name||m},m)})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium text-foreground",children:u("importDialog.targetAgent","Target agent (local)")}),d.jsxs("select",{value:s||"",onChange:f=>c(f.target.value||null),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"sync-target-select",children:[d.jsx("option",{value:"",children:u("importDialog.createNewTarget","Create new agent")}),g.map(f=>d.jsxs("option",{value:f.id,children:[f.name||f.id," (v",f.version,")"]},f.id))]})]})]})]})}function REe({open:i,onClose:e,agentId:t,agentVersion:n}){const{t:s}=xe(),[r,o]=L.useState(new Set),{data:a,isLoading:l,isError:c,error:u}=Ket(t,n,i),h=Get(),g=L.useMemo(()=>a?a.resources.map(D=>D.resourceId):[],[a]);L.useEffect(()=>{g.length>0&&o(new Set(g))},[g]);const f=L.useMemo(()=>a?new Set(a.resources.filter(D=>D.required).map(D=>D.resourceId)):new Set,[a]),m=L.useMemo(()=>{if(!a)return[];const D=new Map;for(const T of a.resources){if(T.resourceType==="agent")continue;const I=T.parentWorkflowId||"__snippets__";if(!D.has(I)){const R=T.parentWorkflowId?a.resources.find(P=>P.resourceId===T.parentWorkflowId&&P.resourceType==="workflow"):null;D.set(I,{workflowId:T.parentWorkflowId,workflowName:(R==null?void 0:R.name)||T.parentWorkflowId,workflowIndex:(R==null?void 0:R.workflowIndex)??-1,resources:[]})}T.resourceType!=="workflow"&&D.get(I).resources.push(T)}return Array.from(D.values()).sort((T,I)=>T.workflowIndex-I.workflowIndex)},[a]),x=a==null?void 0:a.resources.find(D=>D.resourceType==="agent"),v=(a==null?void 0:a.resources.filter(D=>D.resourceType==="workflow"))??[];function _(D){f.has(D)||o(T=>{const I=new Set(T);return I.has(D)?I.delete(D):I.add(D),I})}function w(){r.size===g.length?o(new Set(f)):o(new Set(g))}function k(){h.mutate({agentId:t,version:n,selectedResourceIds:Array.from(r)},{onSuccess:()=>C()})}function C(){o(new Set),e()}if(!i)return null;const E=h.isPending;return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",onClick:E?void 0:C}),d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:d.jsxs("div",{className:"w-full max-w-lg rounded-xl border bg-card p-6 shadow-2xl max-h-[80vh] flex flex-col",onClick:D=>D.stopPropagation(),"data-testid":"export-agent-dialog",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s("exportDialog.title","Export Agent")}),d.jsx("button",{onClick:C,disabled:E,className:"rounded-md p-1 text-muted-foreground hover:bg-secondary hover:text-foreground disabled:opacity-50",children:d.jsx(An,{className:"h-5 w-5"})})]}),l&&d.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 py-12",children:[d.jsx(ni,{className:"h-8 w-8 animate-spin text-primary"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:s("exportDialog.loading","Loading resource tree...")})]}),c&&d.jsx("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 py-12",children:d.jsx("p",{className:"text-sm text-destructive",children:(u==null?void 0:u.message)||s("common.error")})}),a&&!l&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:s("exportDialog.selectResources","Select resources to export")}),d.jsxs("div",{className:"flex-1 overflow-auto min-h-0 space-y-1 rounded-lg border p-3 bg-secondary/20",children:[x&&d.jsx(y5,{resource:x,checked:r.has(x.resourceId),required:!0,indent:0}),v.map(D=>{const T=m.find(I=>I.workflowId===D.resourceId);return d.jsxs("div",{children:[d.jsx(y5,{resource:D,checked:r.has(D.resourceId),required:D.required,indent:1}),T==null?void 0:T.resources.map(I=>d.jsx(y5,{resource:I,checked:r.has(I.resourceId),required:I.required,indent:2,onToggle:()=>_(I.resourceId)},I.resourceId))]},D.resourceId)}),m.filter(D=>!D.workflowId).map(D=>D.resources.length>0?d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mt-2 mb-1 ps-2",children:s("exportDialog.snippets","Snippets")}),D.resources.map(T=>d.jsx(y5,{resource:T,checked:r.has(T.resourceId),required:T.required,indent:1,onToggle:()=>_(T.resourceId)},T.resourceId))]},"snippets"):null)]}),d.jsxs("div",{className:"flex items-center justify-between pt-4 border-t mt-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"checkbox",checked:r.size===g.length,onChange:w,className:"accent-primary"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:r.size===g.length?s("exportDialog.allSelected","All resources selected"):s("exportDialog.countSelected","{{count}} of {{total}} resources selected",{count:r.size,total:g.length})})]}),d.jsxs(Yt,{onClick:k,disabled:E||r.size===0,"data-testid":"export-confirm-btn",children:[E?d.jsx(ni,{className:"h-4 w-4 animate-spin"}):d.jsx(Q_,{className:"h-4 w-4"}),s("exportDialog.exportSelected","Export Selected")]})]})]})]})})]})}function y5({resource:i,checked:e,required:t,indent:n,onToggle:s}){const r=n===0?"ps-2":n===1?"ps-6":"ps-10";return d.jsxs("label",{className:`flex items-center gap-2 rounded-md px-2 py-1.5 text-sm cursor-pointer hover:bg-secondary/50 transition-colors ${r} ${e?"text-foreground":"text-muted-foreground"}`,children:[d.jsx("input",{type:"checkbox",checked:e,disabled:t,onChange:s,className:"accent-primary disabled:opacity-60"}),d.jsx(Ase,{type:i.resourceType}),d.jsx("span",{className:"truncate flex-1",children:i.name||i.resourceId.slice(0,12)}),t&&d.jsx(d7,{className:"h-3 w-3 text-muted-foreground/50 shrink-0"})]})}function MEe({open:i,onClose:e,type:t,wizardPath:n,onQuickCreate:s}){const{t:r}=xe(),o=il(),a=()=>{e(),o(n)},l=t==="agent"?r("common.agent","Agent"):r("common.group","Group");return d.jsx(YM,{open:i,onClose:e,title:r("createOrWizard.title",{type:l,defaultValue:`New ${l}`}),testId:"create-or-wizard-dialog",maxWidth:"max-w-2xl",children:d.jsx("div",{className:"p-6 sm:p-8",children:d.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 sm:gap-6",children:[d.jsxs("button",{onClick:s,className:"group flex flex-col items-start gap-4 rounded-xl border-2 border-border bg-card p-6 text-start transition-all hover:-translate-y-1 hover:border-primary/60 hover:shadow-xl","data-testid":"choice-quick-create",children:[d.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg bg-primary/10 text-primary transition-colors group-hover:bg-primary/20",children:d.jsx(Gt,{className:"h-6 w-6"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-base font-semibold text-foreground",children:r("createOrWizard.quickCreate","Quick Create")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground leading-relaxed",children:r("createOrWizard.quickCreateDesc","Set a name and description, configure details later.")})]})]}),d.jsxs("button",{onClick:a,className:"group flex flex-col items-start gap-4 rounded-xl border-2 border-border bg-card p-6 text-start transition-all hover:-translate-y-1 hover:border-amber-500/60 hover:shadow-xl","data-testid":"choice-wizard",children:[d.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg bg-amber-500/10 text-amber-500 transition-colors group-hover:bg-amber-500/20",children:d.jsx(RL,{className:"h-6 w-6"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-base font-semibold text-foreground",children:r("createOrWizard.guidedSetup","Guided Setup")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground leading-relaxed",children:r("createOrWizard.guidedSetupDesc","Step-by-step wizard with LLM provider, prompts, and deployment.")})]})]})]})})})}function Kv(i,e,{checkForDefaultPrevented:t=!0}={}){return function(s){if(i==null||i(s),t===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function btt(i,e){const t=L.createContext(e),n=r=>{const{children:o,...a}=r,l=L.useMemo(()=>a,Object.values(a));return d.jsx(t.Provider,{value:l,children:o})};n.displayName=i+"Provider";function s(r){const o=L.useContext(t);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${r}\` must be used within \`${i}\``)}return[n,s]}function xtt(i,e=[]){let t=[];function n(r,o){const a=L.createContext(o),l=t.length;t=[...t,o];const c=h=>{var _;const{scope:g,children:f,...m}=h,x=((_=g==null?void 0:g[i])==null?void 0:_[l])||a,v=L.useMemo(()=>m,Object.values(m));return d.jsx(x.Provider,{value:v,children:f})};c.displayName=r+"Provider";function u(h,g){var x;const f=((x=g==null?void 0:g[i])==null?void 0:x[l])||a,m=L.useContext(f);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${r}\``)}return[c,u]}const s=()=>{const r=t.map(o=>L.createContext(o));return function(a){const l=(a==null?void 0:a[i])||r;return L.useMemo(()=>({[`__scope${i}`]:{...a,[i]:l}}),[a,l])}};return s.scopeName=i,[n,vtt(s,...e)]}function vtt(...i){const e=i[0];if(i.length===1)return e;const t=()=>{const n=i.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(r){const o=n.reduce((a,{useScope:l,scopeName:c})=>{const h=l(r)[`__scope${c}`];return{...a,...h}},{});return L.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}var yA=globalThis!=null&&globalThis.document?L.useLayoutEffect:()=>{},_tt=n7[" useId ".trim().toString()]||(()=>{}),ytt=0;function ob(i){const[e,t]=L.useState(_tt());return yA(()=>{t(n=>n??String(ytt++))},[i]),i||(e?`radix-${e}`:"")}var wtt=n7[" useInsertionEffect ".trim().toString()]||yA;function Ctt({prop:i,defaultProp:e,onChange:t=()=>{},caller:n}){const[s,r,o]=Stt({defaultProp:e,onChange:t}),a=i!==void 0,l=a?i:s;{const u=L.useRef(i!==void 0);L.useEffect(()=>{const h=u.current;h!==a&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,n])}const c=L.useCallback(u=>{var h;if(a){const g=ktt(u)?u(i):u;g!==i&&((h=o.current)==null||h.call(o,g))}else r(u)},[a,i,r,o]);return[l,c]}function Stt({defaultProp:i,onChange:e}){const[t,n]=L.useState(i),s=L.useRef(t),r=L.useRef(e);return wtt(()=>{r.current=e},[e]),L.useEffect(()=>{var o;s.current!==t&&((o=r.current)==null||o.call(r,t),s.current=t)},[t,s]),[t,n,r]}function ktt(i){return typeof i=="function"}function Ntt(i){const e=Ett(i),t=L.forwardRef((n,s)=>{const{children:r,...o}=n,a=L.Children.toArray(r),l=a.find(Dtt);if(l){const c=l.props.children,u=a.map(h=>h===l?L.Children.count(c)>1?L.Children.only(null):L.isValidElement(c)?c.props.children:null:h);return d.jsx(e,{...o,ref:s,children:L.isValidElement(c)?L.cloneElement(c,void 0,u):null})}return d.jsx(e,{...o,ref:s,children:r})});return t.displayName=`${i}.Slot`,t}function Ett(i){const e=L.forwardRef((t,n)=>{const{children:s,...r}=t;if(L.isValidElement(s)){const o=Itt(s),a=Ttt(r,s.props);return s.type!==L.Fragment&&(a.ref=n?yb(n,o):o),L.cloneElement(s,a)}return L.Children.count(s)>1?L.Children.only(null):null});return e.displayName=`${i}.SlotClone`,e}var Ltt=Symbol("radix.slottable");function Dtt(i){return L.isValidElement(i)&&typeof i.type=="function"&&"__radixId"in i.type&&i.type.__radixId===Ltt}function Ttt(i,e){const t={...e};for(const n in e){const s=i[n],r=e[n];/^on[A-Z]/.test(n)?s&&r?t[n]=(...a)=>{const l=r(...a);return s(...a),l}:s&&(t[n]=s):n==="style"?t[n]={...s,...r}:n==="className"&&(t[n]=[s,r].filter(Boolean).join(" "))}return{...i,...t}}function Itt(i){var n,s;let e=(n=Object.getOwnPropertyDescriptor(i.props,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?i.ref:(e=(s=Object.getOwnPropertyDescriptor(i,"ref"))==null?void 0:s.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?i.props.ref:i.props.ref||i.ref)}var Att=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rl=Att.reduce((i,e)=>{const t=Ntt(`Primitive.${e}`),n=L.forwardRef((s,r)=>{const{asChild:o,...a}=s,l=o?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...a,ref:r})});return n.displayName=`Primitive.${e}`,{...i,[e]:n}},{});function Rtt(i,e){i&&hg.flushSync(()=>i.dispatchEvent(e))}function wA(i){const e=L.useRef(i);return L.useEffect(()=>{e.current=i}),L.useMemo(()=>(...t)=>{var n;return(n=e.current)==null?void 0:n.call(e,...t)},[])}function Mtt(i,e=globalThis==null?void 0:globalThis.document){const t=wA(i);L.useEffect(()=>{const n=s=>{s.key==="Escape"&&t(s)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[t,e])}var Ptt="DismissableLayer",PG="dismissableLayer.update",Ott="dismissableLayer.pointerDownOutside",jtt="dismissableLayer.focusOutside",kpe,PEe=L.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),OEe=L.forwardRef((i,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:r,onInteractOutside:o,onDismiss:a,...l}=i,c=L.useContext(PEe),[u,h]=L.useState(null),g=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=L.useState({}),m=CC(e,T=>h(T)),x=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),_=x.indexOf(v),w=u?x.indexOf(u):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,C=w>=_,E=Htt(T=>{const I=T.target,R=[...c.branches].some(P=>P.contains(I));!C||R||(s==null||s(T),o==null||o(T),T.defaultPrevented||a==null||a())},g),D=Wtt(T=>{const I=T.target;[...c.branches].some(P=>P.contains(I))||(r==null||r(T),o==null||o(T),T.defaultPrevented||a==null||a())},g);return Mtt(T=>{w===c.layers.size-1&&(n==null||n(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},g),L.useEffect(()=>{if(u)return t&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(kpe=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Npe(),()=>{t&&c.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=kpe)}},[u,g,t,c]),L.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Npe())},[u,c]),L.useEffect(()=>{const T=()=>f({});return document.addEventListener(PG,T),()=>document.removeEventListener(PG,T)},[]),d.jsx(Rl.div,{...l,ref:m,style:{pointerEvents:k?C?"auto":"none":void 0,...i.style},onFocusCapture:Kv(i.onFocusCapture,D.onFocusCapture),onBlurCapture:Kv(i.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Kv(i.onPointerDownCapture,E.onPointerDownCapture)})});OEe.displayName=Ptt;var Ftt="DismissableLayerBranch",Btt=L.forwardRef((i,e)=>{const t=L.useContext(PEe),n=L.useRef(null),s=CC(e,n);return L.useEffect(()=>{const r=n.current;if(r)return t.branches.add(r),()=>{t.branches.delete(r)}},[t.branches]),d.jsx(Rl.div,{...i,ref:s})});Btt.displayName=Ftt;function Htt(i,e=globalThis==null?void 0:globalThis.document){const t=wA(i),n=L.useRef(!1),s=L.useRef(()=>{});return L.useEffect(()=>{const r=a=>{if(a.target&&!n.current){let l=function(){jEe(Ott,t,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=l,e.addEventListener("click",s.current,{once:!0})):l()}else e.removeEventListener("click",s.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",r),e.removeEventListener("click",s.current)}},[e,t]),{onPointerDownCapture:()=>n.current=!0}}function Wtt(i,e=globalThis==null?void 0:globalThis.document){const t=wA(i),n=L.useRef(!1);return L.useEffect(()=>{const s=r=>{r.target&&!n.current&&jEe(jtt,t,{originalEvent:r},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Npe(){const i=new CustomEvent(PG);document.dispatchEvent(i)}function jEe(i,e,t,{discrete:n}){const s=t.originalEvent.target,r=new CustomEvent(i,{bubbles:!1,cancelable:!0,detail:t});e&&s.addEventListener(i,e,{once:!0}),n?Rtt(s,r):s.dispatchEvent(r)}var SU="focusScope.autoFocusOnMount",kU="focusScope.autoFocusOnUnmount",Epe={bubbles:!1,cancelable:!0},Vtt="FocusScope",FEe=L.forwardRef((i,e)=>{const{loop:t=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:r,...o}=i,[a,l]=L.useState(null),c=wA(s),u=wA(r),h=L.useRef(null),g=CC(e,x=>l(x)),f=L.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;L.useEffect(()=>{if(n){let x=function(k){if(f.paused||!a)return;const C=k.target;a.contains(C)?h.current=C:Fx(h.current,{select:!0})},v=function(k){if(f.paused||!a)return;const C=k.relatedTarget;C!==null&&(a.contains(C)||Fx(h.current,{select:!0}))},_=function(k){if(document.activeElement===document.body)for(const E of k)E.removedNodes.length>0&&Fx(a)};document.addEventListener("focusin",x),document.addEventListener("focusout",v);const w=new MutationObserver(_);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",v),w.disconnect()}}},[n,a,f.paused]),L.useEffect(()=>{if(a){Dpe.add(f);const x=document.activeElement;if(!a.contains(x)){const _=new CustomEvent(SU,Epe);a.addEventListener(SU,c),a.dispatchEvent(_),_.defaultPrevented||(ztt(Gtt(BEe(a)),{select:!0}),document.activeElement===x&&Fx(a))}return()=>{a.removeEventListener(SU,c),setTimeout(()=>{const _=new CustomEvent(kU,Epe);a.addEventListener(kU,u),a.dispatchEvent(_),_.defaultPrevented||Fx(x??document.body,{select:!0}),a.removeEventListener(kU,u),Dpe.remove(f)},0)}}},[a,c,u,f]);const m=L.useCallback(x=>{if(!t&&!n||f.paused)return;const v=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,_=document.activeElement;if(v&&_){const w=x.currentTarget,[k,C]=Utt(w);k&&C?!x.shiftKey&&_===C?(x.preventDefault(),t&&Fx(k,{select:!0})):x.shiftKey&&_===k&&(x.preventDefault(),t&&Fx(C,{select:!0})):_===w&&x.preventDefault()}},[t,n,f.paused]);return d.jsx(Rl.div,{tabIndex:-1,...o,ref:g,onKeyDown:m})});FEe.displayName=Vtt;function ztt(i,{select:e=!1}={}){const t=document.activeElement;for(const n of i)if(Fx(n,{select:e}),document.activeElement!==t)return}function Utt(i){const e=BEe(i),t=Lpe(e,i),n=Lpe(e.reverse(),i);return[t,n]}function BEe(i){const e=[],t=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function Lpe(i,e){for(const t of i)if(!$tt(t,{upTo:e}))return t}function $tt(i,{upTo:e}){if(getComputedStyle(i).visibility==="hidden")return!0;for(;i;){if(e!==void 0&&i===e)return!1;if(getComputedStyle(i).display==="none")return!0;i=i.parentElement}return!1}function qtt(i){return i instanceof HTMLInputElement&&"select"in i}function Fx(i,{select:e=!1}={}){if(i&&i.focus){const t=document.activeElement;i.focus({preventScroll:!0}),i!==t&&qtt(i)&&e&&i.select()}}var Dpe=Ktt();function Ktt(){let i=[];return{add(e){const t=i[0];e!==t&&(t==null||t.pause()),i=Tpe(i,e),i.unshift(e)},remove(e){var t;i=Tpe(i,e),(t=i[0])==null||t.resume()}}}function Tpe(i,e){const t=[...i],n=t.indexOf(e);return n!==-1&&t.splice(n,1),t}function Gtt(i){return i.filter(e=>e.tagName!=="A")}var Ytt="Portal",HEe=L.forwardRef((i,e)=>{var a;const{container:t,...n}=i,[s,r]=L.useState(!1);yA(()=>r(!0),[]);const o=t||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?TCe.createPortal(d.jsx(Rl.div,{...n,ref:e}),o):null});HEe.displayName=Ytt;function Qtt(i,e){return L.useReducer((t,n)=>e[t][n]??t,i)}var A7=i=>{const{present:e,children:t}=i,n=Xtt(e),s=typeof t=="function"?t({present:n.isPresent}):L.Children.only(t),r=CC(n.ref,Ztt(s));return typeof t=="function"||n.isPresent?L.cloneElement(s,{ref:r}):null};A7.displayName="Presence";function Xtt(i){const[e,t]=L.useState(),n=L.useRef(null),s=L.useRef(i),r=L.useRef("none"),o=i?"mounted":"unmounted",[a,l]=Qtt(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return L.useEffect(()=>{const c=w5(n.current);r.current=a==="mounted"?c:"none"},[a]),yA(()=>{const c=n.current,u=s.current;if(u!==i){const g=r.current,f=w5(c);i?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&g!==f?"ANIMATION_OUT":"UNMOUNT"),s.current=i}},[i,l]),yA(()=>{if(e){let c;const u=e.ownerDocument.defaultView??window,h=f=>{const x=w5(n.current).includes(CSS.escape(f.animationName));if(f.target===e&&x&&(l("ANIMATION_END"),!s.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",c=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},g=f=>{f.target===e&&(r.current=w5(n.current))};return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{u.clearTimeout(c),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:L.useCallback(c=>{n.current=c?getComputedStyle(c):null,t(c)},[])}}function w5(i){return(i==null?void 0:i.animationName)||"none"}function Ztt(i){var n,s;let e=(n=Object.getOwnPropertyDescriptor(i.props,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?i.ref:(e=(s=Object.getOwnPropertyDescriptor(i,"ref"))==null?void 0:s.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?i.props.ref:i.props.ref||i.ref)}var NU=0;function Jtt(){L.useEffect(()=>{const i=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",i[0]??Ipe()),document.body.insertAdjacentElement("beforeend",i[1]??Ipe()),NU++,()=>{NU===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),NU--}},[])}function Ipe(){const i=document.createElement("span");return i.setAttribute("data-radix-focus-guard",""),i.tabIndex=0,i.style.outline="none",i.style.opacity="0",i.style.position="fixed",i.style.pointerEvents="none",i}var Df=function(){return Df=Object.assign||function(e){for(var t,n=1,s=arguments.length;n"u")return mnt;var e=bnt(i),t=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-t+e[2]-e[0])}},vnt=UEe(),bN="data-scroll-locked",_nt=function(i,e,t,n){var s=i.left,r=i.top,o=i.right,a=i.gap;return t===void 0&&(t="margin"),`
- .`.concat(tnt,` {
- overflow: hidden `).concat(n,`;
- padding-right: `).concat(a,"px ").concat(n,`;
- }
- body[`).concat(bN,`] {
- overflow: hidden `).concat(n,`;
- overscroll-behavior: contain;
- `).concat([e&&"position: relative ".concat(n,";"),t==="margin"&&`
- padding-left: `.concat(s,`px;
- padding-top: `).concat(r,`px;
- padding-right: `).concat(o,`px;
- margin-left:0;
- margin-top:0;
- margin-right: `).concat(a,"px ").concat(n,`;
- `),t==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
- }
-
- .`).concat(C4,` {
- right: `).concat(a,"px ").concat(n,`;
- }
-
- .`).concat(S4,` {
- margin-right: `).concat(a,"px ").concat(n,`;
- }
-
- .`).concat(C4," .").concat(C4,` {
- right: 0 `).concat(n,`;
- }
-
- .`).concat(S4," .").concat(S4,` {
- margin-right: 0 `).concat(n,`;
- }
-
- body[`).concat(bN,`] {
- `).concat(nnt,": ").concat(a,`px;
- }
-`)},Rpe=function(){var i=parseInt(document.body.getAttribute(bN)||"0",10);return isFinite(i)?i:0},ynt=function(){L.useEffect(function(){return document.body.setAttribute(bN,(Rpe()+1).toString()),function(){var i=Rpe()-1;i<=0?document.body.removeAttribute(bN):document.body.setAttribute(bN,i.toString())}},[])},wnt=function(i){var e=i.noRelative,t=i.noImportant,n=i.gapMode,s=n===void 0?"margin":n;ynt();var r=L.useMemo(function(){return xnt(s)},[s]);return L.createElement(vnt,{styles:_nt(r,!e,s,t?"":"!important")})},OG=!1;if(typeof window<"u")try{var C5=Object.defineProperty({},"passive",{get:function(){return OG=!0,!0}});window.addEventListener("test",C5,C5),window.removeEventListener("test",C5,C5)}catch{OG=!1}var AS=OG?{passive:!1}:!1,Cnt=function(i){return i.tagName==="TEXTAREA"},$Ee=function(i,e){if(!(i instanceof Element))return!1;var t=window.getComputedStyle(i);return t[e]!=="hidden"&&!(t.overflowY===t.overflowX&&!Cnt(i)&&t[e]==="visible")},Snt=function(i){return $Ee(i,"overflowY")},knt=function(i){return $Ee(i,"overflowX")},Mpe=function(i,e){var t=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=qEe(i,n);if(s){var r=KEe(i,n),o=r[1],a=r[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==t.body);return!1},Nnt=function(i){var e=i.scrollTop,t=i.scrollHeight,n=i.clientHeight;return[e,t,n]},Ent=function(i){var e=i.scrollLeft,t=i.scrollWidth,n=i.clientWidth;return[e,t,n]},qEe=function(i,e){return i==="v"?Snt(e):knt(e)},KEe=function(i,e){return i==="v"?Nnt(e):Ent(e)},Lnt=function(i,e){return i==="h"&&e==="rtl"?-1:1},Dnt=function(i,e,t,n,s){var r=Lnt(i,window.getComputedStyle(e).direction),o=r*n,a=t.target,l=e.contains(a),c=!1,u=o>0,h=0,g=0;do{if(!a)break;var f=KEe(i,a),m=f[0],x=f[1],v=f[2],_=x-v-r*m;(m||_)&&qEe(i,a)&&(h+=_,g+=m);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(u&&Math.abs(h)<1||!u&&Math.abs(g)<1)&&(c=!0),c},S5=function(i){return"changedTouches"in i?[i.changedTouches[0].clientX,i.changedTouches[0].clientY]:[0,0]},Ppe=function(i){return[i.deltaX,i.deltaY]},Ope=function(i){return i&&"current"in i?i.current:i},Tnt=function(i,e){return i[0]===e[0]&&i[1]===e[1]},Int=function(i){return`
- .block-interactivity-`.concat(i,` {pointer-events: none;}
- .allow-interactivity-`).concat(i,` {pointer-events: all;}
-`)},Ant=0,RS=[];function Rnt(i){var e=L.useRef([]),t=L.useRef([0,0]),n=L.useRef(),s=L.useState(Ant++)[0],r=L.useState(UEe)[0],o=L.useRef(i);L.useEffect(function(){o.current=i},[i]),L.useEffect(function(){if(i.inert){document.body.classList.add("block-interactivity-".concat(s));var x=ent([i.lockRef.current],(i.shards||[]).map(Ope),!0).filter(Boolean);return x.forEach(function(v){return v.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),x.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(s))})}}},[i.inert,i.lockRef.current,i.shards]);var a=L.useCallback(function(x,v){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!o.current.allowPinchZoom;var _=S5(x),w=t.current,k="deltaX"in x?x.deltaX:w[0]-_[0],C="deltaY"in x?x.deltaY:w[1]-_[1],E,D=x.target,T=Math.abs(k)>Math.abs(C)?"h":"v";if("touches"in x&&T==="h"&&D.type==="range")return!1;var I=window.getSelection(),R=I&&I.anchorNode,P=R?R===D||R.contains(D):!1;if(P)return!1;var j=Mpe(T,D);if(!j)return!0;if(j?E=T:(E=T==="v"?"h":"v",j=Mpe(T,D)),!j)return!1;if(!n.current&&"changedTouches"in x&&(k||C)&&(n.current=E),!E)return!0;var B=n.current||E;return Dnt(B,v,x,B==="h"?k:C)},[]),l=L.useCallback(function(x){var v=x;if(!(!RS.length||RS[RS.length-1]!==r)){var _="deltaY"in v?Ppe(v):S5(v),w=e.current.filter(function(E){return E.name===v.type&&(E.target===v.target||v.target===E.shadowParent)&&Tnt(E.delta,_)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var k=(o.current.shards||[]).map(Ope).filter(Boolean).filter(function(E){return E.contains(v.target)}),C=k.length>0?a(v,k[0]):!o.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),c=L.useCallback(function(x,v,_,w){var k={name:x,delta:v,target:_,should:w,shadowParent:Mnt(_)};e.current.push(k),setTimeout(function(){e.current=e.current.filter(function(C){return C!==k})},1)},[]),u=L.useCallback(function(x){t.current=S5(x),n.current=void 0},[]),h=L.useCallback(function(x){c(x.type,Ppe(x),x.target,a(x,i.lockRef.current))},[]),g=L.useCallback(function(x){c(x.type,S5(x),x.target,a(x,i.lockRef.current))},[]);L.useEffect(function(){return RS.push(r),i.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",l,AS),document.addEventListener("touchmove",l,AS),document.addEventListener("touchstart",u,AS),function(){RS=RS.filter(function(x){return x!==r}),document.removeEventListener("wheel",l,AS),document.removeEventListener("touchmove",l,AS),document.removeEventListener("touchstart",u,AS)}},[]);var f=i.removeScrollBar,m=i.inert;return L.createElement(L.Fragment,null,m?L.createElement(r,{styles:Int(s)}):null,f?L.createElement(wnt,{noRelative:i.noRelative,gapMode:i.gapMode}):null)}function Mnt(i){for(var e=null;i!==null;)i instanceof ShadowRoot&&(e=i.host,i=i.host),i=i.parentNode;return e}const Pnt=cnt(zEe,Rnt);var GEe=L.forwardRef(function(i,e){return L.createElement(R7,Df({},i,{ref:e,sideCar:Pnt}))});GEe.classNames=R7.classNames;var Ont=function(i){if(typeof document>"u")return null;var e=Array.isArray(i)?i[0]:i;return e.ownerDocument.body},MS=new WeakMap,k5=new WeakMap,N5={},TU=0,YEe=function(i){return i&&(i.host||YEe(i.parentNode))},jnt=function(i,e){return e.map(function(t){if(i.contains(t))return t;var n=YEe(t);return n&&i.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",i,". Doing nothing"),null)}).filter(function(t){return!!t})},Fnt=function(i,e,t,n){var s=jnt(e,Array.isArray(i)?i:[i]);N5[t]||(N5[t]=new WeakMap);var r=N5[t],o=[],a=new Set,l=new Set(s),c=function(h){!h||a.has(h)||(a.add(h),c(h.parentNode))};s.forEach(c);var u=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(g){if(a.has(g))u(g);else try{var f=g.getAttribute(n),m=f!==null&&f!=="false",x=(MS.get(g)||0)+1,v=(r.get(g)||0)+1;MS.set(g,x),r.set(g,v),o.push(g),x===1&&m&&k5.set(g,!0),v===1&&g.setAttribute(t,"true"),m||g.setAttribute(n,"true")}catch(_){console.error("aria-hidden: cannot operate on ",g,_)}})};return u(e),a.clear(),TU++,function(){o.forEach(function(h){var g=MS.get(h)-1,f=r.get(h)-1;MS.set(h,g),r.set(h,f),g||(k5.has(h)||h.removeAttribute(n),k5.delete(h)),f||h.removeAttribute(t)}),TU--,TU||(MS=new WeakMap,MS=new WeakMap,k5=new WeakMap,N5={})}},Bnt=function(i,e,t){t===void 0&&(t="data-aria-hidden");var n=Array.from(Array.isArray(i)?i:[i]),s=Ont(i);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),Fnt(n,s,t,"aria-hidden")):function(){return null}};function Hnt(i){const e=Wnt(i),t=L.forwardRef((n,s)=>{const{children:r,...o}=n,a=L.Children.toArray(r),l=a.find(znt);if(l){const c=l.props.children,u=a.map(h=>h===l?L.Children.count(c)>1?L.Children.only(null):L.isValidElement(c)?c.props.children:null:h);return d.jsx(e,{...o,ref:s,children:L.isValidElement(c)?L.cloneElement(c,void 0,u):null})}return d.jsx(e,{...o,ref:s,children:r})});return t.displayName=`${i}.Slot`,t}function Wnt(i){const e=L.forwardRef((t,n)=>{const{children:s,...r}=t;if(L.isValidElement(s)){const o=$nt(s),a=Unt(r,s.props);return s.type!==L.Fragment&&(a.ref=n?yb(n,o):o),L.cloneElement(s,a)}return L.Children.count(s)>1?L.Children.only(null):null});return e.displayName=`${i}.SlotClone`,e}var Vnt=Symbol("radix.slottable");function znt(i){return L.isValidElement(i)&&typeof i.type=="function"&&"__radixId"in i.type&&i.type.__radixId===Vnt}function Unt(i,e){const t={...e};for(const n in e){const s=i[n],r=e[n];/^on[A-Z]/.test(n)?s&&r?t[n]=(...a)=>{const l=r(...a);return s(...a),l}:s&&(t[n]=s):n==="style"?t[n]={...s,...r}:n==="className"&&(t[n]=[s,r].filter(Boolean).join(" "))}return{...i,...t}}function $nt(i){var n,s;let e=(n=Object.getOwnPropertyDescriptor(i.props,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?i.ref:(e=(s=Object.getOwnPropertyDescriptor(i,"ref"))==null?void 0:s.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?i.props.ref:i.props.ref||i.ref)}var M7="Dialog",[QEe]=xtt(M7),[qnt,Og]=QEe(M7),XEe=i=>{const{__scopeDialog:e,children:t,open:n,defaultOpen:s,onOpenChange:r,modal:o=!0}=i,a=L.useRef(null),l=L.useRef(null),[c,u]=Ctt({prop:n,defaultProp:s??!1,onChange:r,caller:M7});return d.jsx(qnt,{scope:e,triggerRef:a,contentRef:l,contentId:ob(),titleId:ob(),descriptionId:ob(),open:c,onOpenChange:u,onOpenToggle:L.useCallback(()=>u(h=>!h),[u]),modal:o,children:t})};XEe.displayName=M7;var ZEe="DialogTrigger",Knt=L.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,s=Og(ZEe,t),r=CC(e,s.triggerRef);return d.jsx(Rl.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Pse(s.open),...n,ref:r,onClick:Kv(i.onClick,s.onOpenToggle)})});Knt.displayName=ZEe;var Rse="DialogPortal",[Gnt,JEe]=QEe(Rse,{forceMount:void 0}),eLe=i=>{const{__scopeDialog:e,forceMount:t,children:n,container:s}=i,r=Og(Rse,e);return d.jsx(Gnt,{scope:e,forceMount:t,children:L.Children.map(n,o=>d.jsx(A7,{present:t||r.open,children:d.jsx(HEe,{asChild:!0,container:s,children:o})}))})};eLe.displayName=Rse;var Aj="DialogOverlay",tLe=L.forwardRef((i,e)=>{const t=JEe(Aj,i.__scopeDialog),{forceMount:n=t.forceMount,...s}=i,r=Og(Aj,i.__scopeDialog);return r.modal?d.jsx(A7,{present:n||r.open,children:d.jsx(Qnt,{...s,ref:e})}):null});tLe.displayName=Aj;var Ynt=Hnt("DialogOverlay.RemoveScroll"),Qnt=L.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,s=Og(Aj,t);return d.jsx(GEe,{as:Ynt,allowPinchZoom:!0,shards:[s.contentRef],children:d.jsx(Rl.div,{"data-state":Pse(s.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),Rw="DialogContent",nLe=L.forwardRef((i,e)=>{const t=JEe(Rw,i.__scopeDialog),{forceMount:n=t.forceMount,...s}=i,r=Og(Rw,i.__scopeDialog);return d.jsx(A7,{present:n||r.open,children:r.modal?d.jsx(Xnt,{...s,ref:e}):d.jsx(Znt,{...s,ref:e})})});nLe.displayName=Rw;var Xnt=L.forwardRef((i,e)=>{const t=Og(Rw,i.__scopeDialog),n=L.useRef(null),s=CC(e,t.contentRef,n);return L.useEffect(()=>{const r=n.current;if(r)return Bnt(r)},[]),d.jsx(iLe,{...i,ref:s,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Kv(i.onCloseAutoFocus,r=>{var o;r.preventDefault(),(o=t.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Kv(i.onPointerDownOutside,r=>{const o=r.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&r.preventDefault()}),onFocusOutside:Kv(i.onFocusOutside,r=>r.preventDefault())})}),Znt=L.forwardRef((i,e)=>{const t=Og(Rw,i.__scopeDialog),n=L.useRef(!1),s=L.useRef(!1);return d.jsx(iLe,{...i,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var o,a;(o=i.onCloseAutoFocus)==null||o.call(i,r),r.defaultPrevented||(n.current||(a=t.triggerRef.current)==null||a.focus(),r.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:r=>{var l,c;(l=i.onInteractOutside)==null||l.call(i,r),r.defaultPrevented||(n.current=!0,r.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=r.target;((c=t.triggerRef.current)==null?void 0:c.contains(o))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&s.current&&r.preventDefault()}})}),iLe=L.forwardRef((i,e)=>{const{__scopeDialog:t,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:r,...o}=i,a=Og(Rw,t),l=L.useRef(null),c=CC(e,l);return Jtt(),d.jsxs(d.Fragment,{children:[d.jsx(FEe,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:r,children:d.jsx(OEe,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Pse(a.open),...o,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(Jnt,{titleId:a.titleId}),d.jsx(tit,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Mse="DialogTitle",sLe=L.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,s=Og(Mse,t);return d.jsx(Rl.h2,{id:s.titleId,...n,ref:e})});sLe.displayName=Mse;var rLe="DialogDescription",oLe=L.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,s=Og(rLe,t);return d.jsx(Rl.p,{id:s.descriptionId,...n,ref:e})});oLe.displayName=rLe;var aLe="DialogClose",lLe=L.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,s=Og(aLe,t);return d.jsx(Rl.button,{type:"button",...n,ref:e,onClick:Kv(i.onClick,()=>s.onOpenChange(!1))})});lLe.displayName=aLe;function Pse(i){return i?"open":"closed"}var cLe="DialogTitleWarning",[Brn,dLe]=btt(cLe,{contentName:Rw,titleName:Mse,docsSlug:"dialog"}),Jnt=({titleId:i})=>{const e=dLe(cLe),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
-
-If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
-
-For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return L.useEffect(()=>{i&&(document.getElementById(i)||console.error(t))},[t,i]),null},eit="DialogDescriptionWarning",tit=({contentRef:i,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${dLe(eit).contentName}}.`;return L.useEffect(()=>{var r;const s=(r=i.current)==null?void 0:r.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(n))},[n,i,e]),null},Ose=XEe,jse=eLe,Fse=tLe,Bse=nLe,uLe=sLe,hLe=oLe,gLe=lLe;function sl({open:i,onOpenChange:e,title:t,description:n,confirmLabel:s="Delete",cancelLabel:r="Cancel",onConfirm:o,variant:a="destructive",isPending:l=!1}){const c=a==="destructive"?"text-destructive":"text-amber-500",u=a==="destructive"?"bg-destructive/10":"bg-amber-500/10";return d.jsx(Ose,{open:i,onOpenChange:e,children:d.jsxs(jse,{children:[d.jsx(Fse,{className:"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),d.jsxs(Bse,{className:be("fixed inset-x-0 top-[50%] z-50 mx-auto w-full max-w-md translate-y-[-50%]","rounded-xl border border-border bg-card p-6 shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:[d.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[d.jsx("div",{className:be("rounded-full p-3",u),children:d.jsx(Vi,{className:be("h-6 w-6",c)})}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(uLe,{className:"text-lg font-semibold text-foreground",children:t}),d.jsx(hLe,{className:"text-sm text-muted-foreground",children:n})]})]}),d.jsxs("div",{className:"mt-6 flex gap-3",children:[d.jsx(Yt,{variant:"outline",className:"flex-1",onClick:()=>e(!1),disabled:l,children:r}),d.jsx(Yt,{variant:"destructive",className:"flex-1",onClick:()=>{o()},disabled:l,children:l?"…":s})]}),d.jsxs(gLe,{className:"absolute inset-e-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[d.jsx(An,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})})}function ZM({icon:i,title:e,description:t,actionLabel:n,onAction:s}){return d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border-2 border-dashed border-border py-16",children:[d.jsx(i,{className:"h-12 w-12 text-muted-foreground/50"}),d.jsx("p",{className:"mt-4 text-lg font-medium text-muted-foreground",children:e}),t&&d.jsx("p",{className:"mt-1 text-sm text-muted-foreground/70",children:t}),n&&s&&d.jsx(Yt,{className:"mt-4",size:"md",onClick:s,children:n})]})}function ep({message:i,onRetry:e,retryLabel:t="Retry"}){return d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-destructive/30 bg-destructive/5 py-16",children:[d.jsx(Lo,{className:"h-12 w-12 text-destructive"}),d.jsx("p",{className:"mt-4 text-lg font-medium text-destructive",children:i}),e&&d.jsx(Yt,{variant:"ghost",className:"mt-4 text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:e,children:t})]})}function fLe({onLoadMore:i,isFetchingMore:e,hasMore:t}){const n=L.useRef(null);return L.useEffect(()=>{if(!t||e)return;const s=n.current;if(!s)return;const r=new IntersectionObserver(([o])=>{o!=null&&o.isIntersecting&&i()},{rootMargin:"200px"});return r.observe(s),()=>r.disconnect()},[t,e,i]),t?d.jsx("div",{ref:n,className:"flex items-center justify-center py-6","aria-live":"polite",children:e&&d.jsxs(d.Fragment,{children:[d.jsx(ni,{className:"h-5 w-5 animate-spin text-muted-foreground","aria-hidden":"true"}),d.jsx("span",{className:"sr-only",children:"Loading more items…"})]})}):null}function zL({view:i,onChange:e}){const{t}=xe(),n=L.useCallback(s=>{if(s.key==="ArrowLeft"||s.key==="ArrowRight"){s.preventDefault();const r=i==="card"?"list":"card";e(r),requestAnimationFrame(()=>{const o=document.querySelector(`[data-testid="view-toggle-${r}"]`);o==null||o.focus()})}},[i,e]);return d.jsxs("div",{className:"inline-flex items-center rounded-lg border border-input bg-background p-0.5",role:"radiogroup","aria-label":t("common.viewMode","View mode"),"data-testid":"view-toggle",onKeyDown:n,children:[d.jsx("button",{type:"button",role:"radio","aria-checked":i==="card","aria-label":t("common.cardView","Card view"),tabIndex:i==="card"?0:-1,onClick:()=>e("card"),className:be("inline-flex items-center justify-center rounded-md p-1.5 transition-colors",i==="card"?"bg-secondary text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),"data-testid":"view-toggle-card",children:d.jsx(N7e,{className:"h-4 w-4","aria-hidden":"true"})}),d.jsx("button",{type:"button",role:"radio","aria-checked":i==="list","aria-label":t("common.listView","List view"),tabIndex:i==="list"?0:-1,onClick:()=>e("list"),className:be("inline-flex items-center justify-center rounded-md p-1.5 transition-colors",i==="list"?"bg-secondary text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),"data-testid":"view-toggle-list",children:d.jsx(MSe,{className:"h-4 w-4","aria-hidden":"true"})})]})}const pLe="eddi-view-mode";function WE(i){try{const e=localStorage.getItem(`${pLe}-${i}`);if(e==="card"||e==="list")return e}catch{}return"card"}function JM(i,e){try{localStorage.setItem(`${pLe}-${i}`,e)}catch{}}function nit(){const{t:i}=xe(),[e,t]=L.useState(""),[n,s]=L.useState(!1),[r,o]=L.useState(!1),[a,l]=L.useState(!1),[c,u]=L.useState(null),[h,g]=L.useState(null),[f,m]=L.useState(()=>WE("agents")),[x,v]=L.useState("modified"),[_,w]=L.useState("desc"),k=$s(H=>H.maybeAutoStart);L.useEffect(()=>{const H=setTimeout(()=>k("agents"),500);return()=>clearTimeout(H)},[k]);const{data:C,isLoading:E,isError:D,refetch:T,fetchNextPage:I,hasNextPage:R,isFetchingNextPage:P}=I7(e),j=xEe(),B=vEe(),U=L.useMemo(()=>{const H=(C==null?void 0:C.pages.flat())??[];return[...Cg(H)].sort((Y,V)=>{let ue=0;return x==="name"?ue=(Y.name??"").localeCompare(V.name??""):x==="version"?ue=Y.version-V.version:ue=new Date(Y.lastModifiedOn).getTime()-new Date(V.lastModifiedOn).getTime(),_==="asc"?ue:-ue})},[C,x,_]),$=L.useCallback(H=>{x===H?w(Q=>Q==="asc"?"desc":"asc"):(v(H),w(H==="modified"?"desc":"asc"))},[x]);function K(){ze.success(i("agents.importSuccess","Agent imported successfully"))}function z(H,Q){u({id:H,version:Q})}function G(){c&&j.mutate(c,{onSuccess:()=>{ze.success(i("common.delete")+" ✓"),u(null)},onError:H=>ze.error(Vs(H))})}function ne(H,Q){B.mutate({id:H,version:Q,deepCopy:!0},{onSuccess:()=>ze.success(i("agentDetail.duplicateSuccess")),onError:Y=>ze.error(Vs(Y))})}function te(H){m(H),JM("agents",H)}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-2 text-3xl font-bold text-foreground",children:[d.jsx(ai,{className:"h-8 w-8 text-primary"}),i("pages.agents.title")]}),d.jsx("p",{className:"mt-1 text-muted-foreground",children:i("pages.agents.subtitle")})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs(Yt,{variant:"outline",onClick:()=>l(!0),"data-testid":"import-agent-btn",children:[d.jsx(qv,{className:"h-4 w-4"}),i("agents.import","Import")]}),d.jsxs(Yt,{onClick:()=>s(!0),"data-testid":"create-agent-btn",children:[d.jsx(Gt,{className:"h-4 w-4"}),i("createOrWizard.newAgent","New Agent")]})]})]}),d.jsxs("div",{className:"flex items-center gap-3","data-tour":"agents-search",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx(br,{className:"absolute inset-s-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:e,onChange:H=>t(H.target.value),placeholder:i("common.search"),"aria-label":i("common.search"),className:"w-full rounded-lg border border-input bg-background py-2.5 ps-10 pe-4 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"agent-search"})]}),d.jsx(zL,{view:f,onChange:te})]}),d.jsxs("div",{"data-tour":"agents-content",children:[E&&d.jsx("div",{className:"cq-card-grid",children:Array.from({length:4}).map((H,Q)=>d.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 space-y-3",children:[d.jsx(bi,{className:"h-5 w-3/4"}),d.jsx(bi,{className:"h-4 w-1/2"}),d.jsx(bi,{className:"h-4 w-full"}),d.jsx(bi,{className:"h-8 w-1/3"})]},Q))}),D&&d.jsx(ep,{message:i("common.error"),onRetry:()=>T(),retryLabel:i("common.retry")}),!E&&!D&&U.length===0&&d.jsx(ZM,{icon:ai,title:i(e?"common.noResults":"agents.empty"),description:e?void 0:i("agents.emptyDescription","Use the wizard to create a fully configured agent in minutes."),actionLabel:e?void 0:i("agents.createAgent"),onAction:e?void 0:()=>s(!0)}),!E&&!D&&U.length>0&&d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[i("agents.count",{count:U.length}),R&&"+"]}),f==="card"?d.jsx("div",{className:"cq-card-grid","data-testid":"agent-grid",children:U.map(H=>d.jsx(Let,{agent:H,onDuplicate:ne,onDelete:z,onExport:(Q,Y)=>g({id:Q,version:Y})},H.id))}):d.jsx("div",{className:"overflow-hidden rounded-xl border bg-card shadow-sm","data-testid":"agent-list",children:d.jsxs("table",{className:"w-full",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-border bg-secondary/50",children:[d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground","aria-sort":x==="name"?_==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{onClick:()=>$("name"),className:"inline-flex items-center gap-1 hover:text-foreground transition-colors","aria-label":i("common.sortByName","Sort by name"),children:[i("common.name","Name"),x==="name"?_==="asc"?d.jsx(zv,{className:"h-3 w-3","aria-hidden":"true"}):d.jsx(zf,{className:"h-3 w-3","aria-hidden":"true"}):d.jsx(pN,{className:"h-3 w-3 opacity-30","aria-hidden":"true"})]})}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("common.id","ID")}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground","aria-sort":x==="version"?_==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{onClick:()=>$("version"),className:"inline-flex items-center gap-1 hover:text-foreground transition-colors","aria-label":i("common.sortByVersion","Sort by version"),children:[i("common.version","Version"),x==="version"?_==="asc"?d.jsx(zv,{className:"h-3 w-3","aria-hidden":"true"}):d.jsx(zf,{className:"h-3 w-3","aria-hidden":"true"}):d.jsx(pN,{className:"h-3 w-3 opacity-30","aria-hidden":"true"})]})}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground","aria-sort":x==="modified"?_==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{onClick:()=>$("modified"),className:"inline-flex items-center gap-1 hover:text-foreground transition-colors","aria-label":i("common.sortByModified","Sort by last modified"),children:[i("common.modified","Modified"),x==="modified"?_==="asc"?d.jsx(zv,{className:"h-3 w-3","aria-hidden":"true"}):d.jsx(zf,{className:"h-3 w-3","aria-hidden":"true"}):d.jsx(pN,{className:"h-3 w-3 opacity-30","aria-hidden":"true"})]})}),d.jsx("th",{className:"px-5 py-3 text-end text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("conversations.actions","Actions")})]})}),d.jsx("tbody",{className:"divide-y divide-border",children:U.map(H=>d.jsxs("tr",{className:"hover:bg-secondary/30 transition-colors",children:[d.jsx("td",{className:"px-5 py-3",children:d.jsxs(Kn,{to:`/manage/agentview/${H.id}`,className:"text-sm font-medium text-foreground hover:text-primary transition-colors",children:[H.name||i("agents.unnamed","Unnamed Agent"),d.jsx(To,{className:"ms-1 inline h-3 w-3 opacity-40"})]})}),d.jsx("td",{className:"px-5 py-3",children:d.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[H.id.slice(0,12),"…"]})}),d.jsx("td",{className:"px-5 py-3",children:d.jsxs("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:["v",H.version]})}),d.jsx("td",{className:"px-5 py-3",children:d.jsx("span",{className:"text-sm text-muted-foreground",children:new Date(H.lastModifiedOn).toLocaleString()})}),d.jsx("td",{className:"px-5 py-3 text-end",children:d.jsxs("div",{className:"inline-flex items-center gap-1",children:[d.jsx("button",{onClick:()=>ne(H.id,H.version),className:"rounded-md p-1.5 text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors",title:i("common.duplicate","Duplicate"),"aria-label":i("common.duplicate","Duplicate"),children:d.jsx(mo,{className:"h-4 w-4","aria-hidden":"true"})}),d.jsx("button",{onClick:()=>g({id:H.id,version:H.version}),className:"rounded-md p-1.5 text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors",title:i("agents.export","Export"),"aria-label":i("agents.export","Export"),children:d.jsx(Q_,{className:"h-4 w-4","aria-hidden":"true"})}),d.jsx("button",{onClick:()=>z(H.id,H.version),className:"rounded-md p-1.5 text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",title:i("common.delete"),"aria-label":i("common.delete"),children:d.jsx(_n,{className:"h-4 w-4","aria-hidden":"true"})})]})})]},H.id))})]})}),d.jsx(fLe,{onLoadMore:()=>I(),isFetchingMore:P,hasMore:!!R})]})]}),d.jsx(MEe,{open:n,onClose:()=>s(!1),type:"agent",wizardPath:"/manage/agents/wizard",onQuickCreate:()=>{s(!1),o(!0)}}),d.jsx(Tet,{open:r,onClose:()=>o(!1)}),d.jsx(gtt,{open:a,onClose:()=>l(!1),onSuccess:K}),d.jsx(sl,{open:c!==null,onOpenChange:H=>!H&&u(null),title:i("agents.confirmDelete"),description:i("agents.confirmDeleteDescription","This action cannot be undone. The agent and all its data will be permanently removed."),confirmLabel:i("common.delete"),cancelLabel:i("common.cancel"),onConfirm:G,isPending:j.isPending}),h&&d.jsx(REe,{open:!0,onClose:()=>g(null),agentId:h.id,agentVersion:h.version})]})}const t0=["workflows"],IU=50;function iit(i=100,e=0,t=""){return hn({queryKey:[...t0,"descriptors",{limit:i,index:e,filter:t}],queryFn:()=>T7(i,e,t)})}function sit(i=""){return rSe({queryKey:[...t0,"descriptors-infinite",{filter:i}],queryFn:({pageParam:e=0})=>T7(IU,e,i),initialPageParam:0,getNextPageParam:(e,t)=>{if(e.length===IU)return t.length*IU}})}function rit(i,e){return hn({queryKey:[...t0,i,e],queryFn:()=>qM(i,e),enabled:!!i&&e>0})}function oit(i){return hn({queryKey:[...t0,i,"versions"],queryFn:()=>$Je(i),enabled:!!i})}function ait(i){const e=new URL(i,"http://dummy"),t=e.pathname.split("/").filter(Boolean),n=t[t.length-1],s=parseInt(e.searchParams.get("version")||"1",10);return{id:n,version:s}}function lit(){const i=cn();return Kt({mutationFn:async({config:e,name:t,description:n})=>{const s=await zJe(e);if((t||n)&&s.location){const{id:r,version:o}=ait(s.location);await Tse(r,o,{name:t,description:n})}return s},onSuccess:()=>{i.invalidateQueries({queryKey:t0})}})}function cit(){const i=cn();return Kt({mutationFn:({id:e,version:t,config:n})=>Dse(e,t,n),onSuccess:()=>{i.invalidateQueries({queryKey:t0})}})}function mLe(){const i=cn();return Kt({mutationFn:({id:e,version:t})=>UJe(e,t),onSuccess:()=>{i.invalidateQueries({queryKey:t0})}})}function dit(){const i=cn();return Kt({mutationFn:({id:e,version:t,deepCopy:n})=>qJe(e,t,n),onSuccess:()=>{i.invalidateQueries({queryKey:t0})}})}function uit(){const i=cn();return Kt({mutationFn:async({agentId:e,version:t,workflows:n})=>{const s=await vC(e,t);return jM(e,t,{...s,workflows:n})},onSuccess:()=>{i.invalidateQueries({queryKey:["agents"]})}})}function hit(i){const e=new Map;for(const t of i){const{id:n,version:s}=uo(t.resource),r=e.get(n);(!r||s>r.version)&&e.set(n,{...t,id:n,version:s})}return Array.from(e.values()).sort((t,n)=>n.lastModifiedOn-t.lastModifiedOn)}function bLe(i){return hn({queryKey:["latest-versions",...i.slice().sort()],queryFn:async()=>{const e={},t=new Set,n=[];for(const s of i)if(!(!s||!s.includes("://")))try{const{id:r}=uo(s);if(t.has(r))continue;t.add(r);const o=s.startsWith("eddi://")?s.replace("eddi://","http://"):s,l=new URL(o,"http://dummy").pathname.split("/").filter(Boolean);l.length>=3&&n.push({uri:s,id:r,store:l[0],plural:l[1]})}catch{}return await Promise.all(n.map(async({id:s,store:r,plural:o})=>{try{const a=await Oe.get(`/${r}/${o}/descriptors?filter=${s}&includePreviousVersions=true`);let l=1;for(const c of a)try{const{version:u}=uo(c.resource);u>l&&(l=u)}catch{}e[s]=l}catch{}})),e},enabled:i.length>0,staleTime:3e4})}const xLe="/capabilities";async function vLe(i,e="highest_confidence"){return Oe.get(`${xLe}?skill=${encodeURIComponent(i)}&strategy=${encodeURIComponent(e)}`)}async function git(){const i=await Oe.get(`${xLe}/skills`);return Array.isArray(i)?i:[]}function Hse(){return hn({queryKey:["capabilities","skills"],queryFn:git})}function fit(i,e){return hn({queryKey:["capabilities","search",i,e],queryFn:()=>vLe(i,e),enabled:!!i.trim()})}function pit(){const{data:i,isLoading:e,isError:t,refetch:n}=Hse(),s=k8e({queries:(i??[]).map(l=>({queryKey:["capabilities","search",l,"all"],queryFn:()=>vLe(l,"all"),enabled:!!i,staleTime:3e4}))}),r=(i??[]).map((l,c)=>{var u,h;return{skill:l,matches:((u=s[c])==null?void 0:u.data)??[],isLoading:((h=s[c])==null?void 0:h.isLoading)??!0}}),o=e||s.some(l=>l.isLoading),a=s.some(l=>l.isError);return{registry:r,isLoading:o,isError:t||a,refetchSkills:n,refetchMatches:()=>s.forEach(l=>{l.isError&&l.refetch()})}}function ls({label:i,defaultOpen:e=!0,icon:t,accent:n,variant:s="inline",children:r}){const[o,a]=L.useState(e);return s==="card"?d.jsxs("section",{className:"rounded-xl border bg-card shadow-sm",children:[d.jsxs("button",{type:"button",onClick:()=>a(!o),className:"flex w-full items-center gap-2 border-b border-border p-5 text-start",children:[o?d.jsx(Rn,{className:"h-4 w-4 text-muted-foreground"}):d.jsx(hs,{className:"h-4 w-4 text-muted-foreground"}),t&&d.jsx(t,{className:`h-5 w-5 ${n??"text-primary"}`}),d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:i})]}),o&&d.jsx("div",{className:"p-5 space-y-4",children:r})]}):d.jsxs("div",{children:[d.jsxs("button",{type:"button",onClick:()=>a(!o),className:"mb-1.5 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground hover:text-foreground transition-colors",children:[o?d.jsx(Rn,{className:"h-3 w-3"}):d.jsx(hs,{className:"h-3 w-3"}),t&&d.jsx(t,{className:`h-3.5 w-3.5 ${n??""}`}),i]}),o&&d.jsx("div",{className:"space-y-2",children:r})]})}const jG="vault:",FG="${vault:",BG="eddivault:",HG="${eddivault:";function jpe(i){return i.startsWith(jG)||i.startsWith(FG)||i.startsWith(BG)||i.startsWith(HG)}function mit(i){return i.startsWith(FG)?i.slice(FG.length,i.endsWith("}")?-1:void 0):i.startsWith(HG)?i.slice(HG.length,i.endsWith("}")?-1:void 0):i.startsWith(jG)?i.slice(jG.length):i.startsWith(BG)?i.slice(BG.length):i}function bit(i){const e=i.indexOf("/");return e>=0?i.slice(e+1):i}function xit(i){const e=i.indexOf("/");return e>=0?i.slice(0,e):void 0}function Fpe(i){return`\${vault:${i}}`}function vit({onClose:i,tenantId:e,onSuccess:t}){const{t:n}=xe(),[s,r]=L.useState(""),[o,a]=L.useState(""),[l,c]=L.useState(""),[u,h]=L.useState(!1),g=kEe(),f=L.useCallback(()=>{r(""),a(""),c(""),h(!1)},[]),m=L.useCallback(()=>{f(),i()},[f,i]),x=()=>{!s.trim()||!o.trim()||g.mutate({tenantId:e,keyName:s.trim(),value:o.trim(),description:l.trim()||void 0},{onSuccess:()=>{ze.success(n("secrets.storeSuccess",{key:s.trim(),defaultValue:`Secret "${s.trim()}" stored`}));const _=s.trim();f(),t(_),i()},onError:_=>ze.error(_ instanceof Error?_.message:String(_))})},v=d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:m,onKeyDown:_=>{_.key==="Escape"&&m()},children:d.jsxs("div",{className:"w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-2xl",onClick:_=>_.stopPropagation(),role:"dialog","aria-modal":"true",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:n("secrets.createTitle","Add Secret")}),d.jsx("button",{onClick:m,className:"rounded-lg p-1.5 text-muted-foreground hover:bg-muted transition-colors",children:d.jsx(An,{className:"h-4 w-4"})})]}),d.jsxs("div",{className:"mt-4 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:n("secrets.keyNameLabel","Key Name")}),d.jsx("input",{type:"text",value:s,onChange:_=>r(_.target.value),placeholder:n("secrets.keyNamePlaceholder","e.g. openaiKey"),className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-primary/50",autoFocus:!0,autoComplete:"off"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:n("secrets.valueLabel","Secret Value")}),d.jsxs("div",{className:"relative",children:[d.jsx("input",{type:u?"text":"password",value:o,onChange:_=>a(_.target.value),placeholder:n("secrets.valuePlaceholder","Enter secret value…"),className:"h-9 w-full rounded-lg border border-input bg-background pe-10 ps-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-primary/50",autoComplete:"off"}),d.jsx("button",{type:"button",onClick:()=>h(!u),className:"absolute inset-e-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:u?d.jsx(Sh,{className:"h-4 w-4"}):d.jsx(_b,{className:"h-4 w-4"})})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:n("secrets.descriptionLabel","Description (optional)")}),d.jsx("input",{type:"text",value:l,onChange:_=>c(_.target.value),className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-primary/50",autoComplete:"off"})]})]}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.jsx("button",{onClick:m,className:"rounded-lg px-4 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted",children:n("common.cancel","Cancel")}),d.jsxs("button",{onClick:x,disabled:!s.trim()||!o.trim()||g.isPending,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:[g.isPending?d.jsx(ni,{className:"h-4 w-4 animate-spin"}):null,n("secrets.store","Store Secret")]})]})]})});return hg.createPortal(v,document.body)}function _it({secrets:i,secretsLoading:e,vaultAvailable:t,filter:n,onFilterChange:s,highlightedIndex:r,onSelect:o,onCreate:a,onClose:l,vaultError:c}){const{t:u}=xe(),h=L.useRef(null),g=L.useRef(null);L.useEffect(()=>{const x=setTimeout(()=>{var v;return(v=h.current)==null?void 0:v.focus()},50);return()=>clearTimeout(x)},[]),L.useEffect(()=>{var v;if(r<0||!g.current)return;(v=g.current.querySelectorAll("[data-vault-item]")[r])==null||v.scrollIntoView({block:"nearest"})},[r]);const f=L.useMemo(()=>{if(!n.trim())return i;const x=n.toLowerCase();return i.filter(v=>v.keyName.toLowerCase().includes(x)||(v.description??"").toLowerCase().includes(x))},[i,n]),m=x=>{x.key==="Escape"?(x.preventDefault(),l()):x.key==="ArrowDown"||x.key==="ArrowUp"?x.preventDefault():x.key==="Enter"&&(x.preventDefault(),r>=0&&rs(x.target.value),placeholder:u("secretPicker.filterPlaceholder","Search vault keys…"),className:"h-6 flex-1 border-none bg-transparent text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none",autoComplete:"off","data-testid":"vault-popup-filter"})]}),d.jsx("div",{ref:g,className:"max-h-48 overflow-y-auto",children:t?e?d.jsxs("div",{className:"flex items-center justify-center gap-2 py-4 text-xs text-muted-foreground",children:[d.jsx(ni,{className:"h-3.5 w-3.5 animate-spin"}),u("secretPicker.loading","Loading keys…")]}):f.length===0?d.jsx("div",{className:"px-3 py-3 text-center text-xs text-muted-foreground",children:n.trim()?u("secretPicker.noMatch",'No keys matching "{{filter}}"',{filter:n}):u("secretPicker.emptyVault","No secrets stored yet")}):f.map((x,v)=>d.jsxs("button",{type:"button","data-vault-item":!0,onClick:()=>o(x.keyName),className:`flex w-full items-start gap-2 px-3 py-2 text-start text-xs transition-colors ${v===r?"bg-primary/10 text-foreground":"text-foreground hover:bg-secondary/50"}`,"data-testid":`vault-key-${x.keyName}`,children:[d.jsx(Uv,{className:"mt-0.5 h-3 w-3 shrink-0 text-amber-500"}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("span",{className:"block truncate font-mono font-medium",children:x.keyName}),x.description&&d.jsx("span",{className:"block truncate text-[10px] text-muted-foreground",children:x.description})]})]},x.keyName)):d.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 text-xs text-muted-foreground",children:[d.jsx(Vi,{className:"h-3.5 w-3.5 shrink-0 text-amber-500"}),d.jsx("span",{children:c||u("secretPicker.vaultDown","Vault is not configured — set up a secret provider in the EDDI backend")})]})}),t&&d.jsx("div",{className:"border-t border-border",children:d.jsxs("button",{type:"button",onClick:a,className:"flex w-full items-center gap-2 px-3 py-2 text-xs text-muted-foreground transition-colors hover:bg-secondary/50 hover:text-foreground","data-testid":"vault-popup-create",children:[d.jsx(Gt,{className:"h-3 w-3"}),u("secretPicker.createNew","Create new secret")]})})]})}function Rd({value:i,onChange:e,readOnly:t,tenantId:n="default",placeholder:s,testId:r="secret-key-picker"}){var Y;const{t:o}=xe(),[a,l]=L.useState(!1),[c,u]=L.useState(!1),[h,g]=L.useState(""),[f,m]=L.useState(-1),[x,v]=L.useState(!1),_=L.useRef(null),{data:w,isLoading:k}=SEe(n),{data:C}=Ise(),E=(C==null?void 0:C.available)!==!1,D=(C==null?void 0:C.reason)||(C==null?void 0:C.error),T=L.useMemo(()=>(w??[]).map(V=>({keyName:V.keyName,description:V.description})).sort((V,ue)=>V.keyName.localeCompare(ue.keyName)),[w]),I=L.useMemo(()=>new Set(T.map(V=>V.keyName)),[T]),R=jpe(i),P=R?mit(i):"",j=xit(P),B=j===void 0||j===n?bit(P):P,U=I.has(B),$=R?((Y=T.find(V=>V.keyName===B))==null?void 0:Y.description)??null:null,K=L.useMemo(()=>{if(!h.trim())return T;const V=h.toLowerCase();return T.filter(ue=>ue.keyName.toLowerCase().includes(V)||(ue.description??"").toLowerCase().includes(V))},[T,h]),z=L.useCallback(()=>{t||(g(""),m(-1),u(!0))},[t]),G=L.useCallback(()=>{u(!1),g(""),m(-1)},[]),ne=L.useCallback(V=>{e(Fpe(V)),G()},[e,G]),te=L.useCallback(()=>{t||e("")},[t,e]),H=L.useCallback(V=>{e(V),jpe(V)&&V.endsWith("}")&&G()},[e,G]),Q=L.useCallback(V=>{if(!c){V.key==="ArrowDown"&&E&&(V.preventDefault(),z());return}V.key==="Escape"?(V.preventDefault(),G()):V.key==="ArrowDown"?(V.preventDefault(),m(ue=>ueue>0?ue-1:K.length-1)):V.key==="Enter"&&(V.preventDefault(),f>=0&&f{if(!c)return;const V=ue=>{_.current&&!_.current.contains(ue.target)&&G()};return document.addEventListener("mousedown",V),()=>document.removeEventListener("mousedown",V)},[c,G]),R?d.jsx("div",{ref:_,className:"relative","data-testid":r,children:d.jsxs("div",{className:`flex h-7 items-center gap-1.5 rounded-md border px-2 ${t?"border-amber-500/30 bg-amber-500/5":"border-amber-500/50 bg-amber-500/10"}`,title:$?`${P} — ${$}`:P,children:[d.jsx(Uv,{className:"h-3 w-3 shrink-0 text-amber-600 dark:text-amber-400"}),d.jsx("span",{className:"flex-1 truncate font-mono text-xs font-medium text-amber-700 dark:text-amber-300",children:P}),!k&&!U&&P&&d.jsx("span",{title:o("secretPicker.keyNotFound","This key was not found in the vault"),children:d.jsx(Vi,{className:"h-3 w-3 shrink-0 text-amber-500"})}),!t&&d.jsx("button",{type:"button",onClick:te,className:"rounded p-0.5 text-amber-600/70 transition-colors hover:text-amber-700 dark:text-amber-400/70 dark:hover:text-amber-300","aria-label":o("secretPicker.clearVault","Clear vault reference"),"data-testid":`${r}-clear`,children:d.jsx(An,{className:"h-3 w-3"})})]})}):d.jsxs("div",{ref:_,className:"relative","data-testid":r,children:[d.jsxs("div",{className:"flex items-stretch",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx("input",{type:a?"text":"password",value:i,onChange:V=>H(V.target.value),onKeyDown:Q,readOnly:t,placeholder:s??o("secretPicker.placeholder","API key or ${vault:key-name}"),dir:"ltr",className:`h-7 w-full border border-input bg-background pe-14 ps-2 font-mono text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring ${E&&!t?"rounded-s-md rounded-e-none":"rounded-md"}`,"data-testid":`${r}-input`}),d.jsx("button",{type:"button",onClick:()=>l(V=>!V),disabled:t,className:"absolute inset-e-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",tabIndex:-1,"aria-label":a?"Hide":"Show",children:a?d.jsx(_b,{className:"h-3 w-3"}):d.jsx(Sh,{className:"h-3 w-3"})})]}),E&&!t&&d.jsxs("button",{type:"button",onClick:()=>c?G():z(),title:o("secretPicker.pickFromVault","Pick from vault"),className:`flex h-7 items-center gap-0.5 border border-s-0 border-input px-1.5 text-xs transition-colors ${c?"rounded-e-md bg-primary/10 text-primary":"rounded-e-md bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,"data-testid":`${r}-vault-btn`,children:[d.jsx(Uv,{className:"h-3 w-3"}),d.jsx(Rn,{className:`h-2.5 w-2.5 transition-transform ${c?"rotate-180":""}`})]})]}),c&&d.jsx(_it,{secrets:T,secretsLoading:k,vaultAvailable:E,filter:h,onFilterChange:V=>{g(V),m(-1)},highlightedIndex:f,onSelect:ne,onCreate:()=>{G(),v(!0)},onClose:G,vaultError:D}),x&&d.jsx(vit,{onClose:()=>v(!1),tenantId:n,onSuccess:V=>{e(Fpe(V))}})]})}function k4({value:i,onCommit:e,delay:t=600,...n}){const[s,r]=L.useState(i),o=L.useRef(null);L.useEffect(()=>r(i),[i]);const a=L.useCallback(l=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>e(l),t)},[e,t]);return L.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),d.jsx("input",{...n,value:s,onChange:l=>{r(l.target.value),a(l.target.value)}})}function um({value:i,onCommit:e,delay:t=600,fallback:n=0,...s}){const[r,o]=L.useState(String(i)),a=L.useRef(null);L.useEffect(()=>o(String(i)),[i]);const l=L.useCallback(c=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{e(parseFloat(c)||n)},t)},[e,t,n]);return L.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),d.jsx("input",{...s,type:"number",value:r,onChange:c=>{o(c.target.value),l(c.target.value)}})}const yit=["signInterAgentMessages","signMcpInvocations","requirePeerVerification"],wit=L.memo(function({agent:e,agentId:t,version:n}){var m,x,v,_,w,k,C,E;const{t:s}=xe(),r=wC(),[o,a]=L.useState(null),[l,c]=L.useState(null);L.useEffect(()=>{if(l){const D=setTimeout(()=>c(null),8e3);return()=>clearTimeout(D)}},[l]);const u=yit.some(D=>{var T;return(T=e.security)==null?void 0:T[D]});function h(D){var I;if(!(((I=e.security)==null?void 0:I[D])??!1)){a(D);return}g(D,!0)}function g(D,T){c(null),r.mutate({id:t,version:n,agent:{...e,security:{...e.security,[D]:!T}}},{onError:I=>{Iie(I)&&I.status===400?c(I.message):c(I instanceof Error?I.message:String(I))}})}function f(){o&&(g(o,!1),a(null))}return d.jsxs(ls,{label:s("agentDetail.securityIdentity","Security & Identity"),icon:bh,accent:"text-rose-500",variant:"card",defaultOpen:!!((m=e.security)!=null&&m.signInterAgentMessages||(x=e.security)!=null&&x.signMcpInvocations||(v=e.identity)!=null&&v.agentDid),children:[d.jsxs("div",{className:"space-y-3","data-testid":"identity-section",children:[d.jsxs("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(ME,{className:"h-3.5 w-3.5"}),s("agentDetail.identity","Cryptographic Identity")]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:s("agentDetail.agentDid","Agent DID")}),d.jsx(k4,{type:"text",value:((_=e.identity)==null?void 0:_.agentDid)??"",onCommit:D=>r.mutate({id:t,version:n,agent:{...e,identity:{...e.identity,agentDid:D||void 0}}}),placeholder:"did:eddi:agent:...",className:"h-8 w-full rounded-md border border-input bg-background px-2 text-xs text-foreground font-mono focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:s("agentDetail.publicKey","Public Key")}),d.jsx("input",{type:"text",value:((w=e.identity)==null?void 0:w.publicKey)??"",readOnly:!0,placeholder:s("agentDetail.publicKeyHint","Auto-generated on first signing"),className:"h-8 w-full rounded-md border border-input bg-muted/50 px-2 text-xs text-muted-foreground font-mono"})]})]}),(((C=(k=e.identity)==null?void 0:k.keys)==null?void 0:C.length)??0)>0?d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:s("agentDetail.publicKeys","Public Keys")}),d.jsx("div",{className:"space-y-1",children:e.identity.keys.map((D,T)=>d.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted/30 px-2.5 py-1.5",children:[d.jsx("span",{className:"inline-flex items-center rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-semibold text-primary",children:s("agentDetail.keyVersion","Key v{{version}}",{version:D.version??T})}),d.jsx("span",{className:"flex-1 truncate font-mono text-[10px] text-muted-foreground",dir:"ltr",children:D.publicKeyB64?`${D.publicKeyB64.slice(0,24)}…`:"—"}),D.validUntilMs!=null&&D.validUntilMs>0&&D.validUntilMs{var R;return d.jsxs("label",{className:"flex items-start gap-2.5 py-1",children:[d.jsx("input",{type:"checkbox",checked:((R=e.security)==null?void 0:R[D])??!1,onChange:()=>h(D),disabled:r.isPending,className:"mt-0.5 h-3.5 w-3.5 rounded border-input accent-primary"}),d.jsxs("div",{children:[d.jsx("span",{className:"text-xs font-medium text-foreground",children:T}),d.jsx("p",{className:"text-[10px] text-muted-foreground",children:I})]})]},D)})]}),d.jsx(sl,{open:!!o,onOpenChange:D=>{D||a(null)},title:s("agentDetail.securityFlagConfirmTitle","Enable security flag?"),description:s("agentDetail.securityFlagConfirmDesc","Cryptographic signing is not yet available in this version. Enabling this flag will cause the backend to reject saves with HTTP 400. Are you sure you want to proceed?"),confirmLabel:s("agentDetail.securityFlagConfirmBtn","Enable anyway"),cancelLabel:s("common.cancel","Cancel"),onConfirm:f})]})}),Cit=pke;function Sit({value:i,onChange:e,onSelect:t,placeholder:n}){const{data:s}=Hse(),[r,o]=L.useState(!1),[a,l]=L.useState(-1),c=L.useRef(null),u=L.useMemo(()=>{if(!s||!i.trim())return[];const g=i.trim().toLowerCase();return s.filter(f=>f.toLowerCase().includes(g))},[s,i]);L.useEffect(()=>{function g(f){c.current&&!c.current.contains(f.target)&&o(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]);function h(g){g.key==="ArrowDown"?(g.preventDefault(),l(f=>Math.min(f+1,u.length-1)),o(!0)):g.key==="ArrowUp"?(g.preventDefault(),l(f=>Math.max(f-1,0))):g.key==="Enter"?(g.preventDefault(),a>=0&&a{e(g.target.value),o(!0),l(-1)},onFocus:()=>{i.trim()&&o(!0)},onKeyDown:h,placeholder:n,className:"h-8 w-full rounded-md border border-input bg-background ps-7 pe-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"skill-autocomplete-input",autoComplete:"off"}),r&&u.length>0&&d.jsx("div",{className:"absolute z-50 mt-1 max-h-40 w-full overflow-auto rounded-lg border border-border bg-card shadow-lg","data-testid":"skill-autocomplete-dropdown",children:u.map((g,f)=>d.jsx("button",{type:"button",onMouseDown:m=>{m.preventDefault(),t(g),o(!1)},onMouseEnter:()=>l(f),className:`w-full px-3 py-1.5 text-start text-xs transition-colors ${f===a?"bg-primary/10 text-primary":"text-foreground hover:bg-secondary"}`,children:g},g))})]})}function kit({attributes:i,onChange:e,disabled:t}){const{t:n}=xe(),s=Object.entries(i),[r,o]=L.useState(""),[a,l]=L.useState(""),c=L.useRef(i);L.useEffect(()=>{c.current=i},[i]);const u=L.useRef(null);L.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);function h(){r.trim()&&(e({...c.current,[r.trim()]:a.trim()}),o(""),l(""))}function g(m){u.current&&(clearTimeout(u.current),u.current=null);const x={...c.current};delete x[m],e(x)}function f(m,x){u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{e({...c.current,[m]:x})},600)}return d.jsxs("div",{className:"space-y-1.5 ps-3 border-s-2 border-violet-500/20",children:[s.map(([m,x])=>d.jsx(Nit,{attrKey:m,attrValue:x,onCommit:v=>f(m,v),onRemove:()=>g(m),disabled:t},m)),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("input",{type:"text",value:r,onChange:m=>o(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),h())},placeholder:n("agentDetail.attributeKey","key"),disabled:t,className:"h-6 w-20 rounded border border-input bg-background px-1.5 text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-50","data-testid":"attribute-key-input"}),d.jsx("input",{type:"text",value:a,onChange:m=>l(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),h())},placeholder:n("agentDetail.attributeValue","value"),disabled:t,className:"h-6 flex-1 rounded border border-input bg-background px-1.5 text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-50","data-testid":"attribute-value-input"}),d.jsx("button",{type:"button",onClick:h,disabled:!r.trim()||t,className:"rounded p-0.5 text-muted-foreground hover:text-primary transition-colors disabled:opacity-50",title:n("agentDetail.addAttribute","Add attribute"),children:d.jsx(Gt,{className:"h-3 w-3"})})]})]})}function Nit({attrKey:i,attrValue:e,onCommit:t,onRemove:n,disabled:s}){const[r,o]=L.useState(e),a=L.useRef(null);L.useEffect(()=>o(e),[e]),L.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);function l(c){o(c),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>t(c),600)}return d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"shrink-0 rounded bg-violet-500/10 px-1.5 py-0.5 text-[10px] font-medium text-violet-600 dark:text-violet-400",children:i}),d.jsx("input",{type:"text",value:r,onChange:c=>l(c.target.value),disabled:s,className:"h-6 flex-1 rounded border border-input bg-background px-1.5 text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-50"}),d.jsx("button",{type:"button",onClick:n,disabled:s,className:"rounded p-0.5 text-muted-foreground hover:text-destructive transition-colors disabled:opacity-50",children:d.jsx(An,{className:"h-3 w-3"})})]})}const Eit=L.memo(function({agent:e,agentId:t,version:n}){const{t:s}=xe(),r=wC(),[o,a]=L.useState(""),[l,c]=L.useState(null),u=e.capabilities??[];function h(x){if(!x.trim())return;if(u.some(_=>_.skill===x.trim())){ze.error(s("agentDetail.skillAlreadyExists","This skill is already declared"));return}const v=[...u,{skill:x.trim(),confidence:"medium",attributes:{}}];r.mutate({id:t,version:n,agent:{...e,capabilities:v}}),a("")}function g(x){const v=u.filter((_,w)=>w!==x);r.mutate({id:t,version:n,agent:{...e,capabilities:v}}),l===x&&c(null)}function f(x,v){const _=u.map((w,k)=>k===x?{...w,confidence:v}:w);r.mutate({id:t,version:n,agent:{...e,capabilities:_}})}function m(x,v){const _=u.map((w,k)=>k===x?{...w,attributes:v}:w);r.mutate({id:t,version:n,agent:{...e,capabilities:_}})}return d.jsx(ls,{label:s("agentDetail.capabilities","Capabilities"),icon:Ll,accent:"text-violet-500",variant:"card",defaultOpen:u.length>0,children:d.jsxs("div",{className:"space-y-3","data-testid":"capabilities-section",children:[d.jsx("p",{className:"text-[10px] text-muted-foreground",children:s("agentDetail.capabilitiesDesc","Declared skills for A2A agent card and capability registry. Other agents discover these when choosing delegation targets.")}),u.length>0&&d.jsx("div",{className:"space-y-2",children:u.map((x,v)=>d.jsxs("div",{className:"rounded-lg border border-border bg-background overflow-hidden","data-testid":`capability-entry-${v}`,children:[d.jsxs("div",{className:"flex items-center gap-2 p-2.5",children:[d.jsx("button",{type:"button",onClick:()=>c(l===v?null:v),className:"text-muted-foreground hover:text-foreground transition-colors",title:s("agentDetail.toggleAttributes","Toggle attributes"),children:d.jsx(Ll,{className:"h-3.5 w-3.5 text-violet-500"})}),d.jsx("span",{className:"flex-1 text-xs font-medium text-foreground",children:x.skill}),d.jsxs("select",{value:x.confidence??"medium",onChange:_=>f(v,_.target.value),className:`h-7 rounded-full border px-2 text-[10px] font-semibold focus:outline-none focus:ring-1 focus:ring-ring ${Cit[x.confidence??"medium"]??""}`,"data-testid":`confidence-select-${v}`,children:[d.jsx("option",{value:"low",children:s("agentDetail.confidenceLow","Low")}),d.jsx("option",{value:"medium",children:s("agentDetail.confidenceMedium","Medium")}),d.jsx("option",{value:"high",children:s("agentDetail.confidenceHigh","High")})]}),x.attributes&&Object.keys(x.attributes).length>0&&d.jsxs("button",{type:"button",onClick:()=>c(l===v?null:v),className:"rounded-full bg-violet-500/10 px-1.5 py-0.5 text-[9px] font-medium text-violet-600 dark:text-violet-400 hover:bg-violet-500/20 transition-colors",children:[Object.keys(x.attributes).length," ",s("agentDetail.attrs","attrs")]}),d.jsx("button",{type:"button",onClick:()=>g(v),disabled:r.isPending,className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3.5 w-3.5"})})]}),l===v&&d.jsxs("div",{className:"border-t border-border bg-violet-500/[0.02] px-3 py-2.5",children:[d.jsx("p",{className:"mb-1.5 text-[10px] font-medium text-muted-foreground",children:s("agentDetail.attributesLabel","Attributes")}),d.jsx(kit,{attributes:x.attributes??{},onChange:_=>m(v,_),disabled:r.isPending})]})]},`${x.skill}-${v}`))}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx(Sit,{value:o,onChange:a,onSelect:h,placeholder:s("agentDetail.capabilityPlaceholder","Search or type a skill name...")}),d.jsx("button",{type:"button",onClick:()=>h(o),disabled:!o.trim()||r.isPending,className:"inline-flex h-8 items-center gap-1 rounded-md border border-input px-2 text-xs font-medium text-foreground transition-colors hover:bg-secondary disabled:opacity-50","data-testid":"add-capability-btn",children:d.jsx(Gt,{className:"h-3 w-3"})})]})]})})}),Lit=L.memo(function({agent:e,agentId:t,version:n}){const{t:s}=xe(),r=wC(),o=e.enableMemoryTools??!1,a=e.userMemoryConfig??{},l=a.dream??{},c=a.guardrails??{};function u(m){r.mutate({id:t,version:n,agent:{...e,...m}})}function h(m){u({userMemoryConfig:{...a,...m}})}function g(m){h({dream:{...l,...m}})}function f(m){h({guardrails:{...c,...m}})}return d.jsx(ls,{label:s("agentDetail.userMemory","User Memory"),icon:Nl,accent:"text-teal-500",variant:"card",defaultOpen:o,children:d.jsxs("div",{className:"space-y-4","data-testid":"user-memory-section",children:[d.jsx("p",{className:"text-[10px] text-muted-foreground leading-relaxed",children:s("agentDetail.userMemoryDesc","Persistent per-user memory with LLM tools (remember/recall/forget). Basic longTerm property persistence always works regardless of this toggle.")}),d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs font-medium text-foreground",children:[d.jsx("input",{type:"checkbox",checked:o,onChange:()=>u({enableMemoryTools:!o}),disabled:r.isPending,className:"h-3.5 w-3.5 rounded border-input accent-primary"}),d.jsx(Nl,{className:"h-3.5 w-3.5 text-teal-500"}),s("agentDetail.enableMemoryTools","Enable Memory Tools")]}),o&&d.jsxs("div",{className:"space-y-4 rounded-lg border border-teal-500/20 bg-teal-500/5 p-4",children:[d.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("agentDetail.defaultVisibility","Default Visibility")}),d.jsxs("select",{value:a.defaultVisibility??"self",onChange:m=>h({defaultVisibility:m.target.value}),className:"h-7 w-full rounded border border-input bg-background px-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:[d.jsx("option",{value:"self",children:s("agentDetail.visibilitySelf","self")}),d.jsx("option",{value:"global",children:s("agentDetail.visibilityGlobal","global")})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("agentDetail.maxRecallEntries","Max Recall")}),d.jsx(um,{value:a.maxRecallEntries??50,onCommit:m=>h({maxRecallEntries:m}),fallback:50,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("agentDetail.maxEntriesPerUser","Max per User")}),d.jsx(um,{value:a.maxEntriesPerUser??500,onCommit:m=>h({maxEntriesPerUser:m}),fallback:500,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("agentDetail.onCapReached","On Cap Reached")}),d.jsxs("select",{value:a.onCapReached??"evict_oldest",onChange:m=>h({onCapReached:m.target.value}),className:"h-7 w-full rounded border border-input bg-background px-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:[d.jsx("option",{value:"evict_oldest",children:s("agentDetail.onCapEvict","Evict Oldest")}),d.jsx("option",{value:"reject",children:s("agentDetail.onCapReject","Reject")})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("agentDetail.recallOrder","Recall Order")}),d.jsxs("select",{value:a.recallOrder??"most_recent",onChange:m=>h({recallOrder:m.target.value}),className:"h-7 w-full rounded border border-input bg-background px-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:[d.jsx("option",{value:"most_recent",children:s("agentDetail.recallMostRecent","Most Recent")}),d.jsx("option",{value:"most_relevant",children:s("agentDetail.recallMostRelevant","Most Relevant")})]})]})]}),d.jsxs("div",{className:"space-y-2 border-t border-teal-500/20 pt-3",children:[d.jsx("h4",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:s("agentDetail.guardrails","Write Guardrails")}),d.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("agentDetail.maxKeyLength","Max Key Length")}),d.jsx(um,{value:c.maxKeyLength??100,onCommit:m=>f({maxKeyLength:m}),fallback:100,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("agentDetail.maxValueLength","Max Value Length")}),d.jsx(um,{value:c.maxValueLength??1e3,onCommit:m=>f({maxValueLength:m}),fallback:1e3,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("agentDetail.maxWritesPerTurn","Max Writes/Turn")}),d.jsx(um,{value:c.maxWritesPerTurn??10,onCommit:m=>f({maxWritesPerTurn:m}),fallback:10,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]})]}),d.jsxs("div",{className:"space-y-2 border-t border-teal-500/20 pt-3",children:[d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs font-medium text-foreground",children:[d.jsx("input",{type:"checkbox",checked:l.enabled??!1,onChange:()=>g({enabled:!(l.enabled??!1)}),disabled:r.isPending,className:"h-3.5 w-3.5 rounded border-input accent-primary"}),d.jsx(HSe,{className:"h-3.5 w-3.5 text-indigo-400"}),s("agentDetail.dreamConsolidation","Dream Consolidation")]}),d.jsx("p",{className:"text-[10px] text-muted-foreground ps-5",children:s("agentDetail.dreamDesc","Background LLM job that resolves contradictions, prunes stale entries, and optionally summarizes interactions.")}),l.enabled&&d.jsxs("div",{className:"space-y-3 ps-5",children:[d.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("agentDetail.dreamSchedule","Schedule (cron)")}),d.jsx(k4,{type:"text",value:l.schedule??"0 3 * * *",onCommit:m=>g({schedule:m}),placeholder:"0 3 * * *",className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground font-mono focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("agentDetail.dreamLlmProvider","LLM Provider")}),d.jsx(k4,{type:"text",value:l.llmProvider??"anthropic",onCommit:m=>g({llmProvider:m}),className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("agentDetail.dreamLlmModel","LLM Model")}),d.jsx(k4,{type:"text",value:l.llmModel??"claude-sonnet-4-6",onCommit:m=>g({llmModel:m}),placeholder:"claude-sonnet-4-6",className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground font-mono focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("agentDetail.dreamMaxCost","Max Cost/Run ($)")}),d.jsx(um,{value:l.maxCostPerRun??5,onCommit:m=>g({maxCostPerRun:m}),fallback:5,step:.01,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("agentDetail.dreamPruneDays","Prune After (days)")}),d.jsx(um,{value:l.pruneStaleAfterDays??90,onCommit:m=>g({pruneStaleAfterDays:m}),fallback:90,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("agentDetail.dreamBatchSize","Batch Size")}),d.jsx(um,{value:l.batchSize??50,onCommit:m=>g({batchSize:m}),fallback:50,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),d.jsxs("div",{className:"flex gap-4",children:[d.jsxs("label",{className:"inline-flex items-center gap-1.5 text-xs text-foreground",children:[d.jsx("input",{type:"checkbox",checked:l.detectContradictions??!0,onChange:m=>g({detectContradictions:m.target.checked}),className:"h-3.5 w-3.5 rounded border-input accent-primary"}),s("agentDetail.detectContradictions","Detect contradictions")]}),d.jsxs("label",{className:"inline-flex items-center gap-1.5 text-xs text-foreground",children:[d.jsx("input",{type:"checkbox",checked:l.summarizeInteractions??!1,onChange:m=>g({summarizeInteractions:m.target.checked}),className:"h-3.5 w-3.5 rounded border-input accent-primary"}),s("agentDetail.summarizeInteractions","Summarize interactions")]})]})]})]})]})]})})}),Dit=L.memo(function({agent:e,agentId:t,version:n}){const{t:s}=xe(),r=wC(),o=e.memoryPolicy??{},a=o.strictWriteDiscipline??{},l=a.enabled??!1;function c(u){r.mutate({id:t,version:n,agent:{...e,memoryPolicy:{...o,strictWriteDiscipline:{...a,...u}}}})}return d.jsx(ls,{label:s("agentDetail.memoryPolicy","Memory Policy"),icon:Uge,accent:"text-rose-500",variant:"card",defaultOpen:l,children:d.jsxs("div",{className:"space-y-3","data-testid":"memory-policy-section",children:[d.jsx("p",{className:"text-[10px] text-muted-foreground leading-relaxed",children:s("agentDetail.memoryPolicyDesc","Strict Write Discipline governs what happens when property updates fail during a conversation step. Choose how the engine handles partially committed data.")}),d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs font-medium text-foreground",children:[d.jsx("input",{type:"checkbox",checked:l,onChange:()=>c({enabled:!l}),disabled:r.isPending,className:"h-3.5 w-3.5 rounded border-input accent-primary","data-testid":"swd-enable"}),d.jsx(Uge,{className:"h-3.5 w-3.5 text-rose-500"}),s("agentDetail.enableSwd","Enable Strict Write Discipline")]}),l&&d.jsx("div",{className:"space-y-3 rounded-lg border border-rose-500/20 bg-rose-500/5 p-3",children:d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:s("agentDetail.onFailure","On Failure Strategy")}),d.jsxs("select",{value:a.onFailure??"digest",onChange:u=>c({onFailure:u.target.value}),disabled:r.isPending,className:"h-8 w-full rounded-md border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60","data-testid":"swd-on-failure",children:[d.jsx("option",{value:"digest",children:s("agentDetail.onFailureDigest","Digest — rollback changes, report summary to LLM")}),d.jsx("option",{value:"exclude_all",children:s("agentDetail.onFailureExclude","Exclude All — silently drop all property updates")}),d.jsx("option",{value:"keep_all",children:s("agentDetail.onFailureKeep","Keep All — keep changes and log warning")})]})]})})]})})}),Tit=["before_tool","before_action"],Iit=L.memo(function({agent:e,agentId:t,version:n}){const{t:s}=xe(),r=wC(),o=e.sessionManagement??{},a=o.autoSnapshot??{};function l(u){r.mutate({id:t,version:n,agent:{...e,sessionManagement:{...o,...u}}})}function c(u){l({autoSnapshot:{...a,...u}})}return d.jsx(ls,{label:s("agentDetail.sessionManagement","Session Management"),icon:ME,accent:"text-teal-500",variant:"card",defaultOpen:a.enabled??!1,children:d.jsxs("div",{className:"space-y-4","data-testid":"session-management-section",children:[d.jsx("p",{className:"text-[10px] text-muted-foreground leading-relaxed",children:s("agentDetail.sessionManagementDesc","Memory checkpoints capture conversation state before risky operations, enabling clean rollback on failure.")}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs font-medium text-foreground",children:[d.jsx("input",{type:"checkbox",checked:a.enabled??!1,onChange:()=>c({enabled:!(a.enabled??!1)}),disabled:r.isPending,className:"h-3.5 w-3.5 rounded border-input accent-primary","data-testid":"auto-snapshot-enabled"}),s("agentDetail.autoSnapshotEnable","Enable automatic checkpoints")]}),a.enabled&&d.jsxs("div",{className:"space-y-3 ps-5",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1.5 block text-[10px] text-muted-foreground",children:s("agentDetail.triggerOn","Trigger On")}),d.jsx("div",{className:"flex flex-wrap gap-2",children:Tit.map(u=>{const h=(a.triggerOn??[]).includes(u);return d.jsx("button",{type:"button",onClick:()=>{const g=a.triggerOn??[],f=h?g.filter(m=>m!==u):[...g,u];c({triggerOn:f.length>0?f:void 0})},disabled:r.isPending,className:`inline-flex items-center gap-1 rounded-md border px-2.5 py-1 text-[10px] font-medium transition-colors ${h?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30"}`,children:u==="before_tool"?s("agentDetail.triggerBeforeTool","Before tool execution"):s("agentDetail.triggerBeforeAction","Before action")},u)})})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("label",{className:"text-xs text-foreground whitespace-nowrap",children:s("agentDetail.maxCheckpoints","Max Checkpoints")}),d.jsx(um,{value:o.maxCheckpointsPerConversation??10,onCommit:u=>l({maxCheckpointsPerConversation:u}),min:1,max:100,className:"h-7 w-20 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:s("agentDetail.maxCheckpointsHint","per conversation")})]})]})]}),d.jsxs("div",{className:"border-t border-border pt-3 space-y-2",children:[d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-not-allowed",title:s("agentDetail.forkingDisabledTooltip","Available in a future release"),children:[d.jsx("input",{type:"checkbox",checked:o.forkingEnabled??!1,disabled:!0,className:"h-3.5 w-3.5 rounded border-input accent-primary opacity-50","data-testid":"forking-enabled"}),s("agentDetail.forkingEnabled","Session Forking"),d.jsxs("span",{className:"text-[9px] font-normal text-muted-foreground/70",children:["(",s("agentDetail.comingSoon","coming soon"),")"]})]}),d.jsx("p",{className:"text-[10px] text-muted-foreground ps-5",children:s("agentDetail.forkingNote","Session forking endpoint (POST /v6/conversations/{id}/fork) is not yet available.")}),d.jsxs("div",{className:"flex items-center gap-2 ps-5 opacity-50 cursor-not-allowed",children:[d.jsx("label",{className:"text-xs text-foreground whitespace-nowrap",children:s("agentDetail.maxForks","Max Forks")}),d.jsx("input",{type:"number",value:o.maxForksPerConversation??5,disabled:!0,className:"h-7 w-20 rounded border border-input bg-muted/50 px-2 text-xs text-muted-foreground",title:s("agentDetail.forkingDisabledTooltip","Available in a future release")}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:s("agentDetail.maxForksHint","per conversation")})]})]})]})})});function Ait(){return typeof window<"u"?`${window.location.origin}/integrations/slack/events`:""}function Rit(){const{t:i}=xe(),[e,t]=L.useState(!1),n=Ait(),[s,r]=L.useState(!1);function o(){navigator.clipboard.writeText(n).then(()=>{r(!0),ze.success(i("agentDetail.slackWebhookCopied","Webhook URL copied")),setTimeout(()=>r(!1),2e3)}).catch(()=>{ze.error(i("common.copyFailed","Failed to copy to clipboard"))})}return d.jsxs("div",{className:"rounded-lg border border-indigo-500/20 bg-indigo-500/5",children:[d.jsxs("button",{type:"button",onClick:()=>t(!e),className:"flex w-full items-center gap-2 px-4 py-2.5 text-start",children:[d.jsx(L7e,{className:"h-4 w-4 text-indigo-500 shrink-0"}),d.jsx("span",{className:"flex-1 text-xs font-semibold text-indigo-600 dark:text-indigo-400",children:i("agentDetail.slackSetupGuide","Slack Setup Guide")}),d.jsx(vb,{className:`h-3.5 w-3.5 text-indigo-500/50 transition-transform ${e?"rotate-180":""}`})]}),e&&d.jsxs("div",{className:"space-y-4 border-t border-indigo-500/20 px-4 py-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("agentDetail.slackWebhookUrl","Webhook URL")}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("code",{className:"flex-1 rounded-md border border-input bg-background px-2.5 py-1.5 font-mono text-xs text-foreground break-all",children:n}),d.jsx("button",{type:"button",onClick:o,className:"shrink-0 rounded-md border border-input p-1.5 text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors",title:i("common.copy","Copy"),children:s?d.jsx(Ns,{className:"h-3.5 w-3.5 text-emerald-500"}):d.jsx(mo,{className:"h-3.5 w-3.5"})})]})]}),d.jsxs("ol",{className:"space-y-1.5 text-xs text-muted-foreground",children:[d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-indigo-500/10 text-[10px] font-bold text-indigo-500",children:"1"}),i("agentDetail.slackStep1","Create a Slack App at api.slack.com/apps and install it to your workspace.")]}),d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-indigo-500/10 text-[10px] font-bold text-indigo-500",children:"2"}),i("agentDetail.slackStep2","Copy the Bot Token (xoxb-…) and Signing Secret into the EDDI vault and configure channels below.")]}),d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-indigo-500/10 text-[10px] font-bold text-indigo-500",children:"3"}),d.jsxs("span",{children:[i("agentDetail.slackStep3","Then enable Event Subscriptions in your Slack App, paste the Webhook URL above, and subscribe to:"),d.jsx("code",{className:"ms-1 rounded bg-muted px-1 py-0.5 font-mono text-[10px]",children:"app_mention"}),","," ",d.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[10px]",children:"message.im"})]})]})]}),d.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-relaxed",children:i("agentDetail.slackSetupNote","Important: Configure the channel below before enabling Event Subscriptions — Slack sends a URL verification challenge that requires the signing secret to be configured in EDDI.")}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("agentDetail.slackRequiredScopes","Required Bot Token Scopes")}),d.jsx("div",{className:"flex flex-wrap gap-1",children:["app_mentions:read","chat:write","channels:history","groups:history","im:history","mpim:history"].map(a=>d.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:a},a))})]})]})]})}function Mit({channel:i,index:e,onUpdate:t,onRemove:n,disabled:s}){const{t:r}=xe(),o=L.useMemo(()=>i.config??{},[i.config]),a=L.useRef(o);L.useEffect(()=>{a.current=o},[o]);const[l,c]=L.useState(o.channelId??""),[u,h]=L.useState(o.groupId??""),[g,f]=L.useState(!1),m=L.useRef(null),x=L.useRef(null);L.useEffect(()=>c(o.channelId??""),[o.channelId]),L.useEffect(()=>h(o.groupId??""),[o.groupId]),L.useEffect(()=>()=>{m.current&&clearTimeout(m.current),x.current&&clearTimeout(x.current)},[]);function v(C){m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{t(e,{...a.current,channelId:C})},600)}function _(C){x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{if(C.trim())t(e,{...a.current,groupId:C});else{const{groupId:E,...D}=a.current;t(e,D)}},600)}function w(C,E){t(e,{...a.current,[C]:E})}const k=!l||/^C[A-Z0-9]+$/.test(l);return d.jsxs("div",{className:"rounded-lg border border-border bg-background","data-testid":`slack-channel-${e}`,children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-2.5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Zf,{className:"h-4 w-4 text-indigo-500"}),d.jsx("span",{className:"text-xs font-semibold text-foreground",children:r("agentDetail.slackChannel","Slack Channel")}),l&&d.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:l})]}),d.jsx("button",{type:"button",onClick:()=>f(!0),disabled:s,className:"rounded p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors disabled:opacity-50",title:r("agentDetail.removeChannel","Remove channel"),"data-testid":`remove-channel-${e}`,children:d.jsx(_n,{className:"h-3.5 w-3.5"})})]}),d.jsxs("div",{className:"space-y-3 p-4",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"mb-1 block text-[10px] font-medium text-muted-foreground",children:[r("agentDetail.channelId","Channel ID")," ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsx("input",{type:"text",value:l,onChange:C=>{const E=C.target.value;c(E),v(E)},disabled:s,placeholder:"C0123ABCDEF",className:`h-8 w-full rounded-md border bg-background px-2.5 font-mono text-xs text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60 ${k?"border-input":"border-amber-500"}`,"data-testid":`channel-id-${e}`}),!k&&d.jsx("p",{className:"mt-0.5 text-[10px] text-amber-600 dark:text-amber-400",children:r("agentDetail.channelIdHint","Channel IDs start with C followed by uppercase alphanumeric characters")})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"mb-1 block text-[10px] font-medium text-muted-foreground",children:[r("agentDetail.botToken","Bot Token")," ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsx(Rd,{value:o.botToken??"",onChange:C=>w("botToken",C),readOnly:s,placeholder:r("agentDetail.botTokenPlaceholder","xoxb-… or ${vault:slack-bot-token}"),testId:`bot-token-${e}`}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground/70",children:r("agentDetail.botTokenHint","Slack Bot User OAuth Token. Use a vault reference for security.")})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"mb-1 block text-[10px] font-medium text-muted-foreground",children:[r("agentDetail.signingSecret","Signing Secret")," ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsx(Rd,{value:o.signingSecret??"",onChange:C=>w("signingSecret",C),readOnly:s,placeholder:r("agentDetail.signingSecretPlaceholder","Hex string or ${vault:slack-signing-secret}"),testId:`signing-secret-${e}`}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground/70",children:r("agentDetail.signingSecretHint","From your Slack App's Basic Information page. Use a vault reference for security.")})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] font-medium text-muted-foreground",children:r("agentDetail.groupIdOptional","Group ID (optional)")}),d.jsx("input",{type:"text",value:u,onChange:C=>{const E=C.target.value;h(E),_(E)},disabled:s,placeholder:r("agentDetail.groupIdPlaceholder","Multi-agent group config ID"),className:"h-8 w-full rounded-md border border-input bg-background px-2.5 font-mono text-xs text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60","data-testid":`group-id-${e}`}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground/70",children:r("agentDetail.groupIdHint",'Set this to enable "group: question" multi-agent discussions from this Slack channel.')})]})]}),d.jsx(sl,{open:g,onOpenChange:f,title:r("agentDetail.removeChannelConfirm","Remove this Slack channel connector?"),description:r("agentDetail.removeChannelDesc","This action will permanently disconnect this channel."),confirmLabel:r("common.delete","Delete"),cancelLabel:r("common.cancel","Cancel"),onConfirm:()=>{n(e),f(!1)},isPending:s})]})}const Pit=L.memo(function({agent:e,agentId:t,version:n}){const{t:s}=xe(),r=wC(),o=e.channels??[],a=o.filter(g=>g.type==="slack"),l=a.length>0;function c(){const g={type:"slack",config:{channelId:"",botToken:"",signingSecret:""}};r.mutate({id:t,version:n,agent:{...e,channels:[...o,g]}})}function u(g,f){let m=0;const x=o.map(v=>{if(v.type==="slack"){if(m===g)return m++,{...v,config:f};m++}return v});r.mutate({id:t,version:n,agent:{...e,channels:x}})}function h(g){let f=0;const m=o.filter(x=>{if(x.type==="slack"){if(f===g)return f++,!1;f++}return!0});r.mutate({id:t,version:n,agent:{...e,channels:m}})}return d.jsx(ls,{label:s("agentDetail.channels","Channel Connectors"),icon:vb,accent:"text-indigo-500",variant:"card",defaultOpen:l,children:d.jsxs("div",{className:"space-y-4","data-testid":"channels-section",children:[d.jsx(Rit,{}),d.jsx("p",{className:"text-[10px] text-muted-foreground leading-relaxed",children:s("agentDetail.channelsDesc","Connect this agent to Slack channels. Each channel connector is independently configured with its own credentials, supporting multi-workspace setups.")}),!l&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed border-border py-8 text-center",children:[d.jsx(vb,{className:"h-8 w-8 text-muted-foreground/30"}),d.jsx("p",{className:"mt-2 text-sm font-medium text-muted-foreground",children:s("agentDetail.noChannels","No channels configured")}),d.jsx("p",{className:"mt-0.5 max-w-xs text-xs text-muted-foreground/70",children:s("agentDetail.noChannelsDesc","Add a Slack channel to let users interact with this agent from Slack.")})]}),a.map((g,f)=>d.jsx(Mit,{channel:g,index:f,onUpdate:u,onRemove:h,disabled:r.isPending},`slack-chan-${f}`)),d.jsxs("button",{type:"button",onClick:c,disabled:r.isPending,className:"inline-flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-indigo-500/30 bg-indigo-500/5 px-4 py-2.5 text-xs font-medium text-indigo-600 transition-colors hover:bg-indigo-500/10 hover:border-indigo-500/50 disabled:opacity-50 dark:text-indigo-400","data-testid":"add-slack-channel-btn",children:[d.jsx(Gt,{className:"h-3.5 w-3.5"}),s("agentDetail.addSlackChannel","Add Slack Channel")]})]})})}),_Le={READY:{icon:Ih,color:"text-emerald-500",bg:"bg-emerald-500/10"},IN_PROGRESS:{icon:Zr,color:"text-amber-500",bg:"bg-amber-500/10"},ERROR:{icon:Vi,color:"text-destructive",bg:"bg-destructive/10"},NOT_FOUND:{icon:qSe,color:"text-muted-foreground",bg:"bg-muted"}},Oit={production:"agentDetail.envProduction",test:"agentDetail.envTest"};function jit(){var Ke,ht,Ct,Ft,Ve;const{id:i}=K_(),{t:e}=xe(),t=il(),n=cn(),[s,r]=L.useState(void 0),[o,a]=L.useState(!1),[l,c]=L.useState(null),[u,h]=L.useState(!1),[g,f]=L.useState(!1);L.useEffect(()=>{r(void 0)},[i]);const{data:m}=bEe(i),x=s??((Ke=m==null?void 0:m[0])==null?void 0:Ke.version)??1,{data:v,isLoading:_,isError:w,refetch:k}=GJe(i,x),{data:C}=mEe(i,x),{data:E}=YJe(i,x),D=_Ee(),T=yEe(),I=xEe(),R=vEe(),P=uit(),j=BM(),B=(C==null?void 0:C.status)??"NOT_FOUND",U=_Le[B],$=U.icon,z={READY:e("status.deployed","Deployed"),IN_PROGRESS:e("status.deploying","Deploying..."),ERROR:e("status.error","Error"),NOT_FOUND:e("status.notDeployed","Not deployed")}[B]??B,G=B==="READY",ne=D.isPending||T.isPending||B==="IN_PROGRESS",te=L.useMemo(()=>((v==null?void 0:v.workflows)??[]).filter(tt=>tt.includes("://")),[v==null?void 0:v.workflows]),{data:H}=bLe(te);L.useEffect(()=>{if(l){const tt=setTimeout(()=>c(null),3e3);return()=>clearTimeout(tt)}},[l]);function Q(){D.mutate({agentId:i,version:x},{onSuccess:()=>ze.success(e("agents.deploySuccess","Deployment started")),onError:tt=>ze.error(Vs(tt))})}function Y(){T.mutate({agentId:i,version:x},{onSuccess:()=>ze.success(e("agents.undeploySuccess","Agent undeployed")),onError:tt=>ze.error(Vs(tt))})}function V(){I.mutate({id:i,version:x},{onSuccess:()=>{ze.success(e("common.delete")+" ✓"),h(!1),t("/manage/agents")},onError:tt=>ze.error(Vs(tt))})}async function ue(){try{const tt=await R.mutateAsync({id:i,version:x,deepCopy:!0});ze.success(e("agentDetail.duplicateSuccess"));const{id:qt}=uo(tt.location);t(`/manage/agentview/${qt}`)}catch(tt){ze.error(Vs(tt))}}function he(tt){if(!(v!=null&&v.workflows))return;const qt=v.workflows.filter(It=>It!==tt);P.mutate({agentId:i,version:x,workflows:qt},{onSuccess:()=>ze.success(e("agentDetail.workflowRemoved","Workflow removed")),onError:It=>ze.error(Vs(It))})}function Te(tt){const qt=(v==null?void 0:v.workflows)??[];qt.includes(tt)||(P.mutate({agentId:i,version:x,workflows:[...qt,tt]},{onSuccess:()=>ze.success(e("agentDetail.workflowAdded","Workflow added")),onError:It=>ze.error(Vs(It))}),a(!1))}function nt(tt,qt){if(!(v!=null&&v.workflows))return;const It=v.workflows.map(Zt=>Zt===tt?Zt.replace(/([?&]version=)\d+/,`$1${qt}`):Zt);P.mutate({agentId:i,version:x,workflows:It},{onSuccess:()=>ze.success(e("agentDetail.workflowUpdated","Workflow updated to latest version")),onError:Zt=>ze.error(Vs(Zt))})}const ge=L.useCallback(tt=>{r(tt)},[]);if(_&&!v)return d.jsx("div",{className:"flex items-center justify-center py-20",children:d.jsx(xi,{className:"h-8 w-8 animate-spin text-primary"})});if(w||!v)return d.jsxs("div",{className:"space-y-4",children:[d.jsx(Bpe,{}),d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-destructive/30 bg-destructive/5 py-16",children:[d.jsx(Lo,{className:"h-12 w-12 text-destructive"}),d.jsx("p",{className:"mt-4 text-lg font-medium text-destructive",children:e("common.error")}),d.jsx("button",{onClick:()=>k(),className:"mt-4 rounded-lg bg-destructive/10 px-4 py-2 text-sm font-medium text-destructive hover:bg-destructive/20",children:e("common.retry")})]})]});const _e=((ht=m==null?void 0:m[0])==null?void 0:ht.version)??x,$e=x<_e;return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Bpe,{}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(ai,{className:"h-8 w-8 text-primary"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold text-foreground",children:((Ct=m==null?void 0:m.find(tt=>tt.version===x))==null?void 0:Ct.name)||e("agentDetail.title","Agent Detail")}),d.jsxs("p",{className:"font-mono text-sm text-muted-foreground",children:[i,d.jsxs("span",{className:"ms-2 inline-flex items-center rounded-md bg-primary/10 px-1.5 py-0.5 text-xs font-semibold text-primary",children:["v",x]})]})]})]}),m&&m.length>0&&d.jsx(Fit,{versions:m,current:x,onChange:ge})]}),d.jsxs("div",{className:"flex flex-col gap-2 items-end",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs("div",{className:be("inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium",U.bg,U.color),"data-testid":"deployment-status",children:[d.jsx($,{className:"h-4 w-4"}),z]}),d.jsx("button",{onClick:G?Y:Q,disabled:ne,className:be("rounded-lg px-4 py-2 text-sm font-medium transition-colors",G?"bg-destructive/10 text-destructive hover:bg-destructive/20":"bg-primary text-primary-foreground hover:bg-primary/90",ne&&"cursor-not-allowed opacity-50"),"data-testid":"deploy-btn",children:e(ne?"common.loading":G?"agents.undeploy":"agents.deploy")}),!G&&!ne&&d.jsxs("button",{onClick:async()=>{const tt=_c.getState(),qt=Oi.getState();tt.open(i,i),tt.setStep("deploying");try{await ese("production",i,x);for(let It=0;It<15;It++){await new Promise(En=>setTimeout(En,2e3));const Zt=await FM("production",i,x);if(Zt.status==="READY")break;if(Zt.status==="ERROR")throw new Error("Deploy failed")}n.invalidateQueries({queryKey:["agents"]}),n.invalidateQueries({queryKey:["chat","deployedAgents"]}),tt.setStep("starting"),qt.clearMessages(),qt.setSelectedAgent(i,i),await j.mutateAsync({agentId:i}),tt.setStep("ready")}catch(It){tt.setStep("error",Vs(It))}},disabled:j.isPending,className:"inline-flex items-center gap-1.5 rounded-lg bg-emerald-500/10 px-4 py-2 text-sm font-medium text-emerald-600 hover:bg-emerald-500/20 transition-colors dark:text-emerald-400 disabled:opacity-50 disabled:cursor-not-allowed","data-testid":"deploy-chat-btn",children:[d.jsx(Ih,{className:"h-4 w-4","aria-hidden":"true"}),e("agents.deployAndChat","Deploy & Chat")]}),d.jsxs("div",{className:"inline-flex",children:[d.jsxs("button",{onClick:async()=>{const tt=_c.getState(),qt=Oi.getState();if(tt.open(i,i),G){tt.setStep("starting"),qt.clearMessages(),qt.setSelectedAgent(i,i);try{await j.mutateAsync({agentId:i}),tt.setStep("ready")}catch(It){tt.setStep("error",Vs(It))}}},disabled:j.isPending,className:be("inline-flex items-center gap-1.5 bg-emerald-500/10 px-4 py-2 text-sm font-medium text-emerald-600 hover:bg-emerald-500/20 transition-colors dark:text-emerald-400 disabled:opacity-50 disabled:cursor-not-allowed",G?"rounded-s-lg":"rounded-lg"),"data-testid":"chat-btn","aria-label":e("agents.chat","Chat"),children:[d.jsx(Zl,{className:"h-4 w-4","aria-hidden":"true"}),e("agents.chat","Chat")]}),G&&d.jsx("a",{href:`/chat/production/${i}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center rounded-e-lg border-s border-emerald-500/20 bg-emerald-500/10 px-2.5 py-2 text-emerald-600 hover:bg-emerald-500/20 transition-colors dark:text-emerald-400",title:e("agents.openExternalChat","Open in new tab"),"aria-label":e("agents.openExternalChat","Open in new tab"),"data-testid":"external-chat-btn",children:d.jsx(To,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[d.jsxs(Kn,{to:`/manage/studio/${i}`,className:"inline-flex items-center gap-1.5 rounded-lg bg-primary/10 px-3 py-1.5 text-xs font-medium text-primary hover:bg-primary/20 transition-colors","data-testid":"open-studio-btn",children:[d.jsx(Ll,{className:"h-3.5 w-3.5"}),e("agentDetail.openStudio","Open in Studio")]}),d.jsxs("button",{onClick:ue,disabled:R.isPending,className:"inline-flex items-center gap-1.5 rounded-lg border border-input px-3 py-1.5 text-xs font-medium text-foreground hover:bg-secondary transition-colors disabled:opacity-50","data-testid":"duplicate-agent-btn",children:[d.jsx(mo,{className:"h-3.5 w-3.5"}),R.isPending?e("agentDetail.duplicating"):e("agentDetail.duplicate")]}),d.jsxs("button",{onClick:()=>f(!0),className:"inline-flex items-center gap-1.5 rounded-lg border border-input px-3 py-1.5 text-xs font-medium text-foreground hover:bg-secondary transition-colors","data-testid":"export-agent-btn",children:[d.jsx(Q_,{className:"h-3.5 w-3.5"}),e("agents.export","Export")]}),d.jsx("button",{onClick:()=>h(!0),className:"inline-flex items-center gap-1.5 rounded-lg bg-destructive/10 px-3 py-1.5 text-xs font-medium text-destructive hover:bg-destructive/20 transition-colors","data-testid":"delete-agent-btn","aria-label":e("agents.deleteAgent","Delete agent"),children:d.jsx(_n,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}),$e&&d.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-amber-400/30 bg-amber-50 px-4 py-3 dark:bg-amber-900/15 dark:border-amber-700/30","data-testid":"non-latest-warning",children:[d.jsx(_d,{className:"h-5 w-5 text-amber-600 dark:text-amber-400 shrink-0"}),d.jsx("p",{className:"flex-1 text-sm text-amber-800 dark:text-amber-300",children:e("agentDetail.viewingOldVersion","You are viewing version {{current}}. Latest is version {{latest}}.",{current:x,latest:_e})}),d.jsx("button",{onClick:()=>ge(_e),className:"rounded-md bg-amber-600 px-3 py-1.5 text-xs font-semibold text-white hover:bg-amber-700 transition-colors shrink-0",children:e("agentDetail.switchToLatest","Switch to latest")})]}),l&&d.jsx("div",{className:be("rounded-lg px-4 py-2 text-sm font-medium transition-all",l.type==="success"?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-destructive/10 text-destructive"),"data-testid":"save-feedback",role:"status","aria-live":"polite",children:l.text}),E&&E.length>0&&d.jsx(Bit,{statuses:E,onDeploy:tt=>D.mutate({environment:tt,agentId:i,version:x},{onError:qt=>ze.error(Vs(qt))}),onUndeploy:tt=>T.mutate({environment:tt,agentId:i,version:x},{onError:qt=>ze.error(Vs(qt))}),isBusy:ne}),d.jsxs("section",{className:"rounded-xl border bg-card shadow-sm",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border p-5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Ed,{className:"h-5 w-5 text-primary"}),d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:e("agentDetail.packages","Workflows")}),d.jsx("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:((Ft=v.workflows)==null?void 0:Ft.length)??0})]}),d.jsxs("button",{onClick:()=>a(!o),className:"inline-flex items-center gap-1.5 rounded-lg bg-primary/10 px-3 py-1.5 text-sm font-medium text-primary hover:bg-primary/20 transition-colors","data-testid":"add-workflow-btn",children:[d.jsx(Gt,{className:"h-4 w-4"}),e("agentDetail.addWorkflow","Add Workflow")]})]}),d.jsxs("div",{className:"divide-y divide-border",children:[(!v.workflows||v.workflows.length===0)&&d.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[d.jsx(Ed,{className:"h-10 w-10 opacity-50"}),d.jsx("p",{className:"mt-3 text-sm",children:e("agentDetail.noWorkflows","No workflows added yet")})]}),(Ve=v.workflows)==null?void 0:Ve.map(tt=>{const{id:qt,version:It}=uo(tt),Zt=H==null?void 0:H[qt],En=Zt!==void 0&&Zt>It,Xi=`/manage/workflowview/${qt}?agentId=${i}&agentVer=${x}`;return d.jsxs("div",{className:be("group flex items-center gap-3 px-5 py-4 transition-colors",En?"bg-amber-50/50 dark:bg-amber-900/10 hover:bg-amber-50 dark:hover:bg-amber-900/20":"hover:bg-secondary/50"),children:[d.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 shrink-0",children:d.jsx(Ed,{className:"h-4 w-4 text-primary"})}),d.jsxs(Kn,{to:Xi,className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-semibold text-foreground group-hover:text-primary transition-colors truncate",children:qt}),d.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[d.jsxs("span",{className:"inline-flex items-center rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:["v",It]}),En&&d.jsx("span",{className:"text-[10px] text-amber-600 dark:text-amber-400 font-medium",children:e("agentDetail.outdated","outdated")})]})]}),d.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[En&&d.jsxs("button",{onClick:zi=>{zi.preventDefault(),nt(tt,Zt)},disabled:P.isPending,className:"inline-flex items-center gap-1 rounded-md bg-amber-100 px-2 py-1 text-[10px] font-semibold text-amber-800 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50 transition-colors disabled:opacity-50",title:e("agentDetail.updateToLatest","Update to latest version"),"data-testid":`update-workflow-${qt}`,children:[d.jsx(NSe,{className:"h-3 w-3"}),"v",Zt]}),d.jsxs(Kn,{to:Xi,className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2.5 py-1 text-xs font-medium text-primary hover:bg-primary/20 transition-colors",children:[e("agentDetail.openWorkflow","Open"),d.jsx(To,{className:"h-3 w-3"})]}),d.jsx("button",{onClick:()=>he(tt),disabled:P.isPending,className:"rounded-md p-1.5 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors disabled:opacity-50",title:e("common.delete"),children:d.jsx(_n,{className:"h-4 w-4"})})]})]},tt)})]})]}),o&&d.jsx(Hit,{currentWorkflows:v.workflows??[],onAdd:Te,onClose:()=>a(!1)}),d.jsx(zit,{agent:v,agentId:i,version:x}),d.jsx(wit,{agent:v,agentId:i,version:x}),d.jsx(Eit,{agent:v,agentId:i,version:x}),d.jsx(Lit,{agent:v,agentId:i,version:x}),d.jsx(Dit,{agent:v,agentId:i,version:x}),d.jsx(Iit,{agent:v,agentId:i,version:x}),d.jsx(Pit,{agent:v,agentId:i,version:x}),d.jsx(Vit,{agent:v}),d.jsx(sl,{open:u,onOpenChange:h,title:e("agents.confirmDelete"),description:e("agents.confirmDeleteDescription","This action cannot be undone. The agent and all its data will be permanently removed."),confirmLabel:e("common.delete"),cancelLabel:e("common.cancel"),onConfirm:V,isPending:I.isPending}),d.jsx(REe,{open:g,onClose:()=>f(!1),agentId:i,agentVersion:x})]})}function Bpe(){const{t:i}=xe();return d.jsxs(Kn,{to:"/manage/agents",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(El,{className:"h-4 w-4"}),i("agentDetail.backToAgents","Back to Agents")]})}function Fit({versions:i,current:e,onChange:t}){return i.length<=1?d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground","data-testid":"version-badge",children:["v",e]}):d.jsx("select",{value:e,onChange:n=>t(Number(n.target.value)),className:"rounded-md border border-input bg-background px-2.5 py-1 text-xs font-medium text-foreground shadow-sm transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1","data-testid":"version-picker",children:i.map(n=>d.jsxs("option",{value:n.version,children:["v",n.version,n.lastModifiedOn?` — ${Tw(n.lastModifiedOn)}`:""]},n.version))})}function Bit({statuses:i,onDeploy:e,onUndeploy:t,isBusy:n}){const{t:s}=xe(),r={READY:s("status.deployed","Deployed"),IN_PROGRESS:s("status.deploying","Deploying..."),ERROR:s("status.error","Error"),NOT_FOUND:s("status.notDeployed","Not deployed")};return d.jsxs("section",{className:"overflow-hidden rounded-xl border bg-card shadow-sm","data-testid":"env-badges",children:[d.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-5 py-3",children:[d.jsx(rb,{className:"h-5 w-5 text-primary"}),d.jsx("h2",{className:"text-sm font-semibold text-foreground",children:s("agentDetail.environments","Environments")})]}),d.jsx("div",{className:"grid grid-cols-1 gap-0 divide-y divide-border sm:grid-cols-2 sm:divide-x sm:divide-y-0",children:i.map(({environment:o,status:a})=>{const l=_Le[a],c=l.icon,u=a==="READY";return d.jsxs("div",{className:"flex items-center justify-between gap-3 px-5 py-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:be("rounded-full p-1.5",l.bg),children:d.jsx(c,{className:be("h-3.5 w-3.5",l.color)})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-foreground",children:s(Oit[o]??o)}),d.jsx("p",{className:be("text-xs",l.color),children:r[a]??a})]})]}),d.jsx("button",{onClick:()=>u?t(o):e(o),disabled:n,className:be("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",u?"bg-destructive/10 text-destructive hover:bg-destructive/20":"bg-primary/10 text-primary hover:bg-primary/20",n&&"cursor-not-allowed opacity-50"),children:s(u?"agents.undeploy":"agents.deploy")})]},o)})})]})}function Hit({currentWorkflows:i,onAdd:e,onClose:t}){const{t:n}=xe(),[s,r]=L.useState(""),{data:o,isLoading:a}=iit(100,0,s),l=(o??[]).filter(c=>!i.includes(c.resource));return d.jsxs("section",{className:"rounded-xl border bg-card shadow-sm",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border p-5",children:[d.jsx("h3",{className:"text-lg font-semibold text-foreground",children:n("agentDetail.selectWorkflow","Select Workflow to Add")}),d.jsx("button",{onClick:t,className:"text-sm text-muted-foreground hover:text-foreground",children:n("common.cancel")})]}),d.jsx("div",{className:"p-5",children:d.jsx("input",{type:"text",value:s,onChange:c=>r(c.target.value),placeholder:n("common.search"),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})}),d.jsxs("div",{className:"max-h-64 divide-y divide-border overflow-y-auto",children:[a&&d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx(xi,{className:"h-5 w-5 animate-spin text-primary"})}),!a&&l.length===0&&d.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:n("common.noResults")}),l.map(c=>d.jsxs("button",{onClick:()=>e(c.resource),className:"flex w-full items-center justify-between px-5 py-3 text-start hover:bg-secondary/50 transition-colors",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-foreground",children:c.name||uo(c.resource).id}),d.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1",children:c.description||n("agents.noDescription","No description")})]}),d.jsx(Gt,{className:"h-4 w-4 text-primary"})]},c.resource))]})]})}function Wit(i){const e=/("(?:[^"\\]|\\.)*")\s*:|"(?:[^"\\]|\\.)*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|\btrue\b|\bfalse\b|\bnull\b/g,t=[];let n=0,s,r=0;for(;(s=e.exec(i))!==null;){s.index>n&&t.push(i.slice(n,s.index));const o=s[0];if(r++,o.endsWith(":")){const a=o.slice(0,-1);t.push(d.jsx("span",{className:"text-primary",children:a},`k${r}`),":")}else o.startsWith('"')?t.push(d.jsx("span",{className:"text-emerald-600 dark:text-emerald-400",children:o},`s${r}`)):o==="true"||o==="false"?t.push(d.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:o},`b${r}`)):o==="null"?t.push(d.jsx("span",{className:"text-muted-foreground italic",children:o},`n${r}`)):t.push(d.jsx("span",{className:"text-sky-600 dark:text-sky-400",children:o},`d${r}`));n=s.index+o.length}return nn(!t),className:"flex w-full items-center justify-between p-5 text-start","aria-expanded":t,"aria-controls":"raw-config-content",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(xp,{className:"h-5 w-5 text-muted-foreground","aria-hidden":"true"}),d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:e("agentDetail.rawConfig","Raw Configuration")})]}),t?d.jsx(Rn,{className:"h-4 w-4 text-muted-foreground"}):d.jsx(hs,{className:"h-4 w-4 text-muted-foreground"})]}),t&&d.jsx("div",{className:"border-t border-border p-5",id:"raw-config-content",children:d.jsx("pre",{className:"overflow-x-auto rounded-lg bg-secondary p-4 text-sm font-mono leading-relaxed",children:Wit(JSON.stringify(i,null,2))})})]})}function zit({agent:i,agentId:e,version:t}){const{t:n}=xe(),s=wC(),[r,o]=L.useState(""),[a,l]=L.useState(i.description??""),[c,u]=L.useState(!1),[h,g]=L.useState(null);L.useEffect(()=>l(i.description??""),[i.description]);const f=i.a2aEnabled??!1;function m(){s.mutate({id:e,version:t,agent:{...i,a2aEnabled:!f}})}function x(){a!==(i.description??"")&&s.mutate({id:e,version:t,agent:{...i,description:a}})}function v(){const R=r.trim();if(!R)return;const P=i.a2aSkills??[];P.includes(R)||(s.mutate({id:e,version:t,agent:{...i,a2aSkills:[...P,R]}}),o(""))}function _(R){const P=(i.a2aSkills??[]).filter((j,B)=>B!==R);s.mutate({id:e,version:t,agent:{...i,a2aSkills:P}})}function w(R,P){navigator.clipboard.writeText(R).then(()=>{g(P),setTimeout(()=>g(null),2e3)})}const k=window.location.origin,C=`${k}/a2a/agents/${e}/agent.json`,E=`${k}/a2a/agents/${e}`,D={name:`EDDI Agent ${e}`,description:i.description||"EDDI conversational AI agent",url:E,provider:"EDDI",version:"6.0.0",capabilities:{streaming:!1,pushNotifications:!1,stateTransitionHistory:!0},skills:i.a2aSkills&&i.a2aSkills.length>0?i.a2aSkills.map(R=>({id:R.toLowerCase().replace(/ /g,"-"),name:R,description:`Skill: ${R}`})):[{id:"chat",name:"Conversational AI",description:"General conversational AI agent powered by EDDI"}]},[T,I]=L.useState(!1);return d.jsxs("section",{className:"rounded-xl border bg-card shadow-sm","data-testid":"a2a-section",children:[d.jsxs("button",{type:"button",onClick:()=>I(!T),className:be("flex w-full items-center gap-2 p-5 text-start",T&&"border-b border-border"),children:[T?d.jsx(Rn,{className:"h-4 w-4 text-muted-foreground"}):d.jsx(hs,{className:"h-4 w-4 text-muted-foreground"}),d.jsx(pG,{className:"h-5 w-5 text-primary"}),d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:n("agentDetail.a2aSection","Agent-to-Agent (A2A)")}),f&&d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-xs font-medium text-emerald-600 dark:text-emerald-400",children:[d.jsx(Dw,{className:"h-3 w-3"}),n("agentDetail.a2aEnabled","Enabled")]})]}),T&&d.jsx("div",{className:"p-5",children:f?d.jsxs("div",{className:"space-y-5",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1.5 block text-sm font-medium text-foreground",children:n("agentDetail.a2aDescription","Agent Description")}),d.jsx("input",{type:"text",value:a,onChange:R=>l(R.target.value),onBlur:x,onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),x())},placeholder:n("agentDetail.a2aDescPlaceholder","What does this agent do?"),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"a2a-description"}),d.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:n("agentDetail.a2aDescHint","Shown in the Agent Card — helps other agents understand what this agent does")})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1.5 block text-sm font-medium text-foreground",children:n("agentDetail.a2aSkills","A2A Skills")}),d.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-2",children:[(i.a2aSkills??[]).map((R,P)=>d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:[R,d.jsx("button",{type:"button",onClick:()=>_(P),className:"rounded p-0.5 hover:bg-primary/20 transition-colors","aria-label":`Remove ${R}`,children:d.jsx(An,{className:"h-3 w-3"})})]},P)),(i.a2aSkills??[]).length===0&&d.jsx("span",{className:"text-xs text-muted-foreground italic",children:n("agentDetail.a2aNoSkills","No skills — a default 'chat' skill will be used")})]}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("input",{type:"text",value:r,onChange:R=>o(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),v())},placeholder:n("agentDetail.a2aSkillPlaceholder","e.g. translation, code-review"),className:"h-8 flex-1 rounded-md border border-input bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"a2a-skill-input"}),d.jsx("button",{type:"button",onClick:v,className:"inline-flex h-8 items-center gap-1 rounded-md border border-input px-2 text-xs font-medium text-foreground transition-colors hover:bg-secondary",children:d.jsx(Gt,{className:"h-3 w-3"})})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1.5 block text-sm font-medium text-foreground",children:n("agentDetail.a2aEndpoints","Endpoints")}),d.jsx("div",{className:"space-y-1.5",children:[{method:"GET",url:C,label:"card"},{method:"POST",url:E,label:"rpc"}].map(({method:R,url:P,label:j})=>d.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-secondary/50 px-3 py-2",children:[d.jsx("span",{className:be("rounded px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider",R==="GET"?"bg-sky-500/10 text-sky-600 dark:text-sky-400":"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400"),children:R}),d.jsx("code",{className:"flex-1 truncate font-mono text-xs text-foreground",dir:"ltr",children:P}),d.jsx("button",{type:"button",onClick:()=>w(P,j),className:"rounded p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":"Copy URL",children:h===j?d.jsx("span",{className:"text-[10px] font-medium text-emerald-500",children:"✓"}):d.jsx(mo,{className:"h-3.5 w-3.5"})})]},j))})]}),d.jsxs("div",{children:[d.jsxs("button",{type:"button",onClick:()=>u(!c),className:"flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors","data-testid":"a2a-card-toggle",children:[c?d.jsx(Rn,{className:"h-3 w-3"}):d.jsx(hs,{className:"h-3 w-3"}),n("agentDetail.agentCardPreview","Agent Card Preview")]}),c&&d.jsx("pre",{className:"mt-2 max-h-48 overflow-auto rounded-lg bg-secondary p-3 text-xs text-foreground font-mono",children:JSON.stringify(D,null,2)})]})]}):d.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[d.jsx(pG,{className:"h-10 w-10 text-muted-foreground/50"}),d.jsx("p",{className:"mt-3 text-sm text-muted-foreground max-w-md",children:n("agentDetail.a2aEnabledDesc","Make this agent discoverable by other agents via the A2A protocol. Other EDDI instances can find and call this agent as a tool.")}),d.jsxs("button",{onClick:m,disabled:s.isPending,className:"mt-4 inline-flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 hover:shadow-md disabled:opacity-50","data-testid":"enable-a2a-btn",children:[d.jsx(Dw,{className:"h-4 w-4"}),n("agentDetail.a2aEnable","Enable A2A")]})]})})]})}function Uit({workflow:i,onDuplicate:e,onDelete:t}){const{t:n}=xe(),[s,r]=L.useState(!1),o=$it(i.lastModifiedOn);return d.jsxs("div",{className:be("group relative flex flex-col rounded-xl border bg-card p-5 shadow-sm transition-all duration-200","hover:shadow-md hover:border-primary/30"),"data-testid":`workflow-card-${i.id}`,children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsx("div",{className:"rounded-lg bg-primary/10 p-2",children:d.jsx(Ed,{className:"h-5 w-5 text-primary"})}),d.jsxs("div",{className:"relative",children:[d.jsx("button",{onClick:()=>r(!s),className:"rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-secondary hover:text-foreground group-hover:opacity-100","data-testid":`workflow-menu-${i.id}`,children:d.jsx(c7,{className:"h-4 w-4"})}),s&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r(!1)}),d.jsxs("div",{className:"absolute inset-e-0 z-50 mt-1 w-44 rounded-lg border bg-popover py-1 shadow-lg",children:[d.jsxs("button",{onClick:()=>{e(i.id,i.version),r(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-popover-foreground hover:bg-secondary",children:[d.jsx(mo,{className:"h-4 w-4"}),n("common.duplicate","Duplicate")]}),d.jsxs("button",{onClick:()=>{t(i.id,i.version),r(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-destructive hover:bg-destructive/10",children:[d.jsx(_n,{className:"h-4 w-4"}),n("common.delete")]})]})]})]})]}),d.jsxs("div",{className:"mt-4 flex-1",children:[d.jsxs(Kn,{to:`/manage/workflowview/${i.id}`,className:"text-lg font-semibold text-foreground hover:text-primary transition-colors",children:[i.name||n("packages.unnamed","Unnamed Workflow"),d.jsx(To,{className:"ms-1 inline h-3.5 w-3.5 opacity-0 group-hover:opacity-50"})]}),d.jsx("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground/70 truncate",title:i.id,children:i.id}),d.jsx("p",{className:"mt-1 line-clamp-2 text-sm text-muted-foreground",children:i.description||n("packages.noDescription","No description")})]}),d.jsxs("div",{className:"mt-4 flex items-center justify-between border-t border-border pt-3",children:[d.jsx("span",{className:"text-xs text-muted-foreground",title:new Date(i.lastModifiedOn).toLocaleString(),children:o}),d.jsxs("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:["v",i.version]})]})]})}function $it(i){const t=Date.now()-i,n=Math.floor(t/6e4),s=Math.floor(t/36e5),r=Math.floor(t/864e5);return n<1?"Just now":n<60?`${n}m ago`:s<24?`${s}h ago`:r<30?`${r}d ago`:new Date(i).toLocaleDateString()}function qit({open:i,onClose:e}){const{t}=xe(),n=il(),s=lit(),[r,o]=L.useState(""),[a,l]=L.useState("");async function c(u){u.preventDefault();try{const h=await s.mutateAsync({config:{workflowSteps:[]},name:r,description:a});if(ze.success(t("packages.createSuccess","Workflow created successfully")),o(""),l(""),e(),h.location){const f=new URL(h.location,"http://dummy").pathname.split("/").filter(Boolean),m=f[f.length-1];m&&n(`/manage/workflowview/${m}`)}}catch(h){ze.error(Vs(h))}}return d.jsx(YM,{open:i,onClose:e,title:t("packages.createTitle","Create New Workflow"),testId:"create-workflow-dialog",children:d.jsxs("form",{onSubmit:c,className:"space-y-4 p-5",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"workflow-name",className:"mb-1.5 block text-sm font-medium text-foreground",children:t("packages.name","Name")}),d.jsx("input",{id:"workflow-name",type:"text",value:r,onChange:u=>o(u.target.value),placeholder:t("packages.namePlaceholder","My Workflow"),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",autoFocus:!0})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"workflow-description",className:"mb-1.5 block text-sm font-medium text-foreground",children:t("packages.description","Description")}),d.jsx("textarea",{id:"workflow-description",value:a,onChange:u=>l(u.target.value),placeholder:t("packages.descriptionPlaceholder","Describe what this workflow does..."),rows:3,className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-none"})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[d.jsx("button",{type:"button",onClick:e,className:"rounded-lg px-4 py-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:t("common.cancel")}),d.jsx("button",{type:"submit",disabled:s.isPending,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors disabled:opacity-50",children:s.isPending?t("common.loading"):t("common.create")})]})]})})}function Kit(){const{t:i}=xe(),[e,t]=L.useState(""),[n,s]=L.useState(!1),[r,o]=L.useState(null),[a,l]=L.useState(()=>WE("workflows")),[c,u]=L.useState("modified"),[h,g]=L.useState("desc"),f=$s(U=>U.maybeAutoStart);L.useEffect(()=>{const U=setTimeout(()=>f("workflows"),500);return()=>clearTimeout(U)},[f]);const{data:m,isLoading:x,isError:v,refetch:_,fetchNextPage:w,hasNextPage:k,isFetchingNextPage:C}=sit(e),E=mLe(),D=dit(),T=L.useMemo(()=>{const U=(m==null?void 0:m.pages.flat())??[];return[...hit(U)].sort((K,z)=>{let G=0;return c==="name"?G=(K.name??"").localeCompare(z.name??""):c==="version"?G=K.version-z.version:G=new Date(K.lastModifiedOn).getTime()-new Date(z.lastModifiedOn).getTime(),h==="asc"?G:-G})},[m,c,h]),I=L.useCallback(U=>{c===U?g($=>$==="asc"?"desc":"asc"):(u(U),g(U==="modified"?"desc":"asc"))},[c]);function R(U,$){o({id:U,version:$})}function P(){r&&E.mutate(r,{onSuccess:()=>{ze.success(i("common.delete")+" ✓"),o(null)},onError:U=>ze.error(Vs(U))})}function j(U,$){D.mutate({id:U,version:$,deepCopy:!1},{onSuccess:()=>{ze.success(i("common.duplicate","Duplicate")+" ✓")},onError:K=>ze.error(Vs(K))})}function B(U){l(U),JM("workflows",U)}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-2 text-3xl font-bold text-foreground",children:[d.jsx(Ed,{className:"h-8 w-8 text-primary"}),i("pages.packages.title")]}),d.jsx("p",{className:"mt-1 text-muted-foreground",children:i("pages.packages.subtitle")})]}),d.jsxs(Yt,{onClick:()=>s(!0),"data-testid":"create-workflow-btn",children:[d.jsx(Gt,{className:"h-4 w-4"}),i("packages.createWorkflow")]})]}),d.jsxs("div",{className:"flex items-center gap-3","data-tour":"workflows-search",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx(br,{className:"absolute inset-s-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:e,onChange:U=>t(U.target.value),placeholder:i("common.search"),className:"w-full rounded-lg border border-input bg-background py-2.5 ps-10 pe-4 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"workflow-search"})]}),d.jsx(zL,{view:a,onChange:B})]}),d.jsxs("div",{"data-tour":"workflows-content",children:[x&&d.jsx("div",{className:"cq-card-grid",children:Array.from({length:4}).map((U,$)=>d.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 space-y-3",children:[d.jsx(bi,{className:"h-5 w-3/4"}),d.jsx(bi,{className:"h-4 w-1/2"}),d.jsx(bi,{className:"h-4 w-full"})]},$))}),v&&d.jsx(ep,{message:i("common.error"),onRetry:()=>_(),retryLabel:i("common.retry")}),!x&&!v&&T.length===0&&d.jsx(ZM,{icon:Ed,title:i(e?"common.noResults":"packages.empty"),description:e?void 0:i("packages.emptyDescription","Workflows define the processing pipeline for your agents."),actionLabel:e?void 0:i("packages.createWorkflow"),onAction:e?void 0:()=>s(!0)}),!x&&!v&&T.length>0&&d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[i("packages.count",{count:T.length}),k&&"+"]}),a==="card"?d.jsx("div",{className:"cq-card-grid","data-testid":"workflow-grid",children:T.map(U=>d.jsx(Uit,{workflow:U,onDuplicate:j,onDelete:R},U.resource))}):d.jsx("div",{className:"overflow-hidden rounded-xl border bg-card shadow-sm","data-testid":"workflow-list",children:d.jsxs("table",{className:"w-full",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-border bg-secondary/50",children:[d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground cursor-pointer select-none hover:text-foreground transition-colors",onClick:()=>I("name"),children:d.jsxs("span",{className:"inline-flex items-center gap-1",children:[i("common.name","Name"),c==="name"?h==="asc"?d.jsx(zv,{className:"h-3 w-3"}):d.jsx(zf,{className:"h-3 w-3"}):d.jsx(pN,{className:"h-3 w-3 opacity-30"})]})}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("common.id","ID")}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground cursor-pointer select-none hover:text-foreground transition-colors",onClick:()=>I("version"),children:d.jsxs("span",{className:"inline-flex items-center gap-1",children:[i("common.version","Version"),c==="version"?h==="asc"?d.jsx(zv,{className:"h-3 w-3"}):d.jsx(zf,{className:"h-3 w-3"}):d.jsx(pN,{className:"h-3 w-3 opacity-30"})]})}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground cursor-pointer select-none hover:text-foreground transition-colors",onClick:()=>I("modified"),children:d.jsxs("span",{className:"inline-flex items-center gap-1",children:[i("common.modified","Modified"),c==="modified"?h==="asc"?d.jsx(zv,{className:"h-3 w-3"}):d.jsx(zf,{className:"h-3 w-3"}):d.jsx(pN,{className:"h-3 w-3 opacity-30"})]})}),d.jsx("th",{className:"px-5 py-3 text-end text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("conversations.actions","Actions")})]})}),d.jsx("tbody",{className:"divide-y divide-border",children:T.map(U=>d.jsxs("tr",{className:"hover:bg-secondary/30 transition-colors",children:[d.jsx("td",{className:"px-5 py-3",children:d.jsxs(Kn,{to:`/manage/workflowview/${U.id}`,className:"text-sm font-medium text-foreground hover:text-primary transition-colors",children:[U.name||i("packages.unnamed","Unnamed Workflow"),d.jsx(To,{className:"ms-1 inline h-3 w-3 opacity-40"})]})}),d.jsx("td",{className:"px-5 py-3",children:d.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[U.id.slice(0,12),"…"]})}),d.jsx("td",{className:"px-5 py-3",children:d.jsxs("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:["v",U.version]})}),d.jsx("td",{className:"px-5 py-3",children:d.jsx("span",{className:"text-sm text-muted-foreground",children:new Date(U.lastModifiedOn).toLocaleString()})}),d.jsx("td",{className:"px-5 py-3 text-end",children:d.jsxs("div",{className:"inline-flex items-center gap-1",children:[d.jsx("button",{onClick:()=>j(U.id,U.version),className:"rounded-md p-1.5 text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors",title:i("common.duplicate","Duplicate"),children:d.jsx(mo,{className:"h-4 w-4"})}),d.jsx("button",{onClick:()=>R(U.id,U.version),className:"rounded-md p-1.5 text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",title:i("common.delete"),children:d.jsx(_n,{className:"h-4 w-4"})})]})})]},U.resource))})]})}),d.jsx(fLe,{onLoadMore:()=>w(),isFetchingMore:C,hasMore:!!k})]})]}),d.jsx(qit,{open:n,onClose:()=>s(!1)}),d.jsx(sl,{open:r!==null,onOpenChange:U=>!U&&o(null),title:i("packages.confirmDelete"),description:i("packages.confirmDeleteDescription","This action cannot be undone. The workflow and all its data will be permanently removed."),confirmLabel:i("common.delete"),cancelLabel:i("common.cancel"),onConfirm:P,isPending:E.isPending})]})}function Git(){for(var i=arguments.length,e=new Array(i),t=0;tn=>{e.forEach(s=>s(n))},e)}const P7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function UL(i){const e=Object.prototype.toString.call(i);return e==="[object Window]"||e==="[object global]"}function Wse(i){return"nodeType"in i}function Fd(i){var e,t;return i?UL(i)?i:Wse(i)&&(e=(t=i.ownerDocument)==null?void 0:t.defaultView)!=null?e:window:window}function Vse(i){const{Document:e}=Fd(i);return i instanceof e}function eP(i){return UL(i)?!1:i instanceof Fd(i).HTMLElement}function yLe(i){return i instanceof Fd(i).SVGElement}function $L(i){return i?UL(i)?i.document:Wse(i)?Vse(i)?i:eP(i)||yLe(i)?i.ownerDocument:document:document:document}const tp=P7?L.useLayoutEffect:L.useEffect;function zse(i){const e=L.useRef(i);return tp(()=>{e.current=i}),L.useCallback(function(){for(var t=arguments.length,n=new Array(t),s=0;s{i.current=setInterval(n,s)},[]),t=L.useCallback(()=>{i.current!==null&&(clearInterval(i.current),i.current=null)},[]);return[e,t]}function CA(i,e){e===void 0&&(e=[i]);const t=L.useRef(i);return tp(()=>{t.current!==i&&(t.current=i)},e),t}function tP(i,e){const t=L.useRef();return L.useMemo(()=>{const n=i(t.current);return t.current=n,n},[...e])}function Rj(i){const e=zse(i),t=L.useRef(null),n=L.useCallback(s=>{s!==t.current&&(e==null||e(s,t.current)),t.current=s},[]);return[t,n]}function WG(i){const e=L.useRef();return L.useEffect(()=>{e.current=i},[i]),e.current}let AU={};function nP(i,e){return L.useMemo(()=>{if(e)return e;const t=AU[i]==null?0:AU[i]+1;return AU[i]=t,i+"-"+t},[i,e])}function wLe(i){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s{const a=Object.entries(o);for(const[l,c]of a){const u=r[l];u!=null&&(r[l]=u+i*c)}return r},{...e})}}const xN=wLe(1),SA=wLe(-1);function Qit(i){return"clientX"in i&&"clientY"in i}function Use(i){if(!i)return!1;const{KeyboardEvent:e}=Fd(i.target);return e&&i instanceof e}function Xit(i){if(!i)return!1;const{TouchEvent:e}=Fd(i.target);return e&&i instanceof e}function VG(i){if(Xit(i)){if(i.touches&&i.touches.length){const{clientX:e,clientY:t}=i.touches[0];return{x:e,y:t}}else if(i.changedTouches&&i.changedTouches.length){const{clientX:e,clientY:t}=i.changedTouches[0];return{x:e,y:t}}}return Qit(i)?{x:i.clientX,y:i.clientY}:null}const kA=Object.freeze({Translate:{toString(i){if(!i)return;const{x:e,y:t}=i;return"translate3d("+(e?Math.round(e):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(i){if(!i)return;const{scaleX:e,scaleY:t}=i;return"scaleX("+e+") scaleY("+t+")"}},Transform:{toString(i){if(i)return[kA.Translate.toString(i),kA.Scale.toString(i)].join(" ")}},Transition:{toString(i){let{property:e,duration:t,easing:n}=i;return e+" "+t+"ms "+n}}}),Hpe="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Zit(i){return i.matches(Hpe)?i:i.querySelector(Hpe)}const Jit={display:"none"};function est(i){let{id:e,value:t}=i;return ft.createElement("div",{id:e,style:Jit},t)}function tst(i){let{id:e,announcement:t,ariaLiveType:n="assertive"}=i;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ft.createElement("div",{id:e,style:s,role:"status","aria-live":n,"aria-atomic":!0},t)}function nst(){const[i,e]=L.useState("");return{announce:L.useCallback(n=>{n!=null&&e(n)},[]),announcement:i}}const CLe=L.createContext(null);function ist(i){const e=L.useContext(CLe);L.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of ");return e(i)},[i,e])}function sst(){const[i]=L.useState(()=>new Set),e=L.useCallback(n=>(i.add(n),()=>i.delete(n)),[i]);return[L.useCallback(n=>{let{type:s,event:r}=n;i.forEach(o=>{var a;return(a=o[s])==null?void 0:a.call(o,r)})},[i]),e]}const rst={draggable:`
- To pick up a draggable item, press the space bar.
- While dragging, use the arrow keys to move the item.
- Press space again to drop the item in its new position, or press escape to cancel.
- `},ost={onDragStart(i){let{active:e}=i;return"Picked up draggable item "+e.id+"."},onDragOver(i){let{active:e,over:t}=i;return t?"Draggable item "+e.id+" was moved over droppable area "+t.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(i){let{active:e,over:t}=i;return t?"Draggable item "+e.id+" was dropped over droppable area "+t.id:"Draggable item "+e.id+" was dropped."},onDragCancel(i){let{active:e}=i;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function ast(i){let{announcements:e=ost,container:t,hiddenTextDescribedById:n,screenReaderInstructions:s=rst}=i;const{announce:r,announcement:o}=nst(),a=nP("DndLiveRegion"),[l,c]=L.useState(!1);if(L.useEffect(()=>{c(!0)},[]),ist(L.useMemo(()=>({onDragStart(h){let{active:g}=h;r(e.onDragStart({active:g}))},onDragMove(h){let{active:g,over:f}=h;e.onDragMove&&r(e.onDragMove({active:g,over:f}))},onDragOver(h){let{active:g,over:f}=h;r(e.onDragOver({active:g,over:f}))},onDragEnd(h){let{active:g,over:f}=h;r(e.onDragEnd({active:g,over:f}))},onDragCancel(h){let{active:g,over:f}=h;r(e.onDragCancel({active:g,over:f}))}}),[r,e])),!l)return null;const u=ft.createElement(ft.Fragment,null,ft.createElement(est,{id:n,value:s.draggable}),ft.createElement(tst,{id:a,announcement:o}));return t?hg.createPortal(u,t):u}var Ca;(function(i){i.DragStart="dragStart",i.DragMove="dragMove",i.DragEnd="dragEnd",i.DragCancel="dragCancel",i.DragOver="dragOver",i.RegisterDroppable="registerDroppable",i.SetDroppableDisabled="setDroppableDisabled",i.UnregisterDroppable="unregisterDroppable"})(Ca||(Ca={}));function Mj(){}function Wpe(i,e){return L.useMemo(()=>({sensor:i,options:e??{}}),[i,e])}function lst(){for(var i=arguments.length,e=new Array(i),t=0;t[...e].filter(n=>n!=null),[...e])}const Sg=Object.freeze({x:0,y:0});function SLe(i,e){return Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2))}function kLe(i,e){let{data:{value:t}}=i,{data:{value:n}}=e;return t-n}function cst(i,e){let{data:{value:t}}=i,{data:{value:n}}=e;return n-t}function Vpe(i){let{left:e,top:t,height:n,width:s}=i;return[{x:e,y:t},{x:e+s,y:t},{x:e,y:t+n},{x:e+s,y:t+n}]}function NLe(i,e){if(!i||i.length===0)return null;const[t]=i;return t[e]}function zpe(i,e,t){return e===void 0&&(e=i.left),t===void 0&&(t=i.top),{x:e+i.width*.5,y:t+i.height*.5}}const dst=i=>{let{collisionRect:e,droppableRects:t,droppableContainers:n}=i;const s=zpe(e,e.left,e.top),r=[];for(const o of n){const{id:a}=o,l=t.get(a);if(l){const c=SLe(zpe(l),s);r.push({id:a,data:{droppableContainer:o,value:c}})}}return r.sort(kLe)},ust=i=>{let{collisionRect:e,droppableRects:t,droppableContainers:n}=i;const s=Vpe(e),r=[];for(const o of n){const{id:a}=o,l=t.get(a);if(l){const c=Vpe(l),u=s.reduce((g,f,m)=>g+SLe(c[m],f),0),h=Number((u/4).toFixed(4));r.push({id:a,data:{droppableContainer:o,value:h}})}}return r.sort(kLe)};function hst(i,e){const t=Math.max(e.top,i.top),n=Math.max(e.left,i.left),s=Math.min(e.left+e.width,i.left+i.width),r=Math.min(e.top+e.height,i.top+i.height),o=s-n,a=r-t;if(n{let{collisionRect:e,droppableRects:t,droppableContainers:n}=i;const s=[];for(const r of n){const{id:o}=r,a=t.get(o);if(a){const l=hst(a,e);l>0&&s.push({id:o,data:{droppableContainer:r,value:l}})}}return s.sort(cst)};function fst(i,e,t){return{...i,scaleX:e&&t?e.width/t.width:1,scaleY:e&&t?e.height/t.height:1}}function ELe(i,e){return i&&e?{x:i.left-e.left,y:i.top-e.top}:Sg}function pst(i){return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r({...o,top:o.top+i*a.y,bottom:o.bottom+i*a.y,left:o.left+i*a.x,right:o.right+i*a.x}),{...t})}}const mst=pst(1);function bst(i){if(i.startsWith("matrix3d(")){const e=i.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(i.startsWith("matrix(")){const e=i.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function xst(i,e,t){const n=bst(e);if(!n)return i;const{scaleX:s,scaleY:r,x:o,y:a}=n,l=i.left-o-(1-s)*parseFloat(t),c=i.top-a-(1-r)*parseFloat(t.slice(t.indexOf(" ")+1)),u=s?i.width/s:i.width,h=r?i.height/r:i.height;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l}}const vst={ignoreTransform:!1};function qL(i,e){e===void 0&&(e=vst);let t=i.getBoundingClientRect();if(e.ignoreTransform){const{transform:c,transformOrigin:u}=Fd(i).getComputedStyle(i);c&&(t=xst(t,c,u))}const{top:n,left:s,width:r,height:o,bottom:a,right:l}=t;return{top:n,left:s,width:r,height:o,bottom:a,right:l}}function Upe(i){return qL(i,{ignoreTransform:!0})}function _st(i){const e=i.innerWidth,t=i.innerHeight;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}function yst(i,e){return e===void 0&&(e=Fd(i).getComputedStyle(i)),e.position==="fixed"}function wst(i,e){e===void 0&&(e=Fd(i).getComputedStyle(i));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const r=e[s];return typeof r=="string"?t.test(r):!1})}function O7(i,e){const t=[];function n(s){if(e!=null&&t.length>=e||!s)return t;if(Vse(s)&&s.scrollingElement!=null&&!t.includes(s.scrollingElement))return t.push(s.scrollingElement),t;if(!eP(s)||yLe(s)||t.includes(s))return t;const r=Fd(i).getComputedStyle(s);return s!==i&&wst(s,r)&&t.push(s),yst(s,r)?t:n(s.parentNode)}return i?n(i):t}function LLe(i){const[e]=O7(i,1);return e??null}function RU(i){return!P7||!i?null:UL(i)?i:Wse(i)?Vse(i)||i===$L(i).scrollingElement?window:eP(i)?i:null:null}function DLe(i){return UL(i)?i.scrollX:i.scrollLeft}function TLe(i){return UL(i)?i.scrollY:i.scrollTop}function zG(i){return{x:DLe(i),y:TLe(i)}}var qa;(function(i){i[i.Forward=1]="Forward",i[i.Backward=-1]="Backward"})(qa||(qa={}));function ILe(i){return!P7||!i?!1:i===document.scrollingElement}function ALe(i){const e={x:0,y:0},t=ILe(i)?{height:window.innerHeight,width:window.innerWidth}:{height:i.clientHeight,width:i.clientWidth},n={x:i.scrollWidth-t.width,y:i.scrollHeight-t.height},s=i.scrollTop<=e.y,r=i.scrollLeft<=e.x,o=i.scrollTop>=n.y,a=i.scrollLeft>=n.x;return{isTop:s,isLeft:r,isBottom:o,isRight:a,maxScroll:n,minScroll:e}}const Cst={x:.2,y:.2};function Sst(i,e,t,n,s){let{top:r,left:o,right:a,bottom:l}=t;n===void 0&&(n=10),s===void 0&&(s=Cst);const{isTop:c,isBottom:u,isLeft:h,isRight:g}=ALe(i),f={x:0,y:0},m={x:0,y:0},x={height:e.height*s.y,width:e.width*s.x};return!c&&r<=e.top+x.height?(f.y=qa.Backward,m.y=n*Math.abs((e.top+x.height-r)/x.height)):!u&&l>=e.bottom-x.height&&(f.y=qa.Forward,m.y=n*Math.abs((e.bottom-x.height-l)/x.height)),!g&&a>=e.right-x.width?(f.x=qa.Forward,m.x=n*Math.abs((e.right-x.width-a)/x.width)):!h&&o<=e.left+x.width&&(f.x=qa.Backward,m.x=n*Math.abs((e.left+x.width-o)/x.width)),{direction:f,speed:m}}function kst(i){if(i===document.scrollingElement){const{innerWidth:r,innerHeight:o}=window;return{top:0,left:0,right:r,bottom:o,width:r,height:o}}const{top:e,left:t,right:n,bottom:s}=i.getBoundingClientRect();return{top:e,left:t,right:n,bottom:s,width:i.clientWidth,height:i.clientHeight}}function RLe(i){return i.reduce((e,t)=>xN(e,zG(t)),Sg)}function Nst(i){return i.reduce((e,t)=>e+DLe(t),0)}function Est(i){return i.reduce((e,t)=>e+TLe(t),0)}function Lst(i,e){if(e===void 0&&(e=qL),!i)return;const{top:t,left:n,bottom:s,right:r}=e(i);LLe(i)&&(s<=0||r<=0||t>=window.innerHeight||n>=window.innerWidth)&&i.scrollIntoView({block:"center",inline:"center"})}const Dst=[["x",["left","right"],Nst],["y",["top","bottom"],Est]];let $se=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=O7(t),s=RLe(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[r,o,a]of Dst)for(const l of o)Object.defineProperty(this,l,{get:()=>{const c=a(n),u=s[r]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}};class q2{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(t=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...t)})},this.target=e}add(e,t,n){var s;(s=this.target)==null||s.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Tst(i){const{EventTarget:e}=Fd(i);return i instanceof e?i:$L(i)}function MU(i,e){const t=Math.abs(i.x),n=Math.abs(i.y);return typeof e=="number"?Math.sqrt(t**2+n**2)>e:"x"in e&&"y"in e?t>e.x&&n>e.y:"x"in e?t>e.x:"y"in e?n>e.y:!1}var ah;(function(i){i.Click="click",i.DragStart="dragstart",i.Keydown="keydown",i.ContextMenu="contextmenu",i.Resize="resize",i.SelectionChange="selectionchange",i.VisibilityChange="visibilitychange"})(ah||(ah={}));function $pe(i){i.preventDefault()}function Ist(i){i.stopPropagation()}var es;(function(i){i.Space="Space",i.Down="ArrowDown",i.Right="ArrowRight",i.Left="ArrowLeft",i.Up="ArrowUp",i.Esc="Escape",i.Enter="Enter",i.Tab="Tab"})(es||(es={}));const MLe={start:[es.Space,es.Enter],cancel:[es.Esc],end:[es.Space,es.Enter,es.Tab]},Ast=(i,e)=>{let{currentCoordinates:t}=e;switch(i.code){case es.Right:return{...t,x:t.x+25};case es.Left:return{...t,x:t.x-25};case es.Down:return{...t,y:t.y+25};case es.Up:return{...t,y:t.y-25}}};class qse{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new q2($L(t)),this.windowListeners=new q2(Fd(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ah.Resize,this.handleCancel),this.windowListeners.add(ah.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ah.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Lst(n),t(Sg)}handleKeyDown(e){if(Use(e)){const{active:t,context:n,options:s}=this.props,{keyboardCodes:r=MLe,coordinateGetter:o=Ast,scrollBehavior:a="smooth"}=s,{code:l}=e;if(r.end.includes(l)){this.handleEnd(e);return}if(r.cancel.includes(l)){this.handleCancel(e);return}const{collisionRect:c}=n.current,u=c?{x:c.left,y:c.top}:Sg;this.referenceCoordinates||(this.referenceCoordinates=u);const h=o(e,{active:t,context:n.current,currentCoordinates:u});if(h){const g=SA(h,u),f={x:0,y:0},{scrollableAncestors:m}=n.current;for(const x of m){const v=e.code,{isTop:_,isRight:w,isLeft:k,isBottom:C,maxScroll:E,minScroll:D}=ALe(x),T=kst(x),I={x:Math.min(v===es.Right?T.right-T.width/2:T.right,Math.max(v===es.Right?T.left:T.left+T.width/2,h.x)),y:Math.min(v===es.Down?T.bottom-T.height/2:T.bottom,Math.max(v===es.Down?T.top:T.top+T.height/2,h.y))},R=v===es.Right&&!w||v===es.Left&&!k,P=v===es.Down&&!C||v===es.Up&&!_;if(R&&I.x!==h.x){const j=x.scrollLeft+g.x,B=v===es.Right&&j<=E.x||v===es.Left&&j>=D.x;if(B&&!g.y){x.scrollTo({left:j,behavior:a});return}B?f.x=x.scrollLeft-j:f.x=v===es.Right?x.scrollLeft-E.x:x.scrollLeft-D.x,f.x&&x.scrollBy({left:-f.x,behavior:a});break}else if(P&&I.y!==h.y){const j=x.scrollTop+g.y,B=v===es.Down&&j<=E.y||v===es.Up&&j>=D.y;if(B&&!g.x){x.scrollTo({top:j,behavior:a});return}B?f.y=x.scrollTop-j:f.y=v===es.Down?x.scrollTop-E.y:x.scrollTop-D.y,f.y&&x.scrollBy({top:-f.y,behavior:a});break}}this.handleMove(e,xN(SA(h,this.referenceCoordinates),f))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}qse.activators=[{eventName:"onKeyDown",handler:(i,e,t)=>{let{keyboardCodes:n=MLe,onActivation:s}=e,{active:r}=t;const{code:o}=i.nativeEvent;if(n.start.includes(o)){const a=r.activatorNode.current;return a&&i.target!==a?!1:(i.preventDefault(),s==null||s({event:i.nativeEvent}),!0)}return!1}}];function qpe(i){return!!(i&&"distance"in i)}function Kpe(i){return!!(i&&"delay"in i)}class Kse{constructor(e,t,n){var s;n===void 0&&(n=Tst(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:r}=e,{target:o}=r;this.props=e,this.events=t,this.document=$L(o),this.documentListeners=new q2(this.document),this.listeners=new q2(n),this.windowListeners=new q2(Fd(o)),this.initialCoordinates=(s=VG(r))!=null?s:Sg,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(ah.Resize,this.handleCancel),this.windowListeners.add(ah.DragStart,$pe),this.windowListeners.add(ah.VisibilityChange,this.handleCancel),this.windowListeners.add(ah.ContextMenu,$pe),this.documentListeners.add(ah.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Kpe(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(qpe(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:s}=this.props;s(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(ah.Click,Ist,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ah.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:s,props:r}=this,{onMove:o,options:{activationConstraint:a}}=r;if(!s)return;const l=(t=VG(e))!=null?t:Sg,c=SA(s,l);if(!n&&a){if(qpe(a)){if(a.tolerance!=null&&MU(c,a.tolerance))return this.handleCancel();if(MU(c,a.distance))return this.handleStart()}if(Kpe(a)&&MU(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}e.cancelable&&e.preventDefault(),o(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===es.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const Rst={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Gse extends Kse{constructor(e){const{event:t}=e,n=$L(t.target);super(e,Rst,n)}}Gse.activators=[{eventName:"onPointerDown",handler:(i,e)=>{let{nativeEvent:t}=i,{onActivation:n}=e;return!t.isPrimary||t.button!==0?!1:(n==null||n({event:t}),!0)}}];const Mst={move:{name:"mousemove"},end:{name:"mouseup"}};var UG;(function(i){i[i.RightClick=2]="RightClick"})(UG||(UG={}));class Pst extends Kse{constructor(e){super(e,Mst,$L(e.event.target))}}Pst.activators=[{eventName:"onMouseDown",handler:(i,e)=>{let{nativeEvent:t}=i,{onActivation:n}=e;return t.button===UG.RightClick?!1:(n==null||n({event:t}),!0)}}];const PU={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Ost extends Kse{constructor(e){super(e,PU)}static setup(){return window.addEventListener(PU.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(PU.move.name,e)};function e(){}}}Ost.activators=[{eventName:"onTouchStart",handler:(i,e)=>{let{nativeEvent:t}=i,{onActivation:n}=e;const{touches:s}=t;return s.length>1?!1:(n==null||n({event:t}),!0)}}];var K2;(function(i){i[i.Pointer=0]="Pointer",i[i.DraggableRect=1]="DraggableRect"})(K2||(K2={}));var Pj;(function(i){i[i.TreeOrder=0]="TreeOrder",i[i.ReversedTreeOrder=1]="ReversedTreeOrder"})(Pj||(Pj={}));function jst(i){let{acceleration:e,activator:t=K2.Pointer,canScroll:n,draggingRect:s,enabled:r,interval:o=5,order:a=Pj.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:h,threshold:g}=i;const f=Bst({delta:h,disabled:!r}),[m,x]=Yit(),v=L.useRef({x:0,y:0}),_=L.useRef({x:0,y:0}),w=L.useMemo(()=>{switch(t){case K2.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case K2.DraggableRect:return s}},[t,s,l]),k=L.useRef(null),C=L.useCallback(()=>{const D=k.current;if(!D)return;const T=v.current.x*_.current.x,I=v.current.y*_.current.y;D.scrollBy(T,I)},[]),E=L.useMemo(()=>a===Pj.TreeOrder?[...c].reverse():c,[a,c]);L.useEffect(()=>{if(!r||!c.length||!w){x();return}for(const D of E){if((n==null?void 0:n(D))===!1)continue;const T=c.indexOf(D),I=u[T];if(!I)continue;const{direction:R,speed:P}=Sst(D,I,w,e,g);for(const j of["x","y"])f[j][R[j]]||(P[j]=0,R[j]=0);if(P.x>0||P.y>0){x(),k.current=D,m(C,o),v.current=P,_.current=R;return}}v.current={x:0,y:0},_.current={x:0,y:0},x()},[e,C,n,x,r,o,JSON.stringify(w),JSON.stringify(f),m,c,E,u,JSON.stringify(g)])}const Fst={x:{[qa.Backward]:!1,[qa.Forward]:!1},y:{[qa.Backward]:!1,[qa.Forward]:!1}};function Bst(i){let{delta:e,disabled:t}=i;const n=WG(e);return tP(s=>{if(t||!n||!s)return Fst;const r={x:Math.sign(e.x-n.x),y:Math.sign(e.y-n.y)};return{x:{[qa.Backward]:s.x[qa.Backward]||r.x===-1,[qa.Forward]:s.x[qa.Forward]||r.x===1},y:{[qa.Backward]:s.y[qa.Backward]||r.y===-1,[qa.Forward]:s.y[qa.Forward]||r.y===1}}},[t,e,n])}function Hst(i,e){const t=e!=null?i.get(e):void 0,n=t?t.node.current:null;return tP(s=>{var r;return e==null?null:(r=n??s)!=null?r:null},[n,e])}function Wst(i,e){return L.useMemo(()=>i.reduce((t,n)=>{const{sensor:s}=n,r=s.activators.map(o=>({eventName:o.eventName,handler:e(o.handler,n)}));return[...t,...r]},[]),[i,e])}var NA;(function(i){i[i.Always=0]="Always",i[i.BeforeDragging=1]="BeforeDragging",i[i.WhileDragging=2]="WhileDragging"})(NA||(NA={}));var $G;(function(i){i.Optimized="optimized"})($G||($G={}));const Gpe=new Map;function Vst(i,e){let{dragging:t,dependencies:n,config:s}=e;const[r,o]=L.useState(null),{frequency:a,measure:l,strategy:c}=s,u=L.useRef(i),h=v(),g=CA(h),f=L.useCallback(function(_){_===void 0&&(_=[]),!g.current&&o(w=>w===null?_:w.concat(_.filter(k=>!w.includes(k))))},[g]),m=L.useRef(null),x=tP(_=>{if(h&&!t)return Gpe;if(!_||_===Gpe||u.current!==i||r!=null){const w=new Map;for(let k of i){if(!k)continue;if(r&&r.length>0&&!r.includes(k.id)&&k.rect.current){w.set(k.id,k.rect.current);continue}const C=k.node.current,E=C?new $se(l(C),C):null;k.rect.current=E,E&&w.set(k.id,E)}return w}return _},[i,r,t,h,l]);return L.useEffect(()=>{u.current=i},[i]),L.useEffect(()=>{h||f()},[t,h]),L.useEffect(()=>{r&&r.length>0&&o(null)},[JSON.stringify(r)]),L.useEffect(()=>{h||typeof a!="number"||m.current!==null||(m.current=setTimeout(()=>{f(),m.current=null},a))},[a,h,f,...n]),{droppableRects:x,measureDroppableContainers:f,measuringScheduled:r!=null};function v(){switch(c){case NA.Always:return!1;case NA.BeforeDragging:return t;default:return!t}}}function PLe(i,e){return tP(t=>i?t||(typeof e=="function"?e(i):i):null,[e,i])}function zst(i,e){return PLe(i,e)}function Ust(i){let{callback:e,disabled:t}=i;const n=zse(e),s=L.useMemo(()=>{if(t||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:r}=window;return new r(n)},[n,t]);return L.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function j7(i){let{callback:e,disabled:t}=i;const n=zse(e),s=L.useMemo(()=>{if(t||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:r}=window;return new r(n)},[t]);return L.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function $st(i){return new $se(qL(i),i)}function Ype(i,e,t){e===void 0&&(e=$st);const[n,s]=L.useState(null);function r(){s(l=>{if(!i)return null;if(i.isConnected===!1){var c;return(c=l??t)!=null?c:null}const u=e(i);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const o=Ust({callback(l){if(i)for(const c of l){const{type:u,target:h}=c;if(u==="childList"&&h instanceof HTMLElement&&h.contains(i)){r();break}}}}),a=j7({callback:r});return tp(()=>{r(),i?(a==null||a.observe(i),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[i]),n}function qst(i){const e=PLe(i);return ELe(i,e)}const Qpe=[];function Kst(i){const e=L.useRef(i),t=tP(n=>i?n&&n!==Qpe&&i&&e.current&&i.parentNode===e.current.parentNode?n:O7(i):Qpe,[i]);return L.useEffect(()=>{e.current=i},[i]),t}function Gst(i){const[e,t]=L.useState(null),n=L.useRef(i),s=L.useCallback(r=>{const o=RU(r.target);o&&t(a=>a?(a.set(o,zG(o)),new Map(a)):null)},[]);return L.useEffect(()=>{const r=n.current;if(i!==r){o(r);const a=i.map(l=>{const c=RU(l);return c?(c.addEventListener("scroll",s,{passive:!0}),[c,zG(c)]):null}).filter(l=>l!=null);t(a.length?new Map(a):null),n.current=i}return()=>{o(i),o(r)};function o(a){a.forEach(l=>{const c=RU(l);c==null||c.removeEventListener("scroll",s)})}},[s,i]),L.useMemo(()=>i.length?e?Array.from(e.values()).reduce((r,o)=>xN(r,o),Sg):RLe(i):Sg,[i,e])}function Xpe(i,e){e===void 0&&(e=[]);const t=L.useRef(null);return L.useEffect(()=>{t.current=null},e),L.useEffect(()=>{const n=i!==Sg;n&&!t.current&&(t.current=i),!n&&t.current&&(t.current=null)},[i]),t.current?SA(i,t.current):Sg}function Yst(i){L.useEffect(()=>{if(!P7)return;const e=i.map(t=>{let{sensor:n}=t;return n.setup==null?void 0:n.setup()});return()=>{for(const t of e)t==null||t()}},i.map(e=>{let{sensor:t}=e;return t}))}function Qst(i,e){return L.useMemo(()=>i.reduce((t,n)=>{let{eventName:s,handler:r}=n;return t[s]=o=>{r(o,e)},t},{}),[i,e])}function OLe(i){return L.useMemo(()=>i?_st(i):null,[i])}const Zpe=[];function Xst(i,e){e===void 0&&(e=qL);const[t]=i,n=OLe(t?Fd(t):null),[s,r]=L.useState(Zpe);function o(){r(()=>i.length?i.map(l=>ILe(l)?n:new $se(e(l),l)):Zpe)}const a=j7({callback:o});return tp(()=>{a==null||a.disconnect(),o(),i.forEach(l=>a==null?void 0:a.observe(l))},[i]),s}function Zst(i){if(!i)return null;if(i.children.length>1)return i;const e=i.children[0];return eP(e)?e:i}function Jst(i){let{measure:e}=i;const[t,n]=L.useState(null),s=L.useCallback(c=>{for(const{target:u}of c)if(eP(u)){n(h=>{const g=e(u);return h?{...h,width:g.width,height:g.height}:g});break}},[e]),r=j7({callback:s}),o=L.useCallback(c=>{const u=Zst(c);r==null||r.disconnect(),u&&(r==null||r.observe(u)),n(u?e(u):null)},[e,r]),[a,l]=Rj(o);return L.useMemo(()=>({nodeRef:a,rect:t,setRef:l}),[t,a,l])}const ert=[{sensor:Gse,options:{}},{sensor:qse,options:{}}],trt={current:{}},N4={draggable:{measure:Upe},droppable:{measure:Upe,strategy:NA.WhileDragging,frequency:$G.Optimized},dragOverlay:{measure:qL}};class G2 extends Map{get(e){var t;return e!=null&&(t=super.get(e))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return(t=(n=this.get(e))==null?void 0:n.node.current)!=null?t:void 0}}const nrt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new G2,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Mj},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:N4,measureDroppableContainers:Mj,windowRect:null,measuringScheduled:!1},irt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Mj,draggableNodes:new Map,over:null,measureDroppableContainers:Mj},F7=L.createContext(irt),jLe=L.createContext(nrt);function srt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new G2}}}function rrt(i,e){switch(e.type){case Ca.DragStart:return{...i,draggable:{...i.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Ca.DragMove:return i.draggable.active==null?i:{...i,draggable:{...i.draggable,translate:{x:e.coordinates.x-i.draggable.initialCoordinates.x,y:e.coordinates.y-i.draggable.initialCoordinates.y}}};case Ca.DragEnd:case Ca.DragCancel:return{...i,draggable:{...i.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ca.RegisterDroppable:{const{element:t}=e,{id:n}=t,s=new G2(i.droppable.containers);return s.set(n,t),{...i,droppable:{...i.droppable,containers:s}}}case Ca.SetDroppableDisabled:{const{id:t,key:n,disabled:s}=e,r=i.droppable.containers.get(t);if(!r||n!==r.key)return i;const o=new G2(i.droppable.containers);return o.set(t,{...r,disabled:s}),{...i,droppable:{...i.droppable,containers:o}}}case Ca.UnregisterDroppable:{const{id:t,key:n}=e,s=i.droppable.containers.get(t);if(!s||n!==s.key)return i;const r=new G2(i.droppable.containers);return r.delete(t),{...i,droppable:{...i.droppable,containers:r}}}default:return i}}function ort(i){let{disabled:e}=i;const{active:t,activatorEvent:n,draggableNodes:s}=L.useContext(F7),r=WG(n),o=WG(t==null?void 0:t.id);return L.useEffect(()=>{if(!e&&!n&&r&&o!=null){if(!Use(r)||document.activeElement===r.target)return;const a=s.get(o);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const h=Zit(u);if(h){h.focus();break}}})}},[n,e,s,o,r]),null}function art(i,e){let{transform:t,...n}=e;return i!=null&&i.length?i.reduce((s,r)=>r({transform:s,...n}),t):t}function lrt(i){return L.useMemo(()=>({draggable:{...N4.draggable,...i==null?void 0:i.draggable},droppable:{...N4.droppable,...i==null?void 0:i.droppable},dragOverlay:{...N4.dragOverlay,...i==null?void 0:i.dragOverlay}}),[i==null?void 0:i.draggable,i==null?void 0:i.droppable,i==null?void 0:i.dragOverlay])}function crt(i){let{activeNode:e,measure:t,initialRect:n,config:s=!0}=i;const r=L.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;tp(()=>{if(!o&&!a||!e){r.current=!1;return}if(r.current||!n)return;const c=e==null?void 0:e.node.current;if(!c||c.isConnected===!1)return;const u=t(c),h=ELe(u,n);if(o||(h.x=0),a||(h.y=0),r.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const g=LLe(c);g&&g.scrollBy({top:h.y,left:h.x})}},[e,o,a,n,t])}const FLe=L.createContext({...Sg,scaleX:1,scaleY:1});var $x;(function(i){i[i.Uninitialized=0]="Uninitialized",i[i.Initializing=1]="Initializing",i[i.Initialized=2]="Initialized"})($x||($x={}));const drt=L.memo(function(e){var t,n,s,r;let{id:o,accessibility:a,autoScroll:l=!0,children:c,sensors:u=ert,collisionDetection:h=gst,measuring:g,modifiers:f,...m}=e;const x=L.useReducer(rrt,void 0,srt),[v,_]=x,[w,k]=sst(),[C,E]=L.useState($x.Uninitialized),D=C===$x.Initialized,{draggable:{active:T,nodes:I,translate:R},droppable:{containers:P}}=v,j=T!=null?I.get(T):null,B=L.useRef({initial:null,translated:null}),U=L.useMemo(()=>{var _s;return T!=null?{id:T,data:(_s=j==null?void 0:j.data)!=null?_s:trt,rect:B}:null},[T,j]),$=L.useRef(null),[K,z]=L.useState(null),[G,ne]=L.useState(null),te=CA(m,Object.values(m)),H=nP("DndDescribedBy",o),Q=L.useMemo(()=>P.getEnabled(),[P]),Y=lrt(g),{droppableRects:V,measureDroppableContainers:ue,measuringScheduled:he}=Vst(Q,{dragging:D,dependencies:[R.x,R.y],config:Y.droppable}),Te=Hst(I,T),nt=L.useMemo(()=>G?VG(G):null,[G]),ge=qc(),_e=zst(Te,Y.draggable.measure);crt({activeNode:T!=null?I.get(T):null,config:ge.layoutShiftCompensation,initialRect:_e,measure:Y.draggable.measure});const $e=Ype(Te,Y.draggable.measure,_e),Ke=Ype(Te?Te.parentElement:null),ht=L.useRef({activatorEvent:null,active:null,activeNode:Te,collisionRect:null,collisions:null,droppableRects:V,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ct=P.getNodeFor((t=ht.current.over)==null?void 0:t.id),Ft=Jst({measure:Y.dragOverlay.measure}),Ve=(n=Ft.nodeRef.current)!=null?n:Te,tt=D?(s=Ft.rect)!=null?s:$e:null,qt=!!(Ft.nodeRef.current&&Ft.rect),It=qst(qt?null:$e),Zt=OLe(Ve?Fd(Ve):null),En=Kst(D?Ct??Te:null),Xi=Xst(En),zi=art(f,{transform:{x:R.x-It.x,y:R.y-It.y,scaleX:1,scaleY:1},activatorEvent:G,active:U,activeNodeRect:$e,containerNodeRect:Ke,draggingNodeRect:tt,over:ht.current.over,overlayNodeRect:Ft.rect,scrollableAncestors:En,scrollableAncestorRects:Xi,windowRect:Zt}),Tr=nt?xN(nt,R):null,Fs=Gst(En),qo=Xpe(Fs),Ge=Xpe(Fs,[$e]),mt=xN(zi,qo),tn=tt?mst(tt,zi):null,Ln=U&&tn?h({active:U,collisionRect:tn,droppableRects:V,droppableContainers:Q,pointerCoordinates:Tr}):null,Un=NLe(Ln,"id"),[vs,_r]=L.useState(null),Js=qt?zi:xN(zi,Ge),Ei=fst(Js,(r=vs==null?void 0:vs.rect)!=null?r:null,$e),wi=L.useRef(null),ii=L.useCallback((_s,ys)=>{let{sensor:on,options:Nn}=ys;if($.current==null)return;const vn=I.get($.current);if(!vn)return;const Ci=_s.nativeEvent,zr=new on({active:$.current,activeNode:vn,event:Ci,options:Nn,context:ht,onAbort(Si){if(!I.get(Si))return;const{onDragAbort:Bs}=te.current,Ai={id:Si};Bs==null||Bs(Ai),w({type:"onDragAbort",event:Ai})},onPending(Si,bo,Bs,Ai){if(!I.get(Si))return;const{onDragPending:lr}=te.current,Oa={id:Si,constraint:bo,initialCoordinates:Bs,offset:Ai};lr==null||lr(Oa),w({type:"onDragPending",event:Oa})},onStart(Si){const bo=$.current;if(bo==null)return;const Bs=I.get(bo);if(!Bs)return;const{onDragStart:Ai}=te.current,ws={activatorEvent:Ci,active:{id:bo,data:Bs.data,rect:B}};hg.unstable_batchedUpdates(()=>{Ai==null||Ai(ws),E($x.Initializing),_({type:Ca.DragStart,initialCoordinates:Si,active:bo}),w({type:"onDragStart",event:ws}),z(wi.current),ne(Ci)})},onMove(Si){_({type:Ca.DragMove,coordinates:Si})},onEnd:Ii(Ca.DragEnd),onCancel:Ii(Ca.DragCancel)});wi.current=zr;function Ii(Si){return async function(){const{active:Bs,collisions:Ai,over:ws,scrollAdjustedTranslate:lr}=ht.current;let Oa=null;if(Bs&&lr){const{cancelDrop:gc}=te.current;Oa={activatorEvent:Ci,active:Bs,collisions:Ai,delta:lr,over:ws},Si===Ca.DragEnd&&typeof gc=="function"&&await Promise.resolve(gc(Oa))&&(Si=Ca.DragCancel)}$.current=null,hg.unstable_batchedUpdates(()=>{_({type:Si}),E($x.Uninitialized),_r(null),z(null),ne(null),wi.current=null;const gc=Si===Ca.DragEnd?"onDragEnd":"onDragCancel";if(Oa){const xa=te.current[gc];xa==null||xa(Oa),w({type:gc,event:Oa})}})}}},[I]),Ko=L.useCallback((_s,ys)=>(on,Nn)=>{const vn=on.nativeEvent,Ci=I.get(Nn);if($.current!==null||!Ci||vn.dndKit||vn.defaultPrevented)return;const zr={active:Ci};_s(on,ys.options,zr)===!0&&(vn.dndKit={capturedBy:ys.sensor},$.current=Nn,ii(on,ys))},[I,ii]),Vr=Wst(u,Ko);Yst(u),tp(()=>{$e&&C===$x.Initializing&&E($x.Initialized)},[$e,C]),L.useEffect(()=>{const{onDragMove:_s}=te.current,{active:ys,activatorEvent:on,collisions:Nn,over:vn}=ht.current;if(!ys||!on)return;const Ci={active:ys,activatorEvent:on,collisions:Nn,delta:{x:mt.x,y:mt.y},over:vn};hg.unstable_batchedUpdates(()=>{_s==null||_s(Ci),w({type:"onDragMove",event:Ci})})},[mt.x,mt.y]),L.useEffect(()=>{const{active:_s,activatorEvent:ys,collisions:on,droppableContainers:Nn,scrollAdjustedTranslate:vn}=ht.current;if(!_s||$.current==null||!ys||!vn)return;const{onDragOver:Ci}=te.current,zr=Nn.get(Un),Ii=zr&&zr.rect.current?{id:zr.id,rect:zr.rect.current,data:zr.data,disabled:zr.disabled}:null,Si={active:_s,activatorEvent:ys,collisions:on,delta:{x:vn.x,y:vn.y},over:Ii};hg.unstable_batchedUpdates(()=>{_r(Ii),Ci==null||Ci(Si),w({type:"onDragOver",event:Si})})},[Un]),tp(()=>{ht.current={activatorEvent:G,active:U,activeNode:Te,collisionRect:tn,collisions:Ln,droppableRects:V,draggableNodes:I,draggingNode:Ve,draggingNodeRect:tt,droppableContainers:P,over:vs,scrollableAncestors:En,scrollAdjustedTranslate:mt},B.current={initial:tt,translated:tn}},[U,Te,Ln,tn,I,Ve,tt,V,P,vs,En,mt]),jst({...ge,delta:R,draggingRect:tn,pointerCoordinates:Tr,scrollableAncestors:En,scrollableAncestorRects:Xi});const ba=L.useMemo(()=>({active:U,activeNode:Te,activeNodeRect:$e,activatorEvent:G,collisions:Ln,containerNodeRect:Ke,dragOverlay:Ft,draggableNodes:I,droppableContainers:P,droppableRects:V,over:vs,measureDroppableContainers:ue,scrollableAncestors:En,scrollableAncestorRects:Xi,measuringConfiguration:Y,measuringScheduled:he,windowRect:Zt}),[U,Te,$e,G,Ln,Ke,Ft,I,P,V,vs,ue,En,Xi,Y,he,Zt]),ll=L.useMemo(()=>({activatorEvent:G,activators:Vr,active:U,activeNodeRect:$e,ariaDescribedById:{draggable:H},dispatch:_,draggableNodes:I,over:vs,measureDroppableContainers:ue}),[G,Vr,U,$e,_,H,I,vs,ue]);return ft.createElement(CLe.Provider,{value:k},ft.createElement(F7.Provider,{value:ll},ft.createElement(jLe.Provider,{value:ba},ft.createElement(FLe.Provider,{value:Ei},c)),ft.createElement(ort,{disabled:(a==null?void 0:a.restoreFocus)===!1})),ft.createElement(ast,{...a,hiddenTextDescribedById:H}));function qc(){const _s=(K==null?void 0:K.autoScrollEnabled)===!1,ys=typeof l=="object"?l.enabled===!1:l===!1,on=D&&!_s&&!ys;return typeof l=="object"?{...l,enabled:on}:{enabled:on}}}),urt=L.createContext(null),Jpe="button",hrt="Draggable";function grt(i){let{id:e,data:t,disabled:n=!1,attributes:s}=i;const r=nP(hrt),{activators:o,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:h,over:g}=L.useContext(F7),{role:f=Jpe,roleDescription:m="draggable",tabIndex:x=0}=s??{},v=(l==null?void 0:l.id)===e,_=L.useContext(v?FLe:urt),[w,k]=Rj(),[C,E]=Rj(),D=Qst(o,e),T=CA(t);tp(()=>(h.set(e,{id:e,key:r,node:w,activatorNode:C,data:T}),()=>{const R=h.get(e);R&&R.key===r&&h.delete(e)}),[h,e]);const I=L.useMemo(()=>({role:f,tabIndex:x,"aria-disabled":n,"aria-pressed":v&&f===Jpe?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[n,f,x,v,m,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:I,isDragging:v,listeners:n?void 0:D,node:w,over:g,setNodeRef:k,setActivatorNodeRef:E,transform:_}}function frt(){return L.useContext(jLe)}const prt="Droppable",mrt={timeout:25};function brt(i){let{data:e,disabled:t=!1,id:n,resizeObserverConfig:s}=i;const r=nP(prt),{active:o,dispatch:a,over:l,measureDroppableContainers:c}=L.useContext(F7),u=L.useRef({disabled:t}),h=L.useRef(!1),g=L.useRef(null),f=L.useRef(null),{disabled:m,updateMeasurementsFor:x,timeout:v}={...mrt,...s},_=CA(x??n),w=L.useCallback(()=>{if(!h.current){h.current=!0;return}f.current!=null&&clearTimeout(f.current),f.current=setTimeout(()=>{c(Array.isArray(_.current)?_.current:[_.current]),f.current=null},v)},[v]),k=j7({callback:w,disabled:m||!o}),C=L.useCallback((I,R)=>{k&&(R&&(k.unobserve(R),h.current=!1),I&&k.observe(I))},[k]),[E,D]=Rj(C),T=CA(e);return L.useEffect(()=>{!k||!E.current||(k.disconnect(),h.current=!1,k.observe(E.current))},[E,k]),L.useEffect(()=>(a({type:Ca.RegisterDroppable,element:{id:n,key:r,disabled:t,node:E,rect:g,data:T}}),()=>a({type:Ca.UnregisterDroppable,key:r,id:n})),[n]),L.useEffect(()=>{t!==u.current.disabled&&(a({type:Ca.SetDroppableDisabled,id:n,key:r,disabled:t}),u.current.disabled=t)},[n,r,t,a]),{active:o,rect:g,isOver:(l==null?void 0:l.id)===n,node:E,over:l,setNodeRef:D}}function Yse(i,e,t){const n=i.slice();return n.splice(t<0?n.length+t:t,0,n.splice(e,1)[0]),n}function xrt(i,e){return i.reduce((t,n,s)=>{const r=e.get(n);return r&&(t[s]=r),t},Array(i.length))}function E5(i){return i!==null&&i>=0}function vrt(i,e){if(i===e)return!0;if(i.length!==e.length)return!1;for(let t=0;t{let{rects:e,activeIndex:t,overIndex:n,index:s}=i;const r=Yse(e,n,t),o=e[s],a=r[s];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},L5={scaleX:1,scaleY:1},yrt=i=>{var e;let{activeIndex:t,activeNodeRect:n,index:s,rects:r,overIndex:o}=i;const a=(e=r[t])!=null?e:n;if(!a)return null;if(s===t){const c=r[o];return c?{x:0,y:tt&&s<=o?{x:0,y:-a.height-l,...L5}:s=o?{x:0,y:a.height+l,...L5}:{x:0,y:0,...L5}};function wrt(i,e,t){const n=i[e],s=i[e-1],r=i[e+1];return n?tn.map(D=>typeof D=="object"&&"id"in D?D.id:D),[n]),m=o!=null,x=o?f.indexOf(o.id):-1,v=c?f.indexOf(c.id):-1,_=L.useRef(f),w=!vrt(f,_.current),k=v!==-1&&x===-1||w,C=_rt(r);tp(()=>{w&&m&&u(f)},[w,f,m,u]),L.useEffect(()=>{_.current=f},[f]);const E=L.useMemo(()=>({activeIndex:x,containerId:h,disabled:C,disableTransforms:k,items:f,overIndex:v,useDragOverlay:g,sortedRects:xrt(f,l),strategy:s}),[x,h,C.draggable,C.droppable,k,f,v,l,g,s]);return ft.createElement(WLe.Provider,{value:E},e)}const Srt=i=>{let{id:e,items:t,activeIndex:n,overIndex:s}=i;return Yse(t,n,s).indexOf(e)},krt=i=>{let{containerId:e,isSorting:t,wasDragging:n,index:s,items:r,newIndex:o,previousItems:a,previousContainerId:l,transition:c}=i;return!c||!n||a!==r&&s===o?!1:t?!0:o!==s&&e===l},Nrt={duration:200,easing:"ease"},VLe="transform",Ert=kA.Transition.toString({property:VLe,duration:0,easing:"linear"}),Lrt={roleDescription:"sortable"};function Drt(i){let{disabled:e,index:t,node:n,rect:s}=i;const[r,o]=L.useState(null),a=L.useRef(t);return tp(()=>{if(!e&&t!==a.current&&n.current){const l=s.current;if(l){const c=qL(n.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&o(u)}}t!==a.current&&(a.current=t)},[e,t,n,s]),L.useEffect(()=>{r&&o(null)},[r]),r}function Trt(i){let{animateLayoutChanges:e=krt,attributes:t,disabled:n,data:s,getNewIndex:r=Srt,id:o,strategy:a,resizeObserverConfig:l,transition:c=Nrt}=i;const{items:u,containerId:h,activeIndex:g,disabled:f,disableTransforms:m,sortedRects:x,overIndex:v,useDragOverlay:_,strategy:w}=L.useContext(WLe),k=Irt(n,f),C=u.indexOf(o),E=L.useMemo(()=>({sortable:{containerId:h,index:C,items:u},...s}),[h,s,C,u]),D=L.useMemo(()=>u.slice(u.indexOf(o)),[u,o]),{rect:T,node:I,isOver:R,setNodeRef:P}=brt({id:o,data:E,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...l}}),{active:j,activatorEvent:B,activeNodeRect:U,attributes:$,setNodeRef:K,listeners:z,isDragging:G,over:ne,setActivatorNodeRef:te,transform:H}=grt({id:o,data:E,attributes:{...Lrt,...t},disabled:k.draggable}),Q=Git(P,K),Y=!!j,V=Y&&!m&&E5(g)&&E5(v),ue=!_&&G,he=ue&&V?H:null,nt=V?he??(a??w)({rects:x,activeNodeRect:U,activeIndex:g,overIndex:v,index:C}):null,ge=E5(g)&&E5(v)?r({id:o,items:u,activeIndex:g,overIndex:v}):C,_e=j==null?void 0:j.id,$e=L.useRef({activeId:_e,items:u,newIndex:ge,containerId:h}),Ke=u!==$e.current.items,ht=e({active:j,containerId:h,isDragging:G,isSorting:Y,id:o,index:C,items:u,newIndex:$e.current.newIndex,previousItems:$e.current.items,previousContainerId:$e.current.containerId,transition:c,wasDragging:$e.current.activeId!=null}),Ct=Drt({disabled:!ht,index:C,node:I,rect:T});return L.useEffect(()=>{Y&&$e.current.newIndex!==ge&&($e.current.newIndex=ge),h!==$e.current.containerId&&($e.current.containerId=h),u!==$e.current.items&&($e.current.items=u)},[Y,ge,h,u]),L.useEffect(()=>{if(_e===$e.current.activeId)return;if(_e!=null&&$e.current.activeId==null){$e.current.activeId=_e;return}const Ve=setTimeout(()=>{$e.current.activeId=_e},50);return()=>clearTimeout(Ve)},[_e]),{active:j,activeIndex:g,attributes:$,data:E,rect:T,index:C,newIndex:ge,items:u,isOver:R,isSorting:Y,isDragging:G,listeners:z,node:I,overIndex:v,over:ne,setNodeRef:Q,setActivatorNodeRef:te,setDroppableNodeRef:P,setDraggableNodeRef:K,transform:Ct??nt,transition:Ft()};function Ft(){if(Ct||Ke&&$e.current.newIndex===C)return Ert;if(!(ue&&!Use(B)||!c)&&(Y||ht))return kA.Transition.toString({...c,property:VLe})}}function Irt(i,e){var t,n;return typeof i=="boolean"?{draggable:i,droppable:!1}:{draggable:(t=i==null?void 0:i.draggable)!=null?t:e.draggable,droppable:(n=i==null?void 0:i.droppable)!=null?n:e.droppable}}function Oj(i){if(!i)return!1;const e=i.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const Art=[es.Down,es.Right,es.Up,es.Left],Rrt=(i,e)=>{let{context:{active:t,collisionRect:n,droppableRects:s,droppableContainers:r,over:o,scrollableAncestors:a}}=e;if(Art.includes(i.code)){if(i.preventDefault(),!t||!n)return;const l=[];r.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const g=s.get(h.id);if(g)switch(i.code){case es.Down:n.topg.top&&l.push(h);break;case es.Left:n.left>g.left&&l.push(h);break;case es.Right:n.left1&&(u=c[1].id),u!=null){const h=r.get(t.id),g=r.get(u),f=g?s.get(g.id):null,m=g==null?void 0:g.node.current;if(m&&f&&h&&g){const v=O7(m).some((D,T)=>a[T]!==D),_=zLe(h,g),w=Mrt(h,g),k=v||!_?{x:0,y:0}:{x:w?n.width-f.width:0,y:w?n.height-f.height:0},C={x:f.left,y:f.top};return k.x&&k.y?C:SA(C,k)}}}};function zLe(i,e){return!Oj(i)||!Oj(e)?!1:i.data.current.sortable.containerId===e.data.current.sortable.containerId}function Mrt(i,e){return!Oj(i)||!Oj(e)||!zLe(i,e)?!1:i.data.current.sortable.indexnme(e.type)-nme(t.type))}function Brt(i){try{const e=i.startsWith("eddi://")?i.replace("eddi://","http://"):i,n=new URL(e,"http://dummy").pathname.split("/").filter(Boolean);if(n.length>=3){const s={rulestore:"rules",apicallstore:"apicalls",llmstore:"llm",outputstore:"output",dictionarystore:"dictionary",propertysetterstore:"propertysetter",mcpcallsstore:"mcpcalls",ragstore:"rag",snippetstore:"snippets"},r=n[0],o=n[2];if(r&&o)return{slug:s[r]??r,id:o}}}catch{}return null}function Hrt({items:i,onChange:e,onRemove:t,disabled:n=!1,workflowId:s,workflowVersion:r,agentId:o,agentVer:a,latestVersions:l,onUpdateVersion:c}){const{t:u}=xe(),h=lst(Wpe(Gse,{activationConstraint:{distance:5}}),Wpe(qse,{coordinateGetter:Rrt}));function g(f){const{active:m,over:x}=f;if(x&&m.id!==x.id){const v=i.findIndex(w=>w.id===m.id),_=i.findIndex(w=>w.id===x.id);v!==-1&&_!==-1&&e(Yse(i,v,_))}}return i.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground","data-testid":"pipeline-empty",children:[d.jsx(OM,{className:"h-10 w-10 opacity-50"}),d.jsx("p",{className:"mt-3 text-sm",children:u("packageEditor.noTasks","No tasks in this workflow")}),d.jsx("p",{className:"mt-1 text-xs text-muted-foreground/70",children:u("packageEditor.addHint","Add tasks to build your processing pipeline")})]}):d.jsx(drt,{sensors:h,collisionDetection:dst,onDragEnd:g,children:d.jsx(Crt,{items:i.map(f=>f.id),strategy:yrt,children:d.jsx("div",{className:"divide-y divide-border","data-testid":"pipeline-list",role:"list","aria-label":u("packageEditor.pipeline","Pipeline"),children:i.map((f,m)=>d.jsx(Wrt,{item:f,position:m+1,total:i.length,onRemove:()=>t(f.index),disabled:n,workflowId:s,workflowVersion:r,agentId:o,agentVer:a,latestVersions:l,onUpdateVersion:c},f.id))})})})}function Wrt({item:i,position:e,total:t,onRemove:n,disabled:s,workflowId:r,workflowVersion:o,agentId:a,agentVer:l,latestVersions:c,onUpdateVersion:u}){var U;const{t:h}=xe(),{attributes:g,listeners:f,setNodeRef:m,transform:x,transition:v,isDragging:_}=Trt({id:i.id,disabled:s}),w={transform:kA.Transform.toString(x),transition:v,opacity:_?.5:1,zIndex:_?50:void 0},k=i.extension,C=VE(k.type),E=qG(k.type),D=(U=k.config)==null?void 0:U.uri,T=D?Brt(D):null;let I=!1,R=0,P=0;if(D&&T&&c){const $=D.match(/[?&]version=(\d+)/);R=$?parseInt($[1],10):1,P=c[T.id]??R,I=P>R}function j(){if(!D||!u)return;const $=D.replace(/([?&]version=)\d+/,`$1${P}`);u(i.index,$)}const B=T?(()=>{let $=`/manage/resources/${T.slug}/${T.id}`;const K=new URLSearchParams;r&&o&&(K.set("wfId",r),K.set("wfVer",String(o))),a&&K.set("agentId",a),l&&K.set("agentVer",l);const z=K.toString();return z&&($+=`?${z}`),$})():null;return d.jsxs("div",{ref:m,style:w,className:`group flex items-center gap-3 px-5 py-3 transition-colors ${_?"bg-primary/5 shadow-lg rounded-lg":I?"bg-amber-50/50 dark:bg-amber-900/10 hover:bg-amber-50 dark:hover:bg-amber-900/20":"hover:bg-secondary/50"}`,role:"listitem","data-testid":`pipeline-item-${i.index}`,children:[d.jsx("button",{...g,...f,className:"cursor-grab rounded-md p-1 text-muted-foreground hover:bg-secondary active:cursor-grabbing disabled:cursor-not-allowed disabled:opacity-50",tabIndex:0,"aria-label":h("packageEditor.reorder","Reorder task"),disabled:s,children:d.jsx(p7e,{className:"h-4 w-4"})}),d.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-bold text-primary",children:e}),d.jsx(C,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),B?d.jsxs(Kn,{to:B,className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:E}),d.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[d.jsx("span",{className:"text-xs text-muted-foreground truncate",children:T.id}),d.jsxs("span",{className:"inline-flex items-center rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:["v",R]})]})]}):d.jsx("div",{className:"min-w-0 flex-1",children:d.jsx("p",{className:"text-sm font-medium text-foreground",children:E})}),d.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[I&&d.jsxs("button",{onClick:j,disabled:s,className:"inline-flex items-center gap-1 rounded-md bg-amber-100 px-1.5 py-0.5 text-[10px] font-semibold text-amber-800 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50 transition-colors shrink-0",title:h("packageEditor.updateToLatest","Update to latest version"),"data-testid":`update-version-${i.index}`,children:[d.jsx(NSe,{className:"h-3 w-3"}),"v",P]}),B&&d.jsxs(Kn,{to:B,className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-1 text-xs font-medium text-primary hover:bg-primary/20 transition-colors",children:[d.jsx(To,{className:"h-3 w-3"}),h("common.edit","Edit")]}),d.jsx("button",{onClick:n,disabled:s,className:"rounded-md p-1.5 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors disabled:opacity-50",title:h("common.delete"),"data-testid":`remove-ext-${i.index}`,children:d.jsx(_n,{className:"h-4 w-4"})})]}),e{const e=await Prt(i),t=new Set(e.map(n=>n.type));for(const n of zrt)t.has(n.type)||e.push(n);return e},staleTime:300*1e3})}const $Le=[{slug:"rules",store:"rulestore",plural:"rulesets",extension:"ai.labs.rules",labelKey:"resources.types.rules",icon:"GitBranch"},{slug:"apicalls",store:"apicallstore",plural:"apicalls",extension:"ai.labs.apicalls",labelKey:"resources.types.apicalls",icon:"Globe"},{slug:"output",store:"outputstore",plural:"outputsets",extension:"ai.labs.output",labelKey:"resources.types.output",icon:"MessageSquareText"},{slug:"dictionary",store:"dictionarystore",plural:"dictionaries",extension:"ai.labs.dictionary",labelKey:"resources.types.dictionary",icon:"BookOpen"},{slug:"llm",store:"llmstore",plural:"llms",extension:"ai.labs.llm",labelKey:"resources.types.llm",icon:"Brain"},{slug:"propertysetter",store:"propertysetterstore",plural:"propertysetters",extension:"ai.labs.property",labelKey:"resources.types.propertysetter",icon:"Settings"},{slug:"mcpcalls",store:"mcpcallsstore",plural:"mcpcalls",extension:"ai.labs.mcpcalls",labelKey:"resources.types.mcpcalls",icon:"Plug"},{slug:"rag",store:"ragstore",plural:"rags",extension:"ai.labs.rag",labelKey:"resources.types.rag",icon:"BookOpenCheck"},{slug:"snippets",store:"snippetstore",plural:"snippets",extension:"ai.labs.snippet",labelKey:"resources.types.snippets",icon:"Puzzle"}];function KL(i){return $Le.find(e=>e.slug===i)}function ab(i){return`/${i.store}/${i.plural}`}function qLe(i,e=100,t=0,n=""){const s=new URLSearchParams({limit:String(e),index:String(t)});return n&&s.set("filter",n),Oe.get(`${ab(i)}/descriptors?${s.toString()}`)}function KLe(i,e,t){return Oe.get(`${ab(i)}/${e}?version=${t}`)}function GLe(i,e={}){return Oe.post(ab(i),e)}function $rt(i,e,t,n){return Oe.put(`${ab(i)}/${e}?version=${t}`,n)}function qrt(i,e,t,n){const s=new URLSearchParams({version:String(t)});return Oe.delete(`${ab(i)}/${e}?${s}`)}function Krt(i,e,t){return Oe.post(`${ab(i)}/${e}?version=${t}`)}async function Grt(i,e){let t=null;try{t=await Oe.get(`${ab(i)}/${e}/currentversion`)??null}catch{}if(t!==null&&t>0){const r=(await Promise.all(Array.from({length:t},(o,a)=>a+1).map(async o=>{try{return await Oe.get(`${ab(i)}/descriptors?filter=${e}&version=${o}`)}catch{return[]}}))).flat();if(r.length>0)return r}return(await Oe.get(`${ab(i)}/descriptors?filter=${e}`)).filter(s=>{var r;return(r=s.resource)==null?void 0:r.includes(`/${e}`)})}function Yrt(i,e,t){return`eddi://${{dictionary:"ai.labs.dictionary",rules:"ai.labs.rules",apicalls:"ai.labs.apicalls",llm:"ai.labs.llm",output:"ai.labs.output",propertysetter:"ai.labs.property",mcpcalls:"ai.labs.mcpcalls"}[i.slug]??`ai.labs.${i.slug}`}/${i.store}/${i.plural}/${e}?version=${t}`}function Qrt({open:i,onClose:e,onSelect:t}){const{t:n}=xe(),[s,r]=L.useState(""),{data:o,isLoading:a}=Urt(),[l,c]=L.useState("pick-type"),[u,h]=L.useState(null),[g,f]=L.useState(null),[m,x]=L.useState([]),[v,_]=L.useState(!1),[w,k]=L.useState(!1),C=L.useCallback(()=>{c("pick-type"),h(null),f(null),x([]),r(""),_(!1),k(!1)},[]),E=L.useCallback(()=>{C(),e()},[e,C]);L.useEffect(()=>{if(!i)return;function j(B){B.key==="Escape"&&E()}return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[i,E]);const D=L.useCallback(async j=>{const B=tme(j.type);if(!B){t({descriptor:j}),E();return}const U=KL(B);if(!U){t({descriptor:j}),E();return}h(j),f(U),c("pick-resource"),_(!0);try{const K=(await qLe(U,200,0,"")).map(z=>{const{id:G,version:ne}=uo(z.resource);return{id:G,version:ne,name:z.name||G,lastModifiedOn:z.lastModifiedOn,resource:z.resource}});x(K)}catch{x([])}finally{_(!1)}},[t,E]),T=L.useCallback(async()=>{if(!(!u||!g)){k(!0);try{const j=await GLe(g,{}),B=new URL(j.location,"http://dummy"),U=B.pathname.split("/").filter(Boolean),$=U[U.length-1],K=parseInt(B.searchParams.get("version")||"1",10),z=Yrt(g,$,K);ze.success(n("packageEditor.configCreated","Config created — added to pipeline")),t({descriptor:u,configUri:z}),E()}catch(j){ze.error(Vs(j))}finally{k(!1)}}},[u,g,t,E,n]),I=L.useCallback(j=>{u&&(t({descriptor:u,configUri:j.resource}),E())},[u,t,E]);if(!i)return null;const R=Frt(o??[]),P=s?R.filter(j=>j.displayName.toLowerCase().includes(s.toLowerCase())||j.type.toLowerCase().includes(s.toLowerCase())):R;return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center","data-testid":"add-extension-dialog",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:E,"aria-hidden":"true"}),d.jsxs("div",{className:"relative z-10 w-full max-w-md rounded-xl border bg-card shadow-xl mx-4",role:"dialog","aria-modal":"true","aria-labelledby":"add-ext-dialog-title",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border p-5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[l==="pick-resource"?d.jsx("button",{onClick:()=>{c("pick-type"),h(null),f(null),r("")},className:"rounded-md p-1 text-muted-foreground hover:bg-secondary transition-colors","data-testid":"back-to-types",children:d.jsx(El,{className:"h-5 w-5"})}):d.jsx(Gt,{className:"h-5 w-5 text-primary"}),d.jsx("h3",{id:"add-ext-dialog-title",className:"text-lg font-semibold text-foreground",children:l==="pick-type"?n("packageEditor.addTask","Add Task"):n("packageEditor.chooseConfig","Choose Config")})]}),d.jsx("button",{onClick:E,className:"rounded-md p-1 text-muted-foreground hover:bg-secondary transition-colors","aria-label":n("common.close","Close"),children:d.jsx(An,{className:"h-5 w-5","aria-hidden":"true"})})]}),l==="pick-type"&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"p-4 pb-0",children:d.jsx("input",{type:"text",value:s,onChange:j=>r(j.target.value),placeholder:n("common.search"),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"extension-search",autoFocus:!0})}),d.jsxs("div",{className:"max-h-80 divide-y divide-border overflow-y-auto p-2",children:[a&&d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx(xi,{className:"h-5 w-5 animate-spin text-primary"})}),!a&&P.length===0&&d.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:n("common.noResults")}),P.map(j=>{const B=VE(j.type),U=qG(j.type),$=!!tme(j.type);return d.jsxs("button",{onClick:()=>D(j),className:"flex w-full items-center gap-3 rounded-lg px-3 py-3 text-start hover:bg-secondary/70 transition-colors","data-testid":`ext-option-${j.type}`,children:[d.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10",children:d.jsx(B,{className:"h-5 w-5 text-primary"})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-sm font-medium text-foreground",children:U}),d.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:[j.type,!$&&d.jsx("span",{className:"ms-1 text-muted-foreground/60",children:"(embedded config)"})]})]}),d.jsx(Gt,{className:"h-4 w-4 shrink-0 text-primary"})]},j.type)})]}),d.jsx("div",{className:"border-t border-border p-3",children:d.jsx("p",{className:"text-xs text-center text-muted-foreground",children:n("packageEditor.addHintDialog","Select a task type to add to the pipeline")})})]}),l==="pick-resource"&&u&&g&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"border-b border-border p-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[(()=>{const j=VE(u.type);return d.jsx(j,{className:"h-4 w-4 text-primary"})})(),d.jsx("span",{className:"text-sm font-medium text-foreground",children:qG(u.type)})]}),d.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:n("packageEditor.chooseConfigHint","Create a new config or link an existing one")})]}),d.jsxs("div",{className:"p-4 space-y-3",children:[d.jsxs("button",{onClick:T,disabled:w,className:"flex w-full items-center gap-3 rounded-xl border-2 border-dashed border-primary/30 bg-primary/5 px-4 py-4 text-start hover:bg-primary/10 hover:border-primary/50 transition-all disabled:opacity-50","data-testid":"create-new-config",children:[d.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/15",children:d.jsx(t7e,{className:"h-5 w-5 text-primary"})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-sm font-semibold text-foreground",children:n("packageEditor.createNewConfig","Create New Config")}),d.jsx("p",{className:"text-xs text-muted-foreground",children:n("packageEditor.createNewConfigHint","Creates an empty config you can edit later")})]}),w&&d.jsx(xi,{className:"h-4 w-4 animate-spin text-primary"})]}),(m.length>0||v)&&d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"h-px flex-1 bg-border"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:n("packageEditor.orExisting","or use existing")}),d.jsx("div",{className:"h-px flex-1 bg-border"})]}),v&&d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsx(xi,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!v&&m.length>0&&d.jsx("div",{className:"max-h-48 divide-y divide-border overflow-y-auto rounded-lg border border-border",children:m.map(j=>d.jsxs("button",{onClick:()=>I(j),className:"flex w-full items-center gap-3 px-3 py-2.5 text-start hover:bg-secondary/70 transition-colors","data-testid":`existing-resource-${j.id}`,children:[d.jsx(c7e,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:j.name}),d.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:[j.id," · v",j.version]})]})]},`${j.id}-${j.version}`))}),!v&&m.length===0&&d.jsx("p",{className:"text-xs text-center text-muted-foreground py-2",children:n("packageEditor.noExistingConfigs","No existing configs found — create a new one above")})]})]})]})]})}function YLe(i){L.useEffect(()=>{if(!i)return;function e(t){t.preventDefault(),t.returnValue=""}return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[i])}function QLe(){const{t:i}=xe(),[e,t]=L.useState(!1),n=L.useRef(!1),s=L.useRef(null),r=BM(),o=L.useRef(r);L.useEffect(()=>{o.current=r},[r]);const a=cn();return L.useEffect(()=>()=>{var c;(c=s.current)==null||c.abort()},[]),{saveAndDeploy:L.useCallback(async c=>{var f;if(n.current)return;n.current=!0,t(!0);const u=new AbortController;s.current=u;const h=_c.getState(),g=Oi.getState();try{h.open(c.agentId,c.agentName),h.setStep("saving");const{newAgentVersion:m}=await c.save();ze.success(i("editor.saved","Saved successfully")),h.setStep("deploying"),await ese("production",c.agentId,m);const x=15;let v=!1;for(let _=0;_setTimeout(e,i))}function Zrt(){var ge;const{id:i}=K_(),{t:e}=xe(),t=il(),[n]=G_(),s=n.get("agentId")??void 0,r=n.get("agentVer")??void 0,[o,a]=L.useState(void 0),[l,c]=L.useState(r?parseInt(r,10):void 0),[u,h]=L.useState(!1),[g,f]=L.useState(!1),[m,x]=L.useState(null),[v,_]=L.useState(null),{data:w}=oit(i),k=L.useMemo(()=>w?w.map(_e=>{const{version:$e}=uo(_e.resource);return{version:$e,lastModifiedOn:_e.lastModifiedOn}}).sort((_e,$e)=>$e.version-_e.version):[],[w]),C=o??((ge=k[0])==null?void 0:ge.version)??1,{data:E,isLoading:D,isError:T,refetch:I}=rit(i,C),R=cit(),P=mLe(),j=L.useMemo(()=>m??(E==null?void 0:E.workflowSteps)??[],[m,E==null?void 0:E.workflowSteps]),B=(E==null?void 0:E.workflowSteps)??[],U=m!==null&&JSON.stringify(m)!==JSON.stringify(B);YLe(U);const{saveAndDeploy:$,isRunning:K}=QLe(),z=j.map((_e,$e)=>({id:`ext-${$e}`,index:$e,extension:_e})),G=L.useMemo(()=>j.map(_e=>{var $e;return(($e=_e.config)==null?void 0:$e.uri)??""}).filter(_e=>_e.includes("://")),[j]),{data:ne}=bLe(G);L.useEffect(()=>{x(null)},[E==null?void 0:E.workflowSteps]),L.useEffect(()=>{if(v){const _e=setTimeout(()=>_(null),3e3);return()=>clearTimeout(_e)}},[v]);const te=L.useCallback(_e=>{x(_e.map($e=>$e.extension))},[]),H=L.useCallback(_e=>{const $e=j.filter((Ke,ht)=>ht!==_e);x($e)},[j]),Q=L.useCallback(_e=>{const $e={type:_e.descriptor.type,extensions:{},config:_e.configUri?{uri:_e.configUri}:{}};x([...j,$e]),h(!1)},[j]),Y=L.useCallback((_e,$e)=>{const Ke=[...j],ht=Ke[_e];ht&&(Ke[_e]={...ht,config:{...ht.config,uri:$e}},x(Ke))},[j]),V=L.useCallback(async()=>{if(!(!U||!m))try{const _e=await R.mutateAsync({id:i,version:C,config:{workflowSteps:m}}),$e=new URL(_e.location,"http://dummy"),Ke=parseInt($e.searchParams.get("version")??"1",10);a(Ke),_({type:"success",text:e("packageEditor.saved","Workflow saved successfully")}),x(null)}catch{_({type:"error",text:e("packageEditor.saveError","Failed to save workflow")})}},[U,m,R,i,C,e]),ue=L.useCallback(async()=>{!U||!m||!s||!l||await $({agentId:s,save:async()=>{const _e=await R.mutateAsync({id:i,version:C,config:{workflowSteps:m}}),$e=new URL(_e.location,"http://dummy"),Ke=parseInt($e.searchParams.get("version")??"1",10);a(Ke),x(null);const ht=await vC(s,l),Ct=`eddi://ai.labs.workflow/workflowstore/workflows/${i}?version=${C}`,Ft=`eddi://ai.labs.workflow/workflowstore/workflows/${i}?version=${Ke}`,Ve={...ht,workflows:(ht.workflows??[]).map(Zt=>Zt===Ct?Ft:Zt)},tt=await jM(s,l,Ve),qt=new URL(tt.location,"http://dummy"),It=parseInt(qt.searchParams.get("version")??"1",10);return c(It),{newAgentVersion:It}}})},[U,m,R,i,C,s,l,$]),he=L.useCallback(()=>{x(null)},[]);function Te(){P.mutate({id:i,version:C},{onSuccess:()=>{ze.success(e("common.delete")+" ✓"),f(!1),t("/manage/workflows")},onError:_e=>ze.error(Vs(_e))})}const nt=L.useCallback(_e=>{a(_e),x(null)},[]);return D?d.jsx("div",{className:"flex items-center justify-center py-20",children:d.jsx(xi,{className:"h-8 w-8 animate-spin text-primary"})}):T||!E?d.jsxs("div",{className:"space-y-4",children:[d.jsx(ime,{}),d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-destructive/30 bg-destructive/5 py-16",children:[d.jsx(Lo,{className:"h-12 w-12 text-destructive"}),d.jsx("p",{className:"mt-4 text-lg font-medium text-destructive",children:e("common.error")}),d.jsx("button",{onClick:()=>I(),className:"mt-4 rounded-lg bg-destructive/10 px-4 py-2 text-sm font-medium text-destructive hover:bg-destructive/20",children:e("common.retry")})]})]}):d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(ime,{}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Ed,{className:"h-8 w-8 text-primary"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold text-foreground",children:(()=>{const _e=w==null?void 0:w.find($e=>{var ht;const Ke=(ht=$e.resource)==null?void 0:ht.match(/\?version=(\d+)/);return Ke?parseInt(Ke[1],10)===C:!1});return(_e==null?void 0:_e.name)||e("packageEditor.title","Workflow Editor")})()}),d.jsxs("p",{className:"font-mono text-sm text-muted-foreground",children:[i,d.jsxs("span",{className:"ms-2 inline-flex items-center rounded-md bg-primary/10 px-1.5 py-0.5 text-xs font-semibold text-primary",children:["v",C]})]})]})]}),k.length>0&&d.jsx(Jrt,{versions:k,current:C,onChange:nt,disabled:U})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v&&d.jsxs("span",{className:be("text-xs font-medium",v.type==="success"?"text-emerald-600 dark:text-emerald-400":"text-destructive"),"data-testid":"save-feedback",children:[v.type==="success"?"✓":"✕"," ",v.text]}),U&&d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-100 px-2 py-0.5 text-xs font-medium text-amber-800 dark:bg-amber-900/30 dark:text-amber-400","data-testid":"dirty-indicator",children:[d.jsx(Lo,{className:"h-3 w-3"}),e("editor.dirty","Unsaved changes")]}),d.jsxs("button",{onClick:he,disabled:!U||R.isPending,className:"inline-flex items-center gap-1.5 rounded-lg border border-input px-3 py-2 text-sm font-medium text-foreground shadow-sm transition-all hover:bg-secondary active:scale-[0.98] disabled:opacity-50","data-testid":"discard-btn",children:[d.jsx(Uie,{className:"h-4 w-4"}),e("editor.discard","Discard")]}),d.jsxs("button",{onClick:V,disabled:!U||R.isPending||K,className:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-2 text-sm font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 active:scale-[0.98] disabled:opacity-50","data-testid":"save-btn",children:[d.jsx(u7,{className:"h-4 w-4"}),R.isPending?e("editor.saving","Saving..."):e("editor.save","Save")]}),s&&r&&d.jsxs("button",{onClick:ue,disabled:!U||R.isPending||K,className:"inline-flex items-center gap-1.5 rounded-lg bg-emerald-600 px-3 py-2 text-sm font-medium text-white shadow-sm transition-all hover:bg-emerald-700 active:scale-[0.98] disabled:opacity-50 dark:bg-emerald-600 dark:hover:bg-emerald-700","data-testid":"save-test-btn",children:[d.jsx(Ih,{className:"h-4 w-4"}),K?e("editor.deploying","Deploying…"):e("editor.saveAndTest","Save & Test")]}),d.jsx("button",{onClick:()=>f(!0),className:"rounded-lg bg-destructive/10 px-4 py-2 text-sm font-medium text-destructive hover:bg-destructive/20 transition-colors","data-testid":"delete-wf-btn",children:d.jsx(_n,{className:"h-4 w-4"})})]})]}),d.jsxs("section",{className:"rounded-xl border bg-card shadow-sm",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border p-5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Ed,{className:"h-5 w-5 text-primary"}),d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:e("packageEditor.pipeline","Pipeline")}),d.jsx("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:j.length})]}),d.jsxs("button",{onClick:()=>h(!0),className:"inline-flex items-center gap-1.5 rounded-lg bg-primary/10 px-3 py-1.5 text-sm font-medium text-primary hover:bg-primary/20 transition-colors","data-testid":"add-extension-btn",children:[d.jsx(Gt,{className:"h-4 w-4"}),e("packageEditor.addTask","Add Task")]})]}),d.jsx(Hrt,{items:z,onChange:te,onRemove:H,disabled:R.isPending,workflowId:i,workflowVersion:C,agentId:s,agentVer:r,latestVersions:ne,onUpdateVersion:Y})]}),d.jsx(Qrt,{open:u,onClose:()=>h(!1),onSelect:Q}),d.jsx(eot,{config:E}),d.jsx(sl,{open:g,onOpenChange:f,title:e("packages.confirmDelete","Delete Workflow"),description:e("packages.confirmDeleteDescription","This action cannot be undone. The workflow and all its data will be permanently removed."),confirmLabel:e("common.delete"),cancelLabel:e("common.cancel"),onConfirm:Te,isPending:P.isPending})]})}function ime(){const{t:i}=xe(),[e]=G_(),t=e.get("agentId");return t?d.jsxs(Kn,{to:`/manage/agentview/${t}`,className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(El,{className:"h-4 w-4"}),i("packageDetail.backToAgent","Back to Agent")]}):d.jsxs(Kn,{to:"/manage/workflows",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(El,{className:"h-4 w-4"}),i("packageDetail.backToWorkflows","Back to Workflows")]})}function Jrt({versions:i,current:e,onChange:t,disabled:n}){return i.length<=1?d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground","data-testid":"version-badge",children:["v",e]}):d.jsx("select",{value:e,onChange:s=>t(Number(s.target.value)),disabled:n,className:"rounded-md border border-input bg-background px-2.5 py-1 text-xs font-medium text-foreground shadow-sm transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 disabled:opacity-50","data-testid":"version-picker",children:i.map(s=>d.jsxs("option",{value:s.version,children:["v",s.version,s.lastModifiedOn?` — ${Tw(s.lastModifiedOn)}`:""]},s.version))})}function eot({config:i}){const{t:e}=xe(),[t,n]=L.useState(!1);return d.jsxs("section",{className:"rounded-xl border bg-card shadow-sm",children:[d.jsxs("button",{onClick:()=>n(!t),className:"flex w-full items-center justify-between p-5 text-start",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(xp,{className:"h-5 w-5 text-muted-foreground"}),d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:e("packageDetail.rawConfig","Raw Configuration")})]}),d.jsx("span",{className:"text-sm text-muted-foreground",children:t?"▲":"▼"})]}),t&&d.jsx("div",{className:"border-t border-border p-5",children:d.jsx("pre",{className:"overflow-x-auto rounded-lg bg-secondary p-4 text-sm text-foreground",children:JSON.stringify(i,null,2)})})]})}const B7=["conversations"];function tot(i=20,e=0,t="",n="",s){return hn({queryKey:[...B7,"descriptors",{limit:i,index:e,filter:t,agentId:n,conversationState:s}],queryFn:()=>PL(i,e,t,n,void 0,s)})}function not(i,e=!0,t=!1){return hn({queryKey:[...B7,"simple",i,{returnDetailed:e,returnCurrentStepOnly:t}],queryFn:()=>fke(i,e,t),enabled:!!i})}function XLe(){const i=cn();return Kt({mutationFn:({id:e,permanent:t=!1})=>nze(e,t),onSuccess:()=>{i.invalidateQueries({queryKey:B7})}})}function iot(i){return hn({queryKey:[...B7,"stepCount",i],queryFn:async()=>{var t;return((t=(await fke(i,!1,!1)).conversationSteps)==null?void 0:t.length)??0},enabled:!!i,staleTime:6e4})}const sme={READY:{icon:RE,color:"text-emerald-500",bg:"bg-emerald-500/10"},IN_PROGRESS:{icon:Zr,color:"text-amber-500",bg:"bg-amber-500/10"},ERROR:{icon:Vi,color:"text-destructive",bg:"bg-destructive/10"},ENDED:{icon:Xl,color:"text-muted-foreground",bg:"bg-muted"},EXECUTION_INTERRUPTED:{icon:Vi,color:"text-amber-500",bg:"bg-amber-500/10"}},sot=["ALL","READY","IN_PROGRESS","ENDED","ERROR"];function rot(){const{t:i}=xe(),e=il(),[t,n]=L.useState(""),s=$s(C=>C.maybeAutoStart);L.useEffect(()=>{const C=setTimeout(()=>s("conversations"),500);return()=>clearTimeout(C)},[s]);const[r,o]=L.useState("ALL"),a={ALL:i("conversations.filterAll","All"),READY:i("conversations.stateActive","Active"),IN_PROGRESS:i("conversations.stateInProgress","In Progress"),ERROR:i("status.error","Error"),ENDED:i("conversations.stateEnded","Ended"),EXECUTION_INTERRUPTED:i("conversations.stateInterrupted","Interrupted")},[l,c]=L.useState(null),[u,h]=L.useState(()=>WE("conversations")),{data:g,isLoading:f,isError:m,refetch:x}=tot(50,0,t,"",r==="ALL"?void 0:r),{data:v=[]}=e0(50),_=XLe();function w(){l&&_.mutate({id:l},{onSuccess:()=>{ze.success(i("common.delete")+" ✓"),c(null)},onError:C=>ze.error(Vs(C))})}function k(C){h(C),JM("conversations",C)}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-2 text-3xl font-bold text-foreground",children:[d.jsx(Zl,{className:"h-8 w-8 text-primary"}),i("pages.conversations.title")]}),d.jsx("p",{className:"mt-1 text-muted-foreground",children:i("pages.conversations.subtitle")})]}),d.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx(br,{className:"absolute inset-s-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:t,onChange:C=>n(C.target.value),placeholder:i("conversations.searchPlaceholder"),"aria-label":i("conversations.searchPlaceholder"),className:"w-full rounded-lg border border-input bg-background py-2.5 ps-10 pe-4 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"conversation-search"})]}),d.jsxs("div",{className:"flex items-center gap-3","data-tour":"conversations-filters",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(o7e,{className:"h-4 w-4 text-muted-foreground"}),sot.map(C=>d.jsx(Yt,{variant:r===C?"primary":"secondary",size:"sm",className:"rounded-full",onClick:()=>o(C),children:a[C]},C))]}),d.jsx(zL,{view:u,onChange:k})]})]}),d.jsxs("div",{"data-tour":"conversations-content",children:[f&&d.jsx("div",{className:"overflow-hidden rounded-xl border bg-card shadow-sm",children:d.jsx("div",{className:"space-y-0",children:Array.from({length:5}).map((C,E)=>d.jsxs("div",{className:"flex items-center gap-4 border-b border-border px-5 py-4",children:[d.jsx(bi,{className:"h-4 w-28"}),d.jsx(bi,{className:"h-4 w-20"}),d.jsx(bi,{className:"h-5 w-16 rounded-full"}),d.jsx(bi,{className:"h-4 w-32"}),d.jsx(bi,{className:"ms-auto h-6 w-6"})]},E))})}),m&&d.jsx(ep,{message:i("common.error"),onRetry:()=>x(),retryLabel:i("common.retry")}),!f&&!m&&(!g||g.length===0)&&d.jsx(ZM,{icon:Zl,title:i(t||r!=="ALL"?"common.noResults":"conversations.empty"),description:!t&&r==="ALL"?i("conversations.emptyDescription","Deploy an agent and start a conversation from the Chat page."):void 0,actionLabel:!t&&r==="ALL"?i("nav.chat"):void 0,onAction:!t&&r==="ALL"?()=>e("/manage/chat"):void 0}),!f&&!m&&g&&g.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:i("conversations.count",{count:g.length})}),u==="card"?d.jsx("div",{className:"cq-card-grid","data-testid":"conversation-grid",children:g.map(C=>{var j;const E=dg(C.resource),D=C.conversationState||"READY",T=sme[D],I=a[D],R=T.icon,P=v?(j=Cg(v).find(B=>B.id===C.agentId))==null?void 0:j.name:null;return d.jsxs(Kn,{to:`/manage/conversationview/${E}`,className:be("group flex flex-col rounded-xl border bg-card p-5 shadow-sm transition-all duration-200","hover:shadow-md hover:border-primary/30"),"data-testid":`conversation-card-${E}`,children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("span",{className:be("inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium",T.bg,T.color),children:[d.jsx(R,{className:"h-3.5 w-3.5"}),I]}),d.jsx("button",{onClick:B=>{B.preventDefault(),B.stopPropagation(),c(E)},className:"rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:text-destructive hover:bg-destructive/10 group-hover:opacity-100 focus:opacity-100","aria-label":i("conversations.deleteConversation","Delete conversation"),children:d.jsx(_n,{className:"h-4 w-4","aria-hidden":"true"})})]}),d.jsx("div",{className:"mt-3",children:d.jsx("p",{className:"font-mono text-sm font-medium text-foreground truncate",title:E,children:E})}),C.agentId&&d.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[d.jsx(ai,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsxs("span",{className:"text-xs text-muted-foreground truncate",title:P||C.agentId,children:[P||C.agentId,C.agentVersion?` v${C.agentVersion}`:""]})]}),d.jsx("div",{className:"mt-2",children:d.jsx(rme,{conversationId:E})}),d.jsx("div",{className:"mt-auto pt-3 border-t border-border",children:d.jsx("span",{className:"text-xs text-muted-foreground",children:C.lastModifiedOn?new Date(C.lastModifiedOn).toLocaleString():"—"})})]},C.resource)})}):d.jsx("div",{className:"overflow-hidden rounded-xl border bg-card shadow-sm","data-testid":"conversation-list",children:d.jsxs("table",{className:"w-full",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-border bg-secondary/50",children:[d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("conversations.id")}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("conversations.agent")}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("conversations.state")}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("conversations.steps","Steps")}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("conversations.lastActivity")}),d.jsx("th",{className:"px-5 py-3 text-end text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("conversations.actions")})]})}),d.jsx("tbody",{className:"divide-y divide-border",children:g.map(C=>{var P;const E=dg(C.resource),D=C.conversationState||"READY",T=sme[D],I=T.icon,R=v&&((P=Cg(v).find(j=>j.id===C.agentId))==null?void 0:P.name)||C.agentId;return d.jsxs("tr",{className:"hover:bg-secondary/30 transition-colors",children:[d.jsx("td",{className:"px-5 py-3",children:d.jsxs(Kn,{to:`/manage/conversationview/${E}`,className:"inline-flex items-center gap-1 text-sm font-medium text-foreground hover:text-primary transition-colors",children:[d.jsx("span",{className:"font-mono",title:E,children:E.length>20?`${E.slice(0,20)}…`:E}),d.jsx(To,{className:"h-3 w-3 opacity-40"})]})}),d.jsx("td",{className:"px-5 py-3",children:d.jsx("span",{className:"text-sm text-muted-foreground",children:C.agentId?`${R}${C.agentVersion?` v${C.agentVersion}`:""}`:"—"})}),d.jsx("td",{className:"px-5 py-3",children:d.jsxs("span",{className:be("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium",T.bg,T.color),children:[d.jsx(I,{className:"h-3 w-3"}),a[D]]})}),d.jsx("td",{className:"px-5 py-3",children:d.jsx(rme,{conversationId:E})}),d.jsx("td",{className:"px-5 py-3",children:d.jsx("span",{className:"text-sm text-muted-foreground",children:C.lastModifiedOn?new Date(C.lastModifiedOn).toLocaleString():"—"})}),d.jsx("td",{className:"px-5 py-3 text-end",children:d.jsx(Yt,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:()=>c(E),disabled:_.isPending,"aria-label":i("conversations.deleteConversation","Delete conversation"),children:d.jsx(_n,{className:"h-4 w-4","aria-hidden":"true"})})})]},C.resource)})})]})})]})]}),d.jsx(sl,{open:l!==null,onOpenChange:C=>!C&&c(null),title:i("conversations.confirmDelete"),description:i("conversations.confirmDeleteDescription","This conversation and its history will be permanently removed."),confirmLabel:i("common.delete"),cancelLabel:i("common.cancel"),onConfirm:w,isPending:_.isPending})]})}function rme({conversationId:i}){const{t:e}=xe(),{data:t,isLoading:n}=iot(i);return n?d.jsx("span",{className:"inline-block h-4 w-8 animate-pulse rounded bg-secondary"}):t==null?d.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:[t," ",t===1?e("conversations.step","step"):e("conversations.steps","steps")]})}const oot={READY:{icon:RE,color:"text-emerald-500",bg:"bg-emerald-500/10"},IN_PROGRESS:{icon:Zr,color:"text-amber-500",bg:"bg-amber-500/10"},ERROR:{icon:Vi,color:"text-destructive",bg:"bg-destructive/10"},ENDED:{icon:Xl,color:"text-muted-foreground",bg:"bg-muted"},EXECUTION_INTERRUPTED:{icon:Vi,color:"text-amber-500",bg:"bg-amber-500/10"}};function aot(){var C,E;const{id:i}=K_(),{t:e}=xe(),t=il(),[n,s]=L.useState(!1),[r,o]=L.useState(""),a={READY:e("conversations.stateActive","Active"),IN_PROGRESS:e("conversations.stateInProgress","In Progress"),ERROR:e("status.error","Error"),ENDED:e("conversations.stateEnded","Ended"),EXECUTION_INTERRUPTED:e("conversations.stateInterrupted","Interrupted")},l=XLe(),{data:c,isLoading:u,isError:h,refetch:g}=not(i,!0,!1);function f(){l.mutate({id:i},{onSuccess:()=>{ze.success(e("common.delete")+" ✓"),t("/manage/conversations")},onError:D=>ze.error(Vs(D))}),s(!1)}function m(){var P,j;if(!c)return;const D=[`# Conversation ${i}`,`**Agent**: ${c.agentId} v${c.agentVersion}`,`**State**: ${c.conversationState}`,`**Steps**: ${((P=c.conversationSteps)==null?void 0:P.length)??0}`,""];(j=c.conversationSteps)==null||j.forEach((B,U)=>{var z;const $=Cj(B),K=Iw((z=c.conversationOutputs)==null?void 0:z[U]);$&&D.push(`**User**: ${$}`,""),K&&D.push(`**Agent**: ${K}`,"")});const T=new Blob([D.join(`
-`)],{type:"text/markdown"}),I=URL.createObjectURL(T),R=document.createElement("a");R.href=I,R.download=`conversation-${i==null?void 0:i.slice(0,8)}.md`,R.click(),URL.revokeObjectURL(I)}if(u)return d.jsx("div",{className:"flex items-center justify-center py-20",children:d.jsx(xi,{className:"h-8 w-8 animate-spin text-primary"})});if(h||!c)return d.jsxs("div",{className:"space-y-4",children:[d.jsx(ome,{}),d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-destructive/30 bg-destructive/5 py-16",children:[d.jsx(Lo,{className:"h-12 w-12 text-destructive"}),d.jsx("p",{className:"mt-4 text-lg font-medium text-destructive",children:e("common.error")}),d.jsx("button",{onClick:()=>g(),className:"mt-4 rounded-lg bg-destructive/10 px-4 py-2 text-sm font-medium text-destructive hover:bg-destructive/20",children:e("common.retry")})]})]});const x=c.conversationState||"READY",v=oot[x],_=v.icon,w=a[x],k=((C=c.conversationSteps)==null?void 0:C.length)??0;return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(ome,{}),d.jsxs("h1",{className:"flex items-center gap-2 text-3xl font-bold text-foreground",children:[d.jsx(Zl,{className:"h-8 w-8 text-primary"}),e("conversationDetail.title","Conversation")]}),d.jsxs("p",{className:"font-mono text-sm text-muted-foreground",children:["ID: ",i]})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs("span",{className:be("inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium",v.bg,v.color),children:[d.jsx(_,{className:"h-4 w-4"}),w]}),d.jsxs("span",{className:"rounded-full bg-secondary px-3 py-1.5 text-sm font-medium text-secondary-foreground",children:[c.agentId," v",c.agentVersion]}),d.jsxs("span",{className:"rounded-full bg-primary/10 px-3 py-1.5 text-sm font-medium text-primary",children:[k," ",e("conversationDetail.steps","steps")]}),d.jsx("button",{onClick:()=>s(!0),className:"rounded-lg bg-destructive/10 px-4 py-2 text-sm font-medium text-destructive hover:bg-destructive/20 transition-colors",children:d.jsx(_n,{className:"h-4 w-4"})}),(x==="READY"||x==="IN_PROGRESS")&&d.jsxs("button",{onClick:()=>t(`/manage/chat?agentId=${c.agentId}&conversationId=${i}`),className:"inline-flex items-center gap-1.5 rounded-lg bg-primary/10 px-4 py-2 text-sm font-medium text-primary hover:bg-primary/20 transition-colors","data-testid":"continue-in-chat",children:[d.jsx(Jf,{className:"h-4 w-4"}),e("conversationDetail.continueChat","Continue in Chat")]}),d.jsxs("button",{onClick:()=>m(),className:"inline-flex items-center gap-1.5 rounded-lg bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground hover:bg-secondary/80 transition-colors","data-testid":"export-md",children:[d.jsx(Q_,{className:"h-4 w-4"}),e("conversationDetail.exportMd","Export")]})]})]}),c.conversationProperties&&Object.keys(c.conversationProperties).length>0&&d.jsx(cot,{properties:c.conversationProperties}),d.jsxs("section",{className:"rounded-xl border bg-card shadow-sm","data-testid":"conversation-chat",children:[d.jsxs("div",{className:"flex items-center gap-2 border-b border-border p-5",children:[d.jsx(Zl,{className:"h-5 w-5 text-primary"}),d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:e("conversationDetail.chatLog","Chat Log")}),d.jsx("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:k}),d.jsx("div",{className:"ms-auto",children:d.jsxs("div",{className:"relative",children:[d.jsx(br,{className:"absolute start-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:r,onChange:D=>o(D.target.value),placeholder:e("conversationDetail.searchTranscript","Search…"),className:"h-8 w-48 rounded-lg border border-input bg-background ps-8 pe-3 text-xs placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary","data-testid":"transcript-search"})]})})]}),d.jsxs("div",{className:"p-4 sm:p-6 space-y-1",children:[k===0&&d.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[d.jsx(Zl,{className:"h-10 w-10 opacity-50"}),d.jsx("p",{className:"mt-3 text-sm",children:e("conversationDetail.noSteps","No conversation steps recorded")})]}),(E=c.conversationSteps)==null?void 0:E.map((D,T)=>{var I,R,P,j;if(r){const B=r.toLowerCase(),U=((I=Cj(D))==null?void 0:I.toLowerCase())??"",$=((P=Iw((R=c.conversationOutputs)==null?void 0:R[T]))==null?void 0:P.toLowerCase())??"";if(!U.includes(B)&&!$.includes(B))return null}return d.jsx(lot,{step:D,conversationOutput:(j=c.conversationOutputs)==null?void 0:j[T],stepNumber:T+1,isLast:T===k-1,highlight:r},T)})]})]}),d.jsx(sl,{open:n,onOpenChange:s,title:e("conversations.confirmDelete","Delete Conversation"),description:e("conversations.confirmDeleteDescription","This conversation and its history will be permanently removed."),confirmLabel:e("common.delete"),cancelLabel:e("common.cancel"),onConfirm:f,isPending:l.isPending})]})}function ome(){const{t:i}=xe();return d.jsxs(Kn,{to:"/manage/conversations",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(El,{className:"h-4 w-4"}),i("conversationDetail.backToConversations","Back to Conversations")]})}function ame({text:i,highlight:e}){if(!e||!e.trim())return d.jsx(d.Fragment,{children:i});const t=new RegExp(`(${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),n=i.split(t);return d.jsx(d.Fragment,{children:n.map((s,r)=>t.test(s)?d.jsx("mark",{className:"bg-amber-300/60 dark:bg-amber-500/40 rounded-sm px-0.5",children:s},r):d.jsx("span",{children:s},r))})}function lot({step:i,conversationOutput:e,stepNumber:t,isLast:n,highlight:s}){const{t:r}=xe(),[o,a]=L.useState(!1),l=Cj(i),c=Iw(e),u=tze(i),h=(()=>{var v;const g=(v=i.conversationStep)==null?void 0:v.map(_=>_.timestamp?new Date(_.timestamp).getTime():0).filter(_=>_>0);if(!g||g.length<2)return null;const f=Math.min(...g),x=Math.max(...g)-f;return x<1e3?`${x}ms`:`${(x/1e3).toFixed(1)}s`})();return d.jsxs("div",{className:be("space-y-3",!n&&"pb-3"),children:[l&&d.jsx("div",{className:"flex justify-end",children:d.jsxs("div",{className:"flex items-end gap-2 max-w-[80%] sm:max-w-[70%]",children:[d.jsx("div",{className:"rounded-2xl rounded-be-md bg-primary px-4 py-2.5 text-primary-foreground shadow-sm",children:d.jsx("p",{className:"text-sm whitespace-pre-wrap",children:d.jsx(ame,{text:l,highlight:s})})}),d.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-primary/20",children:d.jsx($ie,{className:"h-3.5 w-3.5 text-primary"})})]})}),u.length>0&&d.jsx("div",{className:"flex justify-center",children:d.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-1",children:[d.jsx(nc,{className:"h-3 w-3 text-amber-500"}),u.map((g,f)=>d.jsx("span",{className:"rounded-md bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-600 dark:text-amber-400",children:g},f))]})}),c&&d.jsx("div",{className:"flex justify-start",children:d.jsxs("div",{className:"flex items-end gap-2 max-w-[80%] sm:max-w-[70%]",children:[d.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-secondary",children:d.jsx(ai,{className:"h-3.5 w-3.5 text-primary"})}),d.jsx("div",{className:"rounded-2xl rounded-bs-md bg-secondary px-4 py-2.5 shadow-sm",children:d.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:d.jsx(ame,{text:c,highlight:s})})})]})}),d.jsx("div",{className:"flex justify-center",children:d.jsxs("button",{onClick:()=>a(!o),className:"inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-[10px] text-muted-foreground hover:bg-secondary transition-colors",title:r("conversationDetail.rawData","View raw data"),children:[d.jsx(LSe,{className:"h-3 w-3"}),r("conversationDetail.step","Step")," ",t,h&&d.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:[d.jsx(Zr,{className:"h-2.5 w-2.5"}),h]}),o?d.jsx(Y_,{className:"h-3 w-3"}):d.jsx(Rn,{className:"h-3 w-3"})]})}),o&&d.jsx("div",{className:"mx-4 sm:mx-8 rounded-lg bg-secondary/50 p-3 border border-border overflow-x-auto",children:d.jsx("pre",{className:"text-xs leading-relaxed",dangerouslySetInnerHTML:{__html:dot(JSON.stringify(i,null,2))}})}),!n&&d.jsx("div",{className:"border-b border-border/50"})]})}function cot({properties:i}){const{t:e}=xe(),[t,n]=L.useState(!1);return d.jsxs("section",{className:"rounded-xl border bg-card shadow-sm",children:[d.jsxs("button",{onClick:()=>n(!t),className:"flex w-full items-center justify-between p-5 text-start",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(xp,{className:"h-5 w-5 text-muted-foreground"}),d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:e("conversationDetail.properties","Conversation Properties")})]}),d.jsx("span",{className:"text-sm text-muted-foreground",children:t?"▲":"▼"})]}),t&&d.jsx("div",{className:"border-t border-border p-5",children:d.jsx("pre",{className:"overflow-x-auto rounded-lg bg-secondary p-4 text-sm text-foreground",children:JSON.stringify(i,null,2)})})]})}function dot(i){return i.replace(/("(\\u[\da-fA-F]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,e=>{let t="color: var(--color-amber-400)";return/^"/.test(e)?/:$/.test(e)?t="color: var(--color-primary)":t="color: var(--color-emerald-400)":/true|false/.test(e)?t="color: var(--color-sky-400)":/null/.test(e)&&(t="color: var(--color-rose-400)"),`${e}`})}async function uot(i,e){const t=new FormData;t.append("file",e);const n=await fetch(`${Oe.getBaseUrl()}/conversations/${i}/attachments`,{method:"POST",headers:Oe.getAuthHeader(),body:t});if(!n.ok)throw new Error(`Attachment upload failed: ${n.statusText}`);return n.json()}function hot(i){return i.replace("ai.labs.","").replace(/store$/,"")}function ZLe(i){return i<1?"<1ms":i<1e3?`${Math.round(i)}ms`:`${(i/1e3).toFixed(1)}s`}function got(i,e){return i.length<=e?i:i.slice(0,e)+"…"}function fot(i){const e=[],t=new Map;for(const n of i){const s=`${n.taskType}-${n.index}`;if(n.type==="task_start"){const r=e.length;t.set(s,r),e.push({taskType:n.taskType,taskId:n.taskId,index:n.index,status:"running"})}else if(n.type==="task_complete"){const r=t.get(s);r!==void 0?e[r]={...e[r],status:"complete",durationMs:n.durationMs,toolTrace:n.toolTrace,actions:n.actions,confidence:n.confidence}:e.push({taskType:n.taskType,taskId:n.taskId,index:n.index,status:"complete",durationMs:n.durationMs,toolTrace:n.toolTrace,actions:n.actions,confidence:n.confidence})}}return e}function pot({events:i,isLive:e,totalSteps:t}){const{t:n}=xe(),[s,r]=L.useState(e),o=L.useMemo(()=>fot(i),[i]),a=L.useMemo(()=>o.reduce((g,f)=>g+(f.durationMs??0),0),[o]),l=L.useMemo(()=>o.reduce((g,f)=>f.toolTrace?g+f.toolTrace.filter(m=>m.type==="tool_call").length:g,0),[o]),c=o.filter(g=>g.status==="complete").length,u=o.some(g=>g.status==="running"),h=e&&u;return o.length===0?null:d.jsx("div",{className:"flex justify-center px-4 py-1","data-testid":"chat-activity",children:d.jsxs("div",{className:be("w-full max-w-[85%] rounded-xl border transition-all duration-300",h?"border-primary/30 bg-primary/5":"border-border/50 bg-card/50"),children:[d.jsxs("button",{onClick:()=>r(!s),className:be("flex w-full items-center gap-2 px-3 py-2 text-start text-xs transition-colors","hover:bg-muted/30 rounded-xl"),"aria-expanded":s,"data-testid":"chat-activity-toggle",children:[h?d.jsx(ni,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-primary"}):d.jsx(nc,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),d.jsx("span",{className:"flex-1 text-muted-foreground",children:h?d.jsxs("span",{className:"text-primary font-medium",children:[n("chat.activity.processing","Processing…"),d.jsxs("span",{className:"ms-1.5 text-muted-foreground font-normal",children:[c,"/",t??o.length]})]}):d.jsxs("span",{children:[d.jsxs("span",{className:"font-medium text-foreground",children:[o.length," ",n("chat.activity.steps","steps")]}),d.jsx("span",{className:"mx-1.5 text-border",children:"·"}),d.jsx("span",{className:"font-mono",children:ZLe(a)}),l>0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"mx-1.5 text-border",children:"·"}),d.jsxs("span",{children:[l," ",n("chat.activity.toolCalls","tool calls")]})]})]})}),s?d.jsx(Y_,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/50"}):d.jsx(Rn,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/50"})]}),d.jsx("div",{className:be("overflow-hidden transition-all duration-300",s?"max-h-[80vh] opacity-100 overflow-y-auto":"max-h-0 opacity-0"),children:d.jsx("div",{className:"border-t border-border/30 px-3 pb-2.5 pt-1.5 space-y-0.5",children:o.map((g,f)=>d.jsx(mot,{task:g},`${g.taskType}-${g.index}-${f}`))})})]})})}function mot({task:i}){var c,u;const[e,t]=L.useState(!1),n=VE(i.taskType),s=ULe(i.taskType),r=hot(i.taskType),o=((c=i.toolTrace)==null?void 0:c.filter(h=>h.type==="tool_call"))??[],a=((u=i.toolTrace)==null?void 0:u.filter(h=>h.type==="tool_result"))??[],l=o.length>0;return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2 py-0.5 text-[11px]",children:[d.jsxs("div",{className:"w-4 flex justify-center shrink-0",children:[i.status==="complete"&&d.jsx(Ns,{className:"h-3 w-3 text-emerald-500"}),i.status==="running"&&d.jsx(ni,{className:"h-3 w-3 animate-spin text-primary"}),i.status==="pending"&&d.jsx(RE,{className:"h-3 w-3 text-muted-foreground/30"}),i.status==="error"&&d.jsx(Vi,{className:"h-3 w-3 text-destructive"})]}),d.jsx(n,{className:be("h-3.5 w-3.5 shrink-0",s)}),d.jsx("span",{className:"font-medium text-foreground min-w-0 truncate",children:r}),l&&d.jsxs("button",{onClick:()=>t(!e),className:"inline-flex items-center gap-0.5 rounded-full bg-amber-500/10 px-1.5 py-0.5 text-[9px] font-medium text-amber-600 dark:text-amber-400 hover:bg-amber-500/20 transition-colors",children:[d.jsx(zb,{className:"h-2.5 w-2.5"}),o.length]}),d.jsx("span",{className:"ms-auto shrink-0 font-mono text-[10px] text-muted-foreground",children:i.status==="running"?"…":i.durationMs!=null?ZLe(i.durationMs):"—"})]}),l&&e&&d.jsx("div",{className:"ms-8 mb-1 space-y-0.5",children:o.map((h,g)=>{const f=a[g];return d.jsx(bot,{call:h,result:f},g)})})]})}function bot({call:i,result:e}){const[t,n]=L.useState(!1),s=!!(e!=null&&e.result);return d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>n(!t),className:"flex w-full items-center gap-1.5 rounded px-1.5 py-0.5 text-[10px] text-start hover:bg-muted/50 transition-colors","data-testid":"tool-call-row",children:[d.jsx(zb,{className:"h-2.5 w-2.5 shrink-0 text-amber-500"}),d.jsx("span",{className:"font-medium text-foreground",children:i.tool}),i.arguments&&d.jsxs("span",{className:"text-muted-foreground truncate",children:["(",got(i.arguments,40),")"]}),d.jsx("span",{className:"ms-auto shrink-0",children:s?d.jsx(Ns,{className:"h-2.5 w-2.5 text-emerald-500"}):d.jsx(ni,{className:"h-2.5 w-2.5 animate-spin text-primary"})})]}),t&&d.jsxs("div",{className:"ms-4 mb-1 rounded-md border border-border/50 bg-muted/30 p-2 text-[9px] space-y-1 overflow-x-auto",children:[i.arguments&&d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"font-semibold text-muted-foreground uppercase tracking-wider",children:"Args"}),d.jsx(lme,{text:i.arguments})]}),d.jsx("pre",{className:"mt-0.5 whitespace-pre-wrap break-all text-foreground/80 font-mono",children:cme(i.arguments)})]}),(e==null?void 0:e.result)&&d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"font-semibold text-muted-foreground uppercase tracking-wider",children:"Result"}),d.jsx(lme,{text:e.result})]}),d.jsx("pre",{className:"mt-0.5 whitespace-pre-wrap break-all text-foreground/80 font-mono max-h-32 overflow-y-auto",children:cme(e.result)})]})]})]})}function lme({text:i}){const[e,t]=L.useState(!1);return d.jsx("button",{onClick:n=>{n.stopPropagation(),navigator.clipboard.writeText(i),t(!0),setTimeout(()=>t(!1),1500)},className:"rounded p-0.5 text-muted-foreground/50 hover:text-foreground transition-colors",title:"Copy",children:e?d.jsx(Ns,{className:"h-2.5 w-2.5 text-emerald-500"}):d.jsx(mo,{className:"h-2.5 w-2.5"})})}function cme(i){try{return JSON.stringify(JSON.parse(i),null,2)}catch{return i}}function xot({open:i,onNewConversation:e}){const{t}=xe(),n=Oi(c=>c.selectedAgentId),s=Oi(c=>c.conversationId),{data:r,isLoading:o}=fze(n),a=pze(),l=c=>{if(!n)return;const u=dg(c.resource);a.mutate({agentId:n,conversationId:u})};return i?d.jsxs("div",{className:"flex h-full w-64 shrink-0 flex-col border-e border-border bg-card/50",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[d.jsx(PE,{className:"h-4 w-4"}),t("chat.history")]}),d.jsxs("button",{onClick:e,className:"flex items-center gap-1 rounded-lg px-2 py-1 text-xs font-medium text-primary transition-colors hover:bg-primary/10","data-testid":"new-conversation-btn",children:[d.jsx(Gt,{className:"h-3.5 w-3.5"}),t("chat.newConversation")]})]}),d.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:o?d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx(ni,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):r!=null&&r.length?d.jsx("ul",{className:"space-y-1",children:r.map(c=>{const u=dg(c.resource),h=u===s;return d.jsx("li",{children:d.jsxs("button",{onClick:()=>l(c),disabled:a.isPending,className:be("flex w-full flex-col gap-1 rounded-lg px-3 py-2 text-start transition-colors",h?"bg-primary/10 text-primary":"text-foreground hover:bg-muted"),children:[d.jsxs("span",{className:"truncate text-xs font-medium",children:[u.substring(0,12),"…"]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(vot,{state:c.conversationState}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:new Date(c.lastModifiedOn).toLocaleDateString()})]})]})},c.resource)})}):d.jsx("p",{className:"px-2 py-4 text-center text-xs text-muted-foreground",children:t("chat.noHistory")})})]}):null}function vot({state:i}){const e={READY:"bg-emerald-500/15 text-emerald-600",IN_PROGRESS:"bg-amber-500/15 text-amber-600",ENDED:"bg-muted text-muted-foreground",ERROR:"bg-destructive/15 text-destructive"};return d.jsx("span",{className:be("rounded-full px-1.5 py-0.5 text-[10px] font-medium",e[i]??e.READY),children:i})}function KG(){const{t:i}=xe(),[e,t]=G_(),[n,s]=L.useState(!1),[r,o]=L.useState(!1),a=L.useRef(null),l=L.useRef(null),c=L.useRef(null),u=L.useRef(!1),[h,g]=L.useState(!1),[f,m]=L.useState(!1),x=Oi(Ve=>Ve.messages),v=Oi(Ve=>Ve.selectedAgentId),_=Oi(Ve=>Ve.selectedAgentName),w=Oi(Ve=>Ve.conversationId),k=Oi(Ve=>Ve.isProcessing),C=Oi(Ve=>Ve.isThinking),E=Oi(Ve=>Ve.undoAvailable),D=Oi(Ve=>Ve.redoAvailable),T=Oi(Ve=>Ve.quickReplies),I=Oi(Ve=>Ve.setSelectedAgent),R=Oi(Ve=>Ve.activeInputField),P=Oi(Ve=>Ve.isSecretMode),j=Oi(Ve=>Ve.toggleSecretMode),B=Oi(Ve=>Ve.clearInputField),U=bu(Ve=>Ve.showActivity),$=bu(Ve=>Ve.toggleShowActivity),K=bu(Ve=>Ve.currentTurnEvents),{data:z,isLoading:G}=nse(),ne=BM(),te=ise(),H=xze(),Q=mze(),Y=bze();L.useEffect(()=>{if(u.current)return;const Ve=e.get("agentId");if(!Ve||!z)return;u.current=!0;const tt=z.find(It=>It.id===Ve),qt=(tt==null?void 0:tt.name)??"Agent";I(Ve,qt),ne.mutate({agentId:Ve}),t({},{replace:!0})},[e,z,I,ne,t]),L.useEffect(()=>{var Ve;(Ve=a.current)==null||Ve.scrollIntoView({behavior:"smooth"})},[x]),L.useEffect(()=>{function Ve(tt){c.current&&!c.current.contains(tt.target)&&o(!1)}return document.addEventListener("mousedown",Ve),()=>document.removeEventListener("mousedown",Ve)},[]);const V=L.useCallback((Ve,tt)=>{I(Ve,tt),o(!1),ne.mutate({agentId:Ve})},[I,ne]),ue=L.useCallback(()=>{v&&(Oi.getState().clearMessages(),ne.mutate({agentId:v}))},[v,ne]),he=L.useCallback((Ve,tt)=>{te.mutate({message:Ve,isSecret:tt})},[te]),Te=L.useCallback(Ve=>{te.mutate({message:Ve})},[te]),nt=L.useRef(null),[ge,_e]=L.useState(!1),$e=L.useCallback(async Ve=>{var qt;const tt=(qt=Ve.target.files)==null?void 0:qt[0];if(!(!tt||!w)){_e(!0);try{const It=await uot(w,tt);te.mutate({message:`📎 ${tt.name} [ref:${It.storageRef}]`}),ze.success(i("chat.attachSuccess","File attached"))}catch{ze.error(i("chat.attachError","Failed to upload file"))}finally{_e(!1),nt.current&&(nt.current.value="")}}},[w,te,i]),Ke=vze(),ht=x[x.length-1],Ct=(ht==null?void 0:ht.role)==="agent"&&(ht.content??"").includes("⚠️ Error"),Ft=L.useCallback(()=>{Ke.mutate(void 0,{onSuccess:()=>ze.success(i("chat.retrySuccess","Step re-executed")),onError:()=>ze.error(i("chat.retryError","Retry failed"))})},[Ke,i]);return d.jsxs("div",{className:"flex h-full overflow-hidden rounded-xl border border-border bg-background shadow-sm",children:[d.jsx(xot,{open:n,onNewConversation:ue}),d.jsxs("div",{className:"flex flex-1 flex-col",children:[d.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-4 py-2.5",children:[d.jsx("button",{onClick:()=>s(Ve=>!Ve),className:be("flex h-9 w-9 items-center justify-center rounded-lg transition-colors",n?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted hover:text-foreground"),title:i("chat.history"),"data-testid":"history-toggle",children:d.jsx(PE,{className:"h-4 w-4"})}),d.jsxs("div",{ref:c,className:"relative flex-1",children:[d.jsxs("button",{onClick:()=>o(Ve=>!Ve),className:"flex w-full items-center gap-2 rounded-lg border border-input bg-card px-3 py-2 text-sm transition-colors hover:bg-muted","data-testid":"agent-selector",children:[d.jsx(ai,{className:"h-4 w-4 text-muted-foreground"}),d.jsx("span",{className:be("flex-1 text-start truncate",!_&&"text-muted-foreground"),children:_??i("chat.selectAgent")}),d.jsx(Rn,{className:be("h-4 w-4 text-muted-foreground transition-transform",r&&"rotate-180")})]}),r&&d.jsx("div",{className:"absolute inset-s-0 top-full z-50 mt-1 w-full rounded-lg border border-border bg-popover p-1 shadow-lg",children:G?d.jsx("div",{className:"flex items-center justify-center py-3",children:d.jsx(ni,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):z!=null&&z.length?z.map(Ve=>d.jsxs("button",{onClick:()=>V(Ve.id,Ve.name),className:be("flex w-full items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors hover:bg-muted",Ve.id===v&&"bg-primary/10 text-primary font-medium"),children:[d.jsx(ai,{className:"h-4 w-4 shrink-0"}),d.jsxs("div",{className:"flex-1 text-start",children:[d.jsx("p",{className:"truncate font-medium",children:Ve.name}),Ve.description&&d.jsx("p",{className:"truncate text-xs text-muted-foreground",children:Ve.description})]})]},Ve.id)):d.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:i("chat.noAgents")})})]}),d.jsx(rEe,{}),d.jsx("button",{onClick:$,className:be("flex h-9 w-9 items-center justify-center rounded-lg transition-colors",U?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted hover:text-foreground"),title:U?i("chat.hideActivity","Hide Activity"):i("chat.showActivity","Show Activity"),"data-testid":"activity-toggle",children:d.jsx(AE,{className:"h-4 w-4"})}),w&&d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:ue,className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:i("chat.newConversation"),"data-testid":"new-conversation",children:d.jsx(Fie,{className:"h-4 w-4"})}),d.jsx("button",{onClick:()=>H.mutate(),className:"flex h-9 w-9 items-center justify-center rounded-lg text-destructive/70 transition-colors hover:bg-destructive/10 hover:text-destructive",title:i("chat.endConversation"),"data-testid":"end-conversation",children:d.jsx(SBe,{className:"h-4 w-4"})})]})]}),w&&f&&d.jsxs("div",{className:"flex items-center gap-4 border-b border-border/50 bg-muted/30 px-4 py-1.5 text-[11px] text-muted-foreground",children:[d.jsxs("div",{className:"flex items-center gap-1",title:"Conversation ID",children:[d.jsx(Zf,{className:"h-3 w-3"}),d.jsxs("button",{onClick:()=>{navigator.clipboard.writeText(w),ze.success(i("common.copied","Copied!"))},className:"font-mono hover:text-foreground transition-colors truncate max-w-[120px]",title:w,children:[w.slice(0,12),"…"]})]}),d.jsxs("div",{className:"flex items-center gap-1",title:"Steps",children:[d.jsx(Uf,{className:"h-3 w-3"}),d.jsxs("span",{children:[x.filter(Ve=>Ve.role==="user").length," ",i("chat.context.stepCount","turns")]})]}),d.jsxs("div",{className:"flex items-center gap-1",title:"Started",children:[d.jsx(Zr,{className:"h-3 w-3"}),d.jsx("span",{children:x[0]?new Date(x[0].timestamp).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):"—"})]})]}),w&&d.jsx("button",{onClick:()=>m(Ve=>!Ve),className:be("flex w-full items-center justify-center py-0.5 text-muted-foreground/40 hover:text-muted-foreground hover:bg-muted/30 transition-colors",f&&"border-b border-border/30"),title:f?"Hide conversation info":"Show conversation info","data-testid":"context-toggle",children:f?d.jsx(Y_,{className:"h-3 w-3"}):d.jsx(_d,{className:"h-3 w-3"})}),d.jsxs("div",{ref:l,className:"relative flex-1 overflow-y-auto",onScroll:Ve=>{const tt=Ve.currentTarget,qt=tt.scrollHeight-tt.scrollTop-tt.clientHeight;g(qt>200)},children:[v?x.length===0?d.jsx("div",{className:"flex h-full items-center justify-center",children:d.jsxs("div",{className:"text-center",children:[d.jsx(ai,{className:"mx-auto h-12 w-12 text-muted-foreground/30"}),d.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:ne.isPending?i("chat.thinking"):i("chat.empty")})]})}):d.jsxs("div",{className:"py-4",children:[x.map(Ve=>d.jsx(sEe,{message:Ve},Ve.id)),U&&(k||C)&&K.length>0&&d.jsx(pot,{events:K,isLive:!0}),!U&&C&&d.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-sm text-muted-foreground animate-pulse",children:[d.jsx(Nl,{className:"h-4 w-4"}),d.jsx("span",{className:"italic",children:i("chat.thinking")})]}),Ct&&!k&&d.jsx("div",{className:"flex justify-center py-2",children:d.jsxs("button",{onClick:Ft,disabled:Ke.isPending,className:"inline-flex items-center gap-1.5 rounded-full border border-amber-500/30 bg-amber-500/5 px-4 py-1.5 text-xs font-medium text-amber-600 transition-colors hover:bg-amber-500/15 disabled:opacity-50 dark:text-amber-400","data-testid":"rerun-btn",children:[d.jsx(xi,{className:be("h-3.5 w-3.5",Ke.isPending&&"animate-spin")}),i("chat.retry","Retry Last Step")]})}),d.jsx("div",{ref:a})]}):d.jsx(wot,{}),h&&d.jsx("button",{onClick:()=>{var Ve;return(Ve=a.current)==null?void 0:Ve.scrollIntoView({behavior:"smooth"})},className:"absolute bottom-4 end-4 z-10 flex h-9 w-9 items-center justify-center rounded-full border border-border bg-card shadow-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-all animate-in fade-in slide-in-from-bottom-2",title:i("chat.scrollToBottom","Scroll to bottom"),"data-testid":"scroll-to-bottom",children:d.jsx(zf,{className:"h-4 w-4"})})]}),w&&d.jsx(pEe,{conversationId:w,agentId:v}),T.length>0&&!k&&d.jsx("div",{className:"flex flex-wrap gap-2 border-t border-border px-4 py-2",children:T.map((Ve,tt)=>d.jsx("button",{type:"button",onClick:()=>Te(Ve),className:"rounded-full border border-primary/30 bg-primary/5 px-3 py-1.5 text-xs font-medium text-primary transition-colors hover:bg-primary/15","data-testid":"quick-reply-btn",children:Ve},`${Ve}-${tt}`))}),w&&d.jsxs("div",{className:"flex items-center gap-1 border-t border-border px-4 py-1",children:[d.jsx("button",{onClick:()=>Q.mutate(),disabled:!E||k,className:be("flex h-8 w-8 items-center justify-center rounded-lg transition-colors",E&&!k?"text-muted-foreground hover:bg-muted hover:text-foreground":"text-muted-foreground/30 cursor-not-allowed"),title:i("chat.undo"),"data-testid":"undo-btn",children:d.jsx(Uie,{className:"h-3.5 w-3.5"})}),d.jsx("button",{onClick:()=>Y.mutate(),disabled:!D||k,className:be("flex h-8 w-8 items-center justify-center rounded-lg transition-colors",D&&!k?"text-muted-foreground hover:bg-muted hover:text-foreground":"text-muted-foreground/30 cursor-not-allowed"),title:i("chat.redo"),"data-testid":"redo-btn",children:d.jsx(LHe,{className:"h-3.5 w-3.5"})})]}),R?d.jsx(_ot,{label:R.label,placeholder:R.placeholder,defaultValue:R.defaultValue,subType:R.subType,onSend:Ve=>{he(Ve,!0),B()},disabled:k}):d.jsx(yot,{onSend:he,disabled:!w,isProcessing:k,isSecretMode:P,onToggleSecret:j,fileInputRef:nt,onFileChange:$e,isUploading:ge,hasConversation:!!w})]})]})}function _ot({label:i,placeholder:e,defaultValue:t="",subType:n="password",onSend:s,disabled:r=!1}){const{t:o}=xe(),[a,l]=L.useState(t),[c,u]=L.useState(!1),h=()=>{const f=a.trim();!f||r||(s(f),l(""))},g=c?"text":n||"password";return d.jsxs("div",{className:"border-t border-border bg-background p-4",children:[i&&d.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-sm font-medium text-primary","data-testid":"secret-input-label",children:[d.jsx(d7,{className:"h-3.5 w-3.5"}),i]}),d.jsxs("div",{className:"flex items-end gap-2",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx("input",{type:g,value:a,onChange:f=>l(f.target.value),onKeyDown:f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),h())},placeholder:e||o("chat.secretPlaceholder","Enter secret value..."),disabled:r,autoFocus:!0,autoComplete:"off",className:be("w-full rounded-xl border border-primary/60 bg-card px-4 py-3 pe-10 text-sm","placeholder:text-muted-foreground","focus:outline-none focus:ring-2 focus:ring-primary/30","disabled:cursor-not-allowed disabled:opacity-50"),"data-testid":"secret-input-field"}),d.jsx("button",{type:"button",onClick:()=>u(!c),className:"absolute inset-e-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",title:c?o("chat.hide","Hide"):o("chat.show","Show"),"data-testid":"secret-input-eye",children:c?d.jsx(Sh,{className:"h-4 w-4"}):d.jsx(_b,{className:"h-4 w-4"})})]}),d.jsx("button",{onClick:h,disabled:!a.trim()||r,className:be("flex h-11 w-11 shrink-0 items-center justify-center rounded-xl transition-colors",a.trim()&&!r?"bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer":"bg-muted text-muted-foreground cursor-not-allowed"),"data-testid":"secret-input-send",children:d.jsx(mA,{className:"h-5 w-5"})})]})]})}function yot({onSend:i,disabled:e=!1,isProcessing:t=!1,isSecretMode:n,onToggleSecret:s,fileInputRef:r,onFileChange:o,isUploading:a=!1,hasConversation:l=!1}){const{t:c}=xe(),[u,h]=L.useState(""),[g,f]=L.useState(!1),m=L.useRef(null),x=L.useCallback(()=>{const w=u.trim();!w||e||t||(i(w,n),h(""),n&&(s(),f(!1)),m.current&&(m.current.style.height="auto"))},[u,e,t,n,i,s]),v=L.useCallback(()=>{const w=m.current;w&&(w.style.height="auto",w.style.height=`${Math.min(w.scrollHeight,160)}px`)},[]),_=u.trim().length>0&&!e&&!t;return d.jsxs("div",{className:"border-t border-border bg-background p-4","data-tour":"chat-input-area",children:[d.jsx("input",{ref:r,type:"file",className:"hidden",onChange:o,"data-testid":"chat-file-input"}),d.jsxs("div",{className:"flex items-end gap-2",children:[d.jsx("button",{type:"button",onClick:()=>{var w;return(w=r.current)==null?void 0:w.click()},disabled:!l||a,className:be("flex h-11 w-11 shrink-0 items-center justify-center rounded-xl transition-colors",a?"bg-primary/10 text-primary animate-pulse":"text-muted-foreground hover:bg-muted hover:text-foreground"),title:c("chat.attach","Attach file"),"data-testid":"chat-attach-btn",children:a?d.jsx(ni,{className:"h-4 w-4 animate-spin"}):d.jsx(mHe,{className:"h-4 w-4"})}),d.jsx("button",{type:"button",onClick:s,className:be("flex h-11 w-11 shrink-0 items-center justify-center rounded-xl transition-colors",n?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted hover:text-foreground"),title:n?c("chat.secretModeOn","Secret mode ON"):c("chat.secretModeOff","Toggle secret mode"),"data-testid":"chat-secret-toggle",children:n?d.jsx(d7,{className:"h-4 w-4"}):d.jsx(W7e,{className:"h-4 w-4"})}),n?d.jsxs("div",{className:"relative flex-1",children:[d.jsx("input",{type:g?"text":"password",value:u,onChange:w=>h(w.target.value),onKeyDown:w=>{w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),x())},placeholder:c("chat.secretPlaceholder","Enter secret value..."),disabled:e,autoComplete:"off",className:be("w-full rounded-xl border border-primary/60 bg-card px-4 py-3 pe-10 text-sm","placeholder:text-muted-foreground","focus:outline-none focus:ring-2 focus:ring-primary/30","disabled:cursor-not-allowed disabled:opacity-50","min-h-[44px]"),"data-testid":"chat-input"}),d.jsx("button",{type:"button",onClick:()=>f(!g),className:"absolute inset-e-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","data-testid":"chat-eye-toggle",children:g?d.jsx(Sh,{className:"h-4 w-4"}):d.jsx(_b,{className:"h-4 w-4"})})]}):d.jsx("textarea",{ref:m,"data-testid":"chat-input",value:u,onChange:w=>{h(w.target.value),v()},onKeyDown:w=>{w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),x())},placeholder:c("chat.placeholder"),disabled:e,rows:1,className:be("flex-1 resize-none rounded-xl border border-input bg-card px-4 py-3 text-sm","placeholder:text-muted-foreground","focus:outline-none focus:ring-2 focus:ring-ring","disabled:cursor-not-allowed disabled:opacity-50","max-h-40 min-h-[44px]")}),d.jsx("button",{onClick:x,disabled:!_,className:be("flex h-11 w-11 shrink-0 items-center justify-center rounded-xl transition-colors",_?"bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer":"bg-muted text-muted-foreground cursor-not-allowed"),"aria-label":c("chat.send"),"data-testid":"chat-send",children:t?d.jsx(ni,{className:"h-5 w-5 animate-spin"}):d.jsx(mA,{className:"h-5 w-5"})})]})]})}function wot(){const{t:i}=xe();return d.jsx("div",{className:"flex h-full items-center justify-center",children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"mx-auto flex h-20 w-20 items-center justify-center rounded-2xl bg-primary/10",children:d.jsx(ai,{className:"h-10 w-10 text-primary"})}),d.jsx("h3",{className:"mt-4 text-lg font-semibold text-foreground",children:i("pages.chat.title")}),d.jsx("p",{className:"mt-1 max-w-xs text-sm text-muted-foreground",children:i("chat.empty")})]})})}function Cot(){const{t:i}=xe();L.useEffect(()=>{_c.getState().close()},[]);const e=$s(t=>t.maybeAutoStart);return L.useEffect(()=>{const t=setTimeout(()=>e("chat"),500);return()=>clearTimeout(t)},[e]),d.jsxs("div",{className:"flex h-[calc(100vh-(--spacing(16))-(--spacing(12)))] flex-col gap-4",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-2 text-3xl font-bold text-foreground",children:[d.jsx(Jf,{className:"h-8 w-8 text-primary"}),i("pages.chat.title")]}),d.jsx("p",{className:"mt-1 text-muted-foreground",children:i("pages.chat.subtitle")})]}),d.jsx("div",{className:"min-h-0 flex-1",children:d.jsx(KG,{})})]})}async function Sot(i,e,t,n,s,r){let o;if(r!=null&&r.skipResourceSave)o=t;else{const w=await $rt(i,e,t,n);o=Y2(w.location)}if(!s)return{newResourceVersion:o};const a=JLe(i,e,o),l=await qM(s.workflowId,s.workflowVersion),c=eDe(l,i,e,a),u=await Dse(s.workflowId,s.workflowVersion,c),h=Y2(u.location),g=`eddi://ai.labs.workflow/workflowstore/workflows/${s.workflowId}?version=${s.workflowVersion}`,f=`eddi://ai.labs.workflow/workflowstore/workflows/${s.workflowId}?version=${h}`,m=await vC(s.agentId,s.agentVersion),x={...m,workflows:(m.workflows??[]).map(w=>w===g?f:w)},v=await jM(s.agentId,s.agentVersion,x),_=Y2(v.location);return{newResourceVersion:o,newWorkflowVersion:h,newAgentVersion:_}}async function kot(i,e,t,n,s){const r=JLe(i,e,n),o=await qM(s.workflowId,s.workflowVersion),a=eDe(o,i,e,r),l=await Dse(s.workflowId,s.workflowVersion,a),c=Y2(l.location),u=`eddi://ai.labs.workflow/workflowstore/workflows/${s.workflowId}?version=${s.workflowVersion}`,h=`eddi://ai.labs.workflow/workflowstore/workflows/${s.workflowId}?version=${c}`,g=await vC(s.agentId,s.agentVersion),f={...g,workflows:(g.workflows??[]).map(v=>v===u?h:v)},m=await jM(s.agentId,s.agentVersion,f),x=Y2(m.location);return{newWorkflowVersion:c,newAgentVersion:x}}function Y2(i){const{version:e}=uo(i);return e}function JLe(i,e,t){return`eddi://${i.extension}/${i.store}/${i.plural}/${e}?version=${t}`}function eDe(i,e,t,n){const s=`/${e.store}/${e.plural}/${t}`;return{...i,workflowSteps:i.workflowSteps.map(r=>{var a;const o=(a=r.config)==null?void 0:a.uri;return typeof o=="string"&&o.includes(s)?{...r,config:{...r.config,uri:n}}:r})}}function SC(i){return["resources",i]}function kC(i){return KL(i)}function tDe(i,e=100,t=0,n=""){const s=kC(i);return hn({queryKey:[...SC(i),"descriptors",{limit:e,index:t,filter:n}],queryFn:()=>qLe(s,e,t,n),enabled:!!s})}function nDe(i,e,t){const n=kC(i);return hn({queryKey:[...SC(i),e,t],queryFn:()=>KLe(n,e,t),enabled:!!n&&!!e&&t>0})}function iDe(i,e){const t=kC(i);return hn({queryKey:[...SC(i),e,"versions"],queryFn:()=>Grt(t,e),enabled:!!t&&!!e})}function Not(i){const e=cn(),t=kC(i);return Kt({mutationFn:async({body:n={},name:s,description:r})=>{if(!t)throw new Error(`Unknown resource type: ${i}`);const o=await GLe(t,n);if((s||r)&&o.location){const a=new URL(o.location,"http://dummy"),l=a.pathname.split("/").filter(Boolean),c=l[l.length-1],u=parseInt(a.searchParams.get("version")||"1",10);await Tse(c,u,{name:s,description:r})}return o},onSuccess:()=>{e.invalidateQueries({queryKey:SC(i)})}})}function sDe(i){const e=cn(),t=kC(i);return Kt({mutationFn:({id:n,version:s})=>t?qrt(t,n,s):Promise.reject(new Error(`Unknown resource type: ${i}`)),onSuccess:()=>{e.invalidateQueries({queryKey:SC(i)})}})}function rDe(i){const e=cn(),t=kC(i);return Kt({mutationFn:({id:n,version:s})=>t?Krt(t,n,s):Promise.reject(new Error(`Unknown resource type: ${i}`)),onSuccess:()=>{e.invalidateQueries({queryKey:SC(i)})}})}function oDe(i){const e=cn(),t=kC(i);return Kt({mutationFn:({id:n,version:s,body:r,context:o,skipResourceSave:a})=>t?Sot(t,n,s,r,o,{skipResourceSave:a}):Promise.reject(new Error(`Unknown resource type: ${i}`)),onSuccess:()=>{e.invalidateQueries({queryKey:SC(i)}),e.invalidateQueries({queryKey:["workflows"]}),e.invalidateQueries({queryKey:["agents"]})}})}const Eot={GitBranch:Vb,Globe:Su,MessageSquareText:AL,BookOpen:Lw,BookOpenCheck:SSe,Brain:Nl,Settings:xp,Plug:PM};function Lot({slug:i,iconName:e,labelKey:t}){const{t:n}=xe(),{data:s}=tDe(i,1e3,0,""),r=Eot[e]??bp,o=(s==null?void 0:s.length)??0;return d.jsxs(Kn,{to:`/manage/resources/${i}`,className:be("group flex flex-col rounded-xl border bg-card p-6 shadow-sm transition-all duration-200","hover:shadow-lg hover:border-primary/30 hover:-translate-y-0.5"),"data-testid":`resource-type-${i}`,children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsx("div",{className:"rounded-xl bg-primary/10 p-3",children:d.jsx(r,{className:"h-6 w-6 text-primary"})}),d.jsx(hs,{className:"h-5 w-5 text-muted-foreground/40 transition-transform group-hover:translate-x-0.5 group-hover:text-primary"})]}),d.jsxs("div",{className:"mt-4",children:[d.jsx("h3",{className:"text-lg font-semibold text-foreground",children:n(`${t}.name`)}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-2",children:n(`${t}.description`)})]}),d.jsx("div",{className:"mt-auto pt-4 border-t border-border",children:d.jsx("span",{className:"text-sm font-medium text-primary",children:n("resources.itemCount",{count:o,defaultValue:`${o} item(s)`})})})]})}function Dot(){const{t:i}=xe(),e=$s(t=>t.maybeAutoStart);return L.useEffect(()=>{const t=setTimeout(()=>e("resources"),500);return()=>clearTimeout(t)},[e]),d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-2 text-3xl font-bold text-foreground",children:[d.jsx(bp,{className:"h-8 w-8 text-primary"}),i("pages.resources.title")]}),d.jsx("p",{className:"mt-1 text-muted-foreground",children:i("pages.resources.subtitle")})]}),d.jsx("div",{className:be("grid gap-4","grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"),"data-testid":"resource-types-grid",children:$Le.map(t=>d.jsx(Lot,{slug:t.slug,iconName:t.icon,labelKey:t.labelKey},t.slug))})]})}const Tot={GitBranch:Vb,Globe:Su,MessageSquareText:AL,BookOpen:Lw,Brain:Nl,Settings:xp};function Iot({item:i,typeSlug:e,iconName:t,onDuplicate:n,onDelete:s}){const{t:r}=xe(),[o,a]=L.useState(!1),l=Tot[t]??Vb,c=Aot(i.lastModifiedOn);return d.jsxs("div",{className:be("group relative flex flex-col rounded-xl border bg-card p-5 shadow-sm transition-all duration-200","hover:shadow-md hover:border-primary/30"),"data-testid":`resource-card-${i.id}`,children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsx("div",{className:"rounded-lg bg-primary/10 p-2",children:d.jsx(l,{className:"h-5 w-5 text-primary"})}),d.jsxs("div",{className:"relative",children:[d.jsx("button",{onClick:()=>a(!o),className:"rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-secondary hover:text-foreground group-hover:opacity-100","data-testid":`resource-menu-${i.id}`,children:d.jsx(c7,{className:"h-4 w-4"})}),o&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>a(!1)}),d.jsxs("div",{className:"absolute inset-e-0 z-50 mt-1 w-44 rounded-lg border bg-popover py-1 shadow-lg",children:[d.jsxs("button",{onClick:()=>{n(i.id,i.version),a(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-popover-foreground hover:bg-secondary",children:[d.jsx(mo,{className:"h-4 w-4"}),r("common.duplicate")]}),d.jsxs("button",{onClick:()=>{s(i.id,i.version),a(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-destructive hover:bg-destructive/10",children:[d.jsx(_n,{className:"h-4 w-4"}),r("common.delete")]})]})]})]})]}),d.jsxs("div",{className:"mt-4 flex-1",children:[d.jsxs(Kn,{to:`/manage/resources/${e}/${i.id}`,className:"text-lg font-semibold text-foreground hover:text-primary transition-colors",children:[i.name||r("resources.unnamed","Unnamed Resource"),d.jsx(To,{className:"ms-1 inline h-3.5 w-3.5 opacity-0 group-hover:opacity-50"})]}),d.jsx("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground/70 truncate",title:i.id,children:i.id}),d.jsx("p",{className:"mt-1 line-clamp-2 text-sm text-muted-foreground",children:i.description||r("resources.noDescription","No description")})]}),d.jsxs("div",{className:"mt-4 flex items-center justify-between border-t border-border pt-3",children:[d.jsx("span",{className:"text-xs text-muted-foreground",title:new Date(i.lastModifiedOn).toLocaleString(),children:c}),d.jsxs("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:["v",i.version]})]})]})}function Aot(i){const t=Date.now()-i,n=Math.floor(t/6e4),s=Math.floor(t/36e5),r=Math.floor(t/864e5);return n<1?"Just now":n<60?`${n}m ago`:s<24?`${s}h ago`:r<30?`${r}d ago`:new Date(i).toLocaleDateString()}const Rot=/^[a-z0-9_]+$/;function Mot({open:i,onClose:e,typeSlug:t,typeName:n,workflowName:s}){const{t:r}=xe(),o=il(),a=Not(t),l=t==="snippets",c=L.useMemo(()=>l?(s?s.toLowerCase().replace(/[^a-z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,""):"new_snippet")||"new_snippet":s?`${s} — ${n}`:`${r("common.new","New")} ${n}`,[l,s,n,r]),[u,h]=L.useState(c),[g,f]=L.useState(""),m=L.useMemo(()=>{if(!l)return"";const v=u.trim();return v?Rot.test(v)?"":r("resources.snippetNameInvalid","Only lowercase letters (a-z), digits (0-9), and underscores (_) are allowed."):r("resources.snippetNameRequired","Snippet name is required.")},[l,u,r]);L.useEffect(()=>{i&&(h(c),f(""))},[i,c]),L.useEffect(()=>{if(!i)return;function v(_){_.key==="Escape"&&e()}return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[i,e]);const x=L.useCallback(async v=>{if(v.preventDefault(),!m)try{const _=l?{name:u.trim(),description:g.trim()||void 0}:{},w=await a.mutateAsync({body:_,name:u.trim()||void 0,description:g.trim()||void 0});if(ze.success(r("resources.createSuccess",{type:n,defaultValue:`${n} created successfully`})),e(),w.location){const k=w.location.split("/"),E=(k[k.length-1]??"").split("?")[0];E&&o(`/manage/resources/${t}/${E}`)}}catch(_){ze.error(Vs(_))}},[a,u,g,n,t,o,e,r,l,m]);return i?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",onClick:e,"data-testid":"create-resource-backdrop"}),d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:d.jsxs("div",{className:"w-full max-w-md rounded-xl border bg-card p-6 shadow-2xl",onClick:v=>v.stopPropagation(),"data-testid":"create-resource-dialog",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:r("resources.createTitle",{type:n,defaultValue:`Create ${n}`})}),d.jsx("button",{onClick:e,className:"rounded-md p-1 text-muted-foreground hover:bg-secondary hover:text-foreground","data-testid":"create-resource-close",children:d.jsx(An,{className:"h-5 w-5"})})]}),d.jsxs("form",{onSubmit:x,className:"mt-6 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"resource-name",className:"mb-1.5 block text-sm font-medium text-foreground",children:r("common.name","Name")}),d.jsx("input",{id:"resource-name",type:"text",value:u,onChange:v=>{h(l?v.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_"):v.target.value)},placeholder:l?"e.g. cautious_mode":`My ${n}`,className:`w-full rounded-lg border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring ${m?"border-destructive focus:ring-destructive":"border-input"}`,autoFocus:!0,"data-testid":"resource-name-input"}),m&&d.jsx("p",{className:"mt-1 text-xs text-destructive",children:m}),l&&!m&&u.trim()&&d.jsxs("p",{className:"mt-1 text-[11px] text-muted-foreground font-mono",children:[r("snippetEditor.usageHint","Usage:")," ",d.jsxs("code",{className:"rounded bg-primary/10 px-1 py-0.5 text-primary",children:["{{",d.jsx("wbr",{}),"snippets.",u.trim(),"}}"]})]})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"resource-description",className:"mb-1.5 block text-sm font-medium text-foreground",children:r("common.description","Description")}),d.jsx("textarea",{id:"resource-description",value:g,onChange:v=>f(v.target.value),placeholder:r("resources.descriptionPlaceholder",`Describe this ${n.toLowerCase()} configuration...`),rows:3,className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-none","data-testid":"resource-description-input"})]}),a.isError&&d.jsx("p",{className:"text-sm text-destructive","data-testid":"create-resource-error",children:Vs(a.error)}),d.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[d.jsx("button",{type:"button",onClick:e,className:"rounded-lg px-4 py-2 text-sm font-medium text-muted-foreground hover:bg-secondary transition-colors",children:r("common.cancel")}),d.jsx("button",{type:"submit",disabled:a.isPending||!!m,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"create-resource-submit",children:a.isPending?r("common.loading"):r("common.create")})]})]})]})})]}):null}function EA({to:i,label:e}){return d.jsxs(Kn,{to:i,className:"inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors","data-testid":"back-to-list",children:[d.jsx(El,{className:"h-4 w-4"}),e]})}const Pot={GitBranch:Vb,Globe:Su,MessageSquareText:AL,BookOpen:Lw,BookOpenCheck:SSe,Brain:Nl,Settings:xp,Plug:PM};function Oot(){const{type:i}=K_(),{t:e}=xe(),[t,n]=L.useState(""),[s,r]=L.useState(!1),[o,a]=L.useState(null),[l,c]=L.useState(()=>WE(`resources-${i}`));L.useEffect(()=>{n(""),c(WE(`resources-${i}`))},[i]);const u=KL(i??""),{data:h,isLoading:g,isError:f,refetch:m}=tDe(i??"",100,0,t),x=sDe(i??""),v=rDe(i??"");if(!u)return d.jsxs("div",{className:"space-y-4 py-20",children:[d.jsx(ep,{message:e("resources.unknownType")}),d.jsx("div",{className:"text-center",children:d.jsx(Kn,{to:"/manage/resources",className:"text-sm text-primary hover:underline",children:e("resources.backToResources")})})]});const _=Pot[u.icon]??bp,w=e(`${u.labelKey}.name`),k=(h??[]).map(I=>{const{id:R,version:P}=uo(I.resource);return{...I,id:R,version:P}});function C(I,R){a({id:I,version:R})}function E(){o&&x.mutate(o,{onSuccess:()=>{ze.success(e("common.delete")+" ✓"),a(null)},onError:()=>ze.error(e("common.error"))})}function D(I,R){v.mutate({id:I,version:R},{onSuccess:()=>ze.success(e("common.duplicate")+" ✓"),onError:()=>ze.error(e("common.error"))})}function T(I){c(I),JM(`resources-${i}`,I)}return d.jsxs("div",{className:"space-y-6",children:[d.jsx(EA,{to:"/manage/resources",label:e("resources.backToResources")}),d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-2 text-3xl font-bold text-foreground",children:[d.jsx(_,{className:"h-8 w-8 text-primary"}),w]}),d.jsx("p",{className:"mt-1 text-muted-foreground",children:e(`${u.labelKey}.description`)})]}),d.jsxs(Yt,{onClick:()=>r(!0),"data-testid":"create-resource-btn",children:[d.jsx(Gt,{className:"h-4 w-4"}),e("resources.create",{type:w})]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx(br,{className:"absolute inset-s-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:t,onChange:I=>n(I.target.value),placeholder:e("common.search"),className:"w-full rounded-lg border border-input bg-background py-2.5 ps-10 pe-4 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"resource-search"})]}),d.jsx(zL,{view:l,onChange:T})]}),g&&d.jsx("div",{className:"cq-card-grid",children:Array.from({length:4}).map((I,R)=>d.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 space-y-3",children:[d.jsx(bi,{className:"h-5 w-3/4"}),d.jsx(bi,{className:"h-4 w-1/2"}),d.jsx(bi,{className:"h-4 w-full"})]},R))}),f&&d.jsx(ep,{message:e("common.error"),onRetry:()=>m(),retryLabel:e("common.retry")}),!g&&!f&&k.length===0&&d.jsx(ZM,{icon:_,title:t?e("common.noResults"):e("resources.empty",{type:w}),description:t?void 0:e("resources.emptyDescription",{type:w,defaultValue:"Create your first {{type}} to use it in workflows."}),actionLabel:t?void 0:e("resources.create",{type:w}),onAction:t?void 0:()=>r(!0)}),!g&&!f&&k.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:e("resources.count",{count:k.length})}),l==="card"?d.jsx("div",{className:"cq-card-grid","data-testid":"resource-grid",children:k.map(I=>d.jsx(Iot,{item:I,typeSlug:i??"",iconName:u.icon,onDuplicate:D,onDelete:C},I.resource))}):d.jsx("div",{className:"overflow-hidden rounded-xl border bg-card shadow-sm","data-testid":"resource-list",children:d.jsxs("table",{className:"w-full",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-border bg-secondary/50",children:[d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:e("common.name","Name")}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:e("common.id","ID")}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:e("common.version","Version")}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:e("common.modified","Modified")}),d.jsx("th",{className:"px-5 py-3 text-end text-xs font-medium uppercase tracking-wider text-muted-foreground",children:e("conversations.actions","Actions")})]})}),d.jsx("tbody",{className:"divide-y divide-border",children:k.map(I=>d.jsxs("tr",{className:"hover:bg-secondary/30 transition-colors",children:[d.jsx("td",{className:"px-5 py-3",children:d.jsxs(Kn,{to:`/manage/resources/${i}/${I.id}`,className:"text-sm font-medium text-foreground hover:text-primary transition-colors",children:[I.name||e("resources.unnamed","Unnamed Resource"),d.jsx(To,{className:"ms-1 inline h-3 w-3 opacity-40"})]})}),d.jsx("td",{className:"px-5 py-3",children:d.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[I.id.slice(0,12),"…"]})}),d.jsx("td",{className:"px-5 py-3",children:d.jsxs("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:["v",I.version]})}),d.jsx("td",{className:"px-5 py-3",children:d.jsx("span",{className:"text-sm text-muted-foreground",children:new Date(I.lastModifiedOn).toLocaleString()})}),d.jsx("td",{className:"px-5 py-3 text-end",children:d.jsxs("div",{className:"inline-flex items-center gap-1",children:[d.jsx("button",{onClick:()=>D(I.id,I.version),className:"rounded-md p-1.5 text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors",title:e("common.duplicate","Duplicate"),children:d.jsx(mo,{className:"h-4 w-4"})}),d.jsx("button",{onClick:()=>C(I.id,I.version),className:"rounded-md p-1.5 text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",title:e("common.delete"),children:d.jsx(_n,{className:"h-4 w-4"})})]})})]},I.resource))})]})})]}),d.jsx(Mot,{open:s,onClose:()=>r(!1),typeSlug:i??"",typeName:w}),d.jsx(sl,{open:o!==null,onOpenChange:I=>!I&&a(null),title:e("resources.confirmDelete",{type:w}),description:e("resources.confirmDeleteDescription",{type:w,defaultValue:"This action cannot be undone. The {{type}} will be permanently deleted."}),confirmLabel:e("common.delete"),cancelLabel:e("common.cancel"),onConfirm:E,isPending:x.isPending})]})}function jot({open:i,onConfirm:e,onCancel:t,message:n,title:s}){const{t:r}=xe(),o=L.useRef(null),a=L.useRef(null);L.useEffect(()=>{var c;i?(a.current=document.activeElement,requestAnimationFrame(()=>{var u,h;(h=(u=o.current)==null?void 0:u.querySelector("button"))==null||h.focus()})):(c=a.current)==null||c.focus()},[i]),L.useEffect(()=>{if(!i)return;function c(u){u.key==="Escape"&&t()}return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[i,t]);const l=L.useCallback(c=>{if(c.key!=="Tab")return;const u=o.current;if(!u)return;const h=u.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(h.length===0)return;const g=h[0],f=h[h.length-1];c.shiftKey&&document.activeElement===g?(c.preventDefault(),f.focus()):!c.shiftKey&&document.activeElement===f&&(c.preventDefault(),g.focus())},[]);return i?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-50 bg-black/50",onClick:t,"aria-hidden":"true"}),d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:d.jsxs("div",{ref:o,role:"alertdialog","aria-modal":"true","aria-labelledby":"unsaved-dialog-title","aria-describedby":"unsaved-dialog-desc",className:"w-full max-w-sm rounded-xl border bg-card shadow-2xl",onKeyDown:l,children:[d.jsxs("div",{className:"flex items-center gap-3 border-b border-border p-5",children:[d.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-amber-100 dark:bg-amber-900/30",children:d.jsx(Vi,{className:"h-5 w-5 text-amber-600 dark:text-amber-400","aria-hidden":"true"})}),d.jsx("h2",{id:"unsaved-dialog-title",className:"text-lg font-semibold text-foreground",children:s??r("editor.unsavedTitle","Unsaved Changes")})]}),d.jsx("div",{className:"p-5",children:d.jsx("p",{id:"unsaved-dialog-desc",className:"text-sm text-muted-foreground",children:n??r("editor.unsavedMessage","You have unsaved changes that will be lost. Are you sure you want to continue?")})}),d.jsxs("div",{className:"flex justify-end gap-2 border-t border-border p-4",children:[d.jsx("button",{onClick:t,className:"rounded-lg px-4 py-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors","data-testid":"unsaved-cancel",children:r("common.cancel","Cancel")}),d.jsx("button",{onClick:e,className:"rounded-lg bg-destructive px-4 py-2 text-sm font-medium text-destructive-foreground hover:bg-destructive/90 transition-colors","data-testid":"unsaved-confirm",children:r("editor.discardAndLeave","Discard & Leave")})]})]})})]}):null}function dme(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t=i.length?i.apply(this,s):function(){for(var o=arguments.length,a=new Array(o),l=0;l1&&arguments[1]!==void 0?arguments[1]:{};D5.initial(i),D5.handler(e);var t={current:i},n=m2(aat)(t,e),s=m2(oat)(t),r=m2(D5.changes)(i),o=m2(rat)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return D5.selector(c),c(t.current)}function l(c){Yot(n,s,r,o)(c)}return[a,l]}function rat(i,e){return LA(e)?e(i.current):e}function oat(i,e){return i.current=fme(fme({},i.current),e),e}function aat(i,e,t){return LA(e)?e(i.current):Object.keys(t).forEach(function(n){var s;return(s=e[n])===null||s===void 0?void 0:s.call(e,i.current[n])}),t}var lat={create:sat},cat={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function dat(i){return function e(){for(var t=this,n=arguments.length,s=new Array(n),r=0;r=i.length?i.apply(this,s):function(){for(var o=arguments.length,a=new Array(o),l=0;l{n.current=!1}:i,e)}var ou=Oat;function Q2(){}function Dk(i,e,t,n){return jat(i,n)||Fat(i,e,t,n)}function jat(i,e){return i.editor.getModel(gDe(i,e))}function Fat(i,e,t,n){return i.editor.createModel(e,t,n?gDe(i,n):void 0)}function gDe(i,e){return i.Uri.parse(e)}function Bat({original:i,modified:e,language:t,originalLanguage:n,modifiedLanguage:s,originalModelPath:r,modifiedModelPath:o,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:h={},height:g="100%",width:f="100%",className:m,wrapperProps:x={},beforeMount:v=Q2,onMount:_=Q2}){let[w,k]=L.useState(!1),[C,E]=L.useState(!0),D=L.useRef(null),T=L.useRef(null),I=L.useRef(null),R=L.useRef(_),P=L.useRef(v),j=L.useRef(!1);hDe(()=>{let K=Qse.init();return K.then(z=>(T.current=z)&&E(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>D.current?$():K.cancel()}),ou(()=>{if(D.current&&T.current){let K=D.current.getOriginalEditor(),z=Dk(T.current,i||"",n||t||"text",r||"");z!==K.getModel()&&K.setModel(z)}},[r],w),ou(()=>{if(D.current&&T.current){let K=D.current.getModifiedEditor(),z=Dk(T.current,e||"",s||t||"text",o||"");z!==K.getModel()&&K.setModel(z)}},[o],w),ou(()=>{let K=D.current.getModifiedEditor();K.getOption(T.current.editor.EditorOption.readOnly)?K.setValue(e||""):e!==K.getValue()&&(K.executeEdits("",[{range:K.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),K.pushUndoStop())},[e],w),ou(()=>{var K,z;(z=(K=D.current)==null?void 0:K.getModel())==null||z.original.setValue(i||"")},[i],w),ou(()=>{let{original:K,modified:z}=D.current.getModel();T.current.editor.setModelLanguage(K,n||t||"text"),T.current.editor.setModelLanguage(z,s||t||"text")},[t,n,s],w),ou(()=>{var K;(K=T.current)==null||K.editor.setTheme(c)},[c],w),ou(()=>{var K;(K=D.current)==null||K.updateOptions(h)},[h],w);let B=L.useCallback(()=>{var G;if(!T.current)return;P.current(T.current);let K=Dk(T.current,i||"",n||t||"text",r||""),z=Dk(T.current,e||"",s||t||"text",o||"");(G=D.current)==null||G.setModel({original:K,modified:z})},[t,e,s,i,n,r,o]),U=L.useCallback(()=>{var K;!j.current&&I.current&&(D.current=T.current.editor.createDiffEditor(I.current,{automaticLayout:!0,...h}),B(),(K=T.current)==null||K.editor.setTheme(c),k(!0),j.current=!0)},[h,c,B]);L.useEffect(()=>{w&&R.current(D.current,T.current)},[w]),L.useEffect(()=>{!C&&!w&&U()},[C,w,U]);function $(){var z,G,ne,te;let K=(z=D.current)==null?void 0:z.getModel();a||((G=K==null?void 0:K.original)==null||G.dispose()),l||((ne=K==null?void 0:K.modified)==null||ne.dispose()),(te=D.current)==null||te.dispose()}return ft.createElement(uDe,{width:f,height:g,isEditorReady:w,loading:u,_ref:I,className:m,wrapperProps:x})}var Hat=Bat,Wat=L.memo(Hat);function Vat(i){let e=L.useRef();return L.useEffect(()=>{e.current=i},[i]),e.current}var zat=Vat,T5=new Map;function Uat({defaultValue:i,defaultLanguage:e,defaultPath:t,value:n,language:s,path:r,theme:o="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:h=!0,keepCurrentModel:g=!1,width:f="100%",height:m="100%",className:x,wrapperProps:v={},beforeMount:_=Q2,onMount:w=Q2,onChange:k,onValidate:C=Q2}){let[E,D]=L.useState(!1),[T,I]=L.useState(!0),R=L.useRef(null),P=L.useRef(null),j=L.useRef(null),B=L.useRef(w),U=L.useRef(_),$=L.useRef(),K=L.useRef(n),z=zat(r),G=L.useRef(!1),ne=L.useRef(!1);hDe(()=>{let Q=Qse.init();return Q.then(Y=>(R.current=Y)&&I(!1)).catch(Y=>(Y==null?void 0:Y.type)!=="cancelation"&&console.error("Monaco initialization: error:",Y)),()=>P.current?H():Q.cancel()}),ou(()=>{var Y,V,ue,he;let Q=Dk(R.current,i||n||"",e||s||"",r||t||"");Q!==((Y=P.current)==null?void 0:Y.getModel())&&(h&&T5.set(z,(V=P.current)==null?void 0:V.saveViewState()),(ue=P.current)==null||ue.setModel(Q),h&&((he=P.current)==null||he.restoreViewState(T5.get(r))))},[r],E),ou(()=>{var Q;(Q=P.current)==null||Q.updateOptions(c)},[c],E),ou(()=>{!P.current||n===void 0||(P.current.getOption(R.current.editor.EditorOption.readOnly)?P.current.setValue(n):n!==P.current.getValue()&&(ne.current=!0,P.current.executeEdits("",[{range:P.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),P.current.pushUndoStop(),ne.current=!1))},[n],E),ou(()=>{var Y,V;let Q=(Y=P.current)==null?void 0:Y.getModel();Q&&s&&((V=R.current)==null||V.editor.setModelLanguage(Q,s))},[s],E),ou(()=>{var Q;a!==void 0&&((Q=P.current)==null||Q.revealLine(a))},[a],E),ou(()=>{var Q;(Q=R.current)==null||Q.editor.setTheme(o)},[o],E);let te=L.useCallback(()=>{var Q;if(!(!j.current||!R.current)&&!G.current){U.current(R.current);let Y=r||t,V=Dk(R.current,n||i||"",e||s||"",Y||"");P.current=(Q=R.current)==null?void 0:Q.editor.create(j.current,{model:V,automaticLayout:!0,...c},u),h&&P.current.restoreViewState(T5.get(Y)),R.current.editor.setTheme(o),a!==void 0&&P.current.revealLine(a),D(!0),G.current=!0}},[i,e,t,n,s,r,c,u,h,o,a]);L.useEffect(()=>{E&&B.current(P.current,R.current)},[E]),L.useEffect(()=>{!T&&!E&&te()},[T,E,te]),K.current=n,L.useEffect(()=>{var Q,Y;E&&k&&((Q=$.current)==null||Q.dispose(),$.current=(Y=P.current)==null?void 0:Y.onDidChangeModelContent(V=>{ne.current||k(P.current.getValue(),V)}))},[E,k]),L.useEffect(()=>{if(E){let Q=R.current.editor.onDidChangeMarkers(Y=>{var ue;let V=(ue=P.current.getModel())==null?void 0:ue.uri;if(V&&Y.find(he=>he.path===V.path)){let he=R.current.editor.getModelMarkers({resource:V});C==null||C(he)}});return()=>{Q==null||Q.dispose()}}return()=>{}},[E,C]);function H(){var Q,Y;(Q=$.current)==null||Q.dispose(),g?h&&T5.set(r,P.current.saveViewState()):(Y=P.current.getModel())==null||Y.dispose(),P.current.dispose()}return ft.createElement(uDe,{width:f,height:m,isEditorReady:E,loading:l,_ref:j,className:x,wrapperProps:v})}var $at=Uat,qat=L.memo($at),W7=qat;function Kat({value:i,onChange:e,readOnly:t=!1,height:n="500px",testId:s="json-editor",jsonSchema:r}){const{resolvedTheme:o}=RM(),a=L.useRef(null),l=L.useCallback(h=>{a.current=h,setTimeout(()=>{var g;(g=h.getAction("editor.action.formatDocument"))==null||g.run()},100)},[]),c=L.useCallback(h=>{h.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,allowComments:!1,trailingCommas:"error",schemas:r?[{uri:"eddi://schema/resource.json",fileMatch:["*"],schema:r}]:[]})},[r]),u=L.useCallback(h=>{h!==void 0&&e&&e(h)},[e]);return d.jsx("div",{"data-testid":s,className:"overflow-hidden rounded-lg border border-border",children:d.jsx(W7,{height:n,language:"json",theme:o==="dark"?"vs-dark":"vs",value:i,onChange:u,beforeMount:c,onMount:l,options:{readOnly:t,minimap:{enabled:!1},fontSize:13,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",tabSize:2,automaticLayout:!0,folding:!0,bracketPairColorization:{enabled:!0},renderLineHighlight:"gutter",scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8},padding:{top:12,bottom:12}},loading:d.jsx("div",{className:"flex items-center justify-center",style:{height:n},children:d.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[d.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"}),"Loading editor..."]})})})})}function Gat(i){const e=Date.now()-i,t=Math.floor(e/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;const n=Math.floor(t/60);if(n<24)return`${n}h ago`;const s=Math.floor(n/24);return s<30?`${s}d ago`:new Date(i).toLocaleDateString()}function Yat({versions:i,current:e,onChange:t,disabled:n=!1}){const{t:s}=xe();return i.length<=1?d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground","data-testid":"version-badge",children:["v",e]}):d.jsx("select",{value:e,onChange:r=>t(Number(r.target.value)),disabled:n,"data-testid":"version-picker",className:"rounded-md border border-input bg-background px-2.5 py-1 text-xs font-medium text-foreground shadow-sm transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 disabled:opacity-50","aria-label":s("editor.versionPicker","Select version"),children:i.map(r=>d.jsxs("option",{value:r.version,children:["v",r.version,r.lastModifiedOn?` — ${Gat(r.lastModifiedOn)}`:""]},r.version))})}function fDe({typeName:i,typeIcon:e,resourceId:t,data:n,versions:s,currentVersion:r,onVersionChange:o,onSave:a,onSaveAndDeploy:l,isSaving:c=!1,isSaveAndDeploying:u=!1,saveSuccess:h=!1,saveError:g,readOnly:f=!1,children:m,renderFormEditor:x,jsonSchema:v,onCompare:_}){const{t:w}=xe(),k=!!(x||m),[C,E]=L.useState(k?"form":"json"),[D,T]=L.useState(n);L.useEffect(()=>{T(n)},[n]);const I=L.useCallback(z=>{T(JSON.stringify(z,null,2))},[]),R=D!==n,[P,j]=L.useState(!1);YLe(R&&!f);const B=L.useCallback(()=>{T(n),j(!1)},[n]),U=L.useCallback(()=>{try{JSON.parse(D),a(D)}catch{}},[D,a]),$=L.useCallback(()=>{if(l)try{JSON.parse(D),l(D)}catch{}},[D,l]),K=L.useCallback(z=>{T(z)},[]);return d.jsxs("div",{className:"space-y-4","data-testid":"config-editor-layout",children:[d.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[e&&d.jsx(e,{className:"h-6 w-6 text-primary"}),d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:i}),d.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:t})]}),d.jsx(Yat,{versions:s,current:r,onChange:o,disabled:R||c||u}),_&&s.length>1&&d.jsxs("button",{onClick:_,className:"inline-flex items-center gap-1 rounded-md border border-input px-2 py-1 text-xs font-medium text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors",title:w("editor.compareVersions","Compare Versions"),"data-testid":"compare-versions-btn",children:[d.jsx(ISe,{className:"h-3.5 w-3.5"}),w("editor.compare","Compare")]}),R&&d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-100 px-2 py-0.5 text-xs font-medium text-amber-800 dark:bg-amber-900/30 dark:text-amber-400","data-testid":"dirty-indicator",children:[d.jsx(Lo,{className:"h-3 w-3"}),w("editor.dirty","Unsaved changes")]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[h&&d.jsxs("span",{className:"text-xs font-medium text-emerald-600 dark:text-emerald-400","data-testid":"save-success",children:["✓ ",w("editor.saved","Saved successfully")]}),g&&d.jsx("span",{className:"text-xs font-medium text-destructive","data-testid":"save-error",children:g}),!f&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:()=>j(!0),disabled:!R||c||u,className:"inline-flex items-center gap-1.5 rounded-lg border border-input px-3 py-2 text-sm font-medium text-foreground shadow-sm transition-all hover:bg-secondary active:scale-[0.98] disabled:opacity-50","data-testid":"discard-btn",children:[d.jsx(Uie,{className:"h-4 w-4"}),w("editor.discard","Discard")]}),d.jsxs("button",{onClick:U,disabled:!R||c||u,className:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-2 text-sm font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 active:scale-[0.98] disabled:opacity-50","data-testid":"save-btn",children:[d.jsx(u7,{className:"h-4 w-4"}),c?w("editor.saving","Saving..."):w("editor.save","Save")]}),l&&d.jsxs("button",{onClick:$,disabled:!R||c||u,className:"inline-flex items-center gap-1.5 rounded-lg bg-emerald-600 px-3 py-2 text-sm font-medium text-white shadow-sm transition-all hover:bg-emerald-700 active:scale-[0.98] disabled:opacity-50 dark:bg-emerald-600 dark:hover:bg-emerald-700","data-testid":"save-test-btn",children:[d.jsx(Ih,{className:"h-4 w-4"}),u?w("editor.deploying","Deploying…"):w("editor.saveAndTest","Save & Test")]})]})]})]}),d.jsxs("div",{className:"flex gap-1 rounded-lg bg-muted p-1","data-testid":"editor-tabs",role:"tablist","aria-label":i,onKeyDown:z=>{if(z.key==="ArrowLeft"||z.key==="ArrowRight"){z.preventDefault();const G=z.key==="ArrowRight"?C==="form"?"json":"form":C==="json"?"form":"json";E(G),requestAnimationFrame(()=>{const ne=document.getElementById(`editor-tab-${G}`);ne==null||ne.focus()})}},children:[d.jsxs("button",{id:"editor-tab-form",role:"tab","aria-selected":C==="form","aria-controls":"editor-tabpanel-form",tabIndex:C==="form"?0:-1,onClick:()=>E("form"),className:`inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-all ${C==="form"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,"data-testid":"tab-form",children:[d.jsx(Vge,{className:"h-4 w-4","aria-hidden":"true"}),w("editor.formTab","Form")]}),d.jsxs("button",{id:"editor-tab-json",role:"tab","aria-selected":C==="json","aria-controls":"editor-tabpanel-json",tabIndex:C==="json"?0:-1,onClick:()=>E("json"),className:`inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-all ${C==="json"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,"data-testid":"tab-json",children:[d.jsx(bp,{className:"h-4 w-4","aria-hidden":"true"}),w("editor.jsonTab","JSON")]})]}),d.jsx("div",{className:"rounded-xl border bg-card shadow-sm",children:C==="form"?d.jsx("div",{id:"editor-tabpanel-form",role:"tabpanel","aria-labelledby":"editor-tab-form",className:"p-6","data-testid":"form-view",children:x?(()=>{try{const z=JSON.parse(D);return x(z,I,f,{resourceId:t,version:r})}catch{return d.jsx("div",{className:"text-sm text-destructive",role:"alert",children:w("editor.invalidJson","Invalid JSON — switch to the JSON tab to fix.")})}})():m||d.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[d.jsx(Vge,{className:"h-10 w-10 text-muted-foreground/50","aria-hidden":"true"}),d.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:w("editor.formPlaceholder","Visual editor coming soon. Use the JSON tab to edit.")})]})}):d.jsx("div",{id:"editor-tabpanel-json",role:"tabpanel","aria-labelledby":"editor-tab-json",className:"p-2","data-testid":"json-view",children:d.jsx(Kat,{value:D,onChange:f?void 0:K,readOnly:f,height:"500px",jsonSchema:v})})}),d.jsx(jot,{open:P,onConfirm:B,onCancel:()=>j(!1),title:w("editor.discardTitle","Discard Changes?"),message:w("editor.discardMessage","Are you sure you want to discard all unsaved changes? This action cannot be undone.")})]})}const Qat=["inputmatcher","actionmatcher","negation","connector","occurrence","dynamicValueMatcher","deploymentContext","capabilityMatch"],Xat=["currentStepOnly","lastStepOnly","anyStep"];function Zat({actions:i,onChange:e,readOnly:t}){const{t:n}=xe(),[s,r]=L.useState(""),o=()=>{const a=s.trim();a&&!i.includes(a)&&(e([...i,a]),r(""))};return d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map((a,l)=>d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:[a,!t&&d.jsx("button",{type:"button",onClick:()=>e(i.filter((c,u)=>u!==l)),className:"rounded p-0.5 hover:bg-primary/20 transition-colors","aria-label":`Remove ${a}`,children:d.jsx(An,{className:"h-3 w-3"})})]},l)),i.length===0&&d.jsx("span",{className:"text-xs text-muted-foreground italic",children:n("rulesEditor.noActions","No actions")})]}),!t&&d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("input",{type:"text",value:s,onChange:a=>r(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),o())},placeholder:n("rulesEditor.actionPlaceholder","e.g. greet, get_weather"),className:"h-8 flex-1 rounded-md border border-input bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsxs("button",{type:"button",onClick:o,className:"inline-flex h-8 items-center gap-1 rounded-md border border-input px-2 text-xs font-medium text-foreground transition-colors hover:bg-secondary",children:[d.jsx(Gt,{className:"h-3 w-3"}),n("rulesEditor.addAction","Add")]})]})]})}function Jat({configKey:i,value:e,onKeyChange:t,onValueChange:n,onRemove:s,readOnly:r}){const{t:o}=xe();return d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("input",{type:"text",value:i,onChange:a=>t(a.target.value),readOnly:r,placeholder:o("rulesEditor.configKey","Key"),className:"h-7 w-28 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"="}),d.jsx("input",{type:"text",value:e,onChange:a=>n(a.target.value),readOnly:r,placeholder:o("rulesEditor.configValue","Value"),className:"h-7 flex-1 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),!r&&d.jsx("button",{type:"button",onClick:s,className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]})}function pDe({condition:i,onChange:e,onRemove:t,readOnly:n,depth:s=0}){const{t:r}=xe(),[o,a]=L.useState(!0),l=i.type==="negation"||i.type==="connector",c=Object.entries(i.configs??{}),u=(v,_)=>{e({...i,configs:{...i.configs,[v]:_}})},h=v=>{const _={...i.configs};delete _[v],e({...i,configs:_})},g=(v,_)=>{if(v===_)return;const w=Object.entries(i.configs??{}),k=Object.fromEntries(w.map(([C,E])=>C===v?[_,E]:[C,E]));e({...i,configs:k})},f=()=>{const v=`key${c.length}`;e({...i,configs:{...i.configs,[v]:""}})},m=()=>{e({...i,conditions:[...i.conditions??[],{type:"inputmatcher",configs:{expressions:"",occurrence:"currentStep"}}]})},x=v=>{let _;switch(v){case"inputmatcher":_={expressions:"",occurrence:"currentStep"};break;case"actionmatcher":_={actions:"",occurrence:"currentStep"};break;case"occurrence":_={maxTimesOccurred:"1",behaviorRuleName:""};break;case"deploymentContext":_={when:"production",tagMatches:""};break;case"capabilityMatch":_={skill:"",strategy:"highest_confidence",attributes:""};break;default:_={};break}e({...i,type:v,configs:_})};return d.jsxs("div",{className:`rounded-lg border bg-card ${s>0?"border-dashed border-muted-foreground/30":"border-border"}`,"data-testid":"condition-editor",children:[d.jsxs("div",{className:"flex items-center gap-2 p-2",children:[d.jsx("button",{type:"button",onClick:()=>a(!o),className:"rounded p-0.5 text-muted-foreground hover:text-foreground transition-colors",children:o?d.jsx(Rn,{className:"h-3.5 w-3.5"}):d.jsx(hs,{className:"h-3.5 w-3.5"})}),d.jsx("select",{value:i.type,onChange:v=>x(v.target.value),disabled:n,className:"h-7 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60","data-testid":"condition-type-select",children:Qat.map(v=>d.jsx("option",{value:v,children:v==="deploymentContext"?r("rulesEditor.condDeploymentContext","deploymentContext"):v==="capabilityMatch"?r("rulesEditor.condCapabilityMatch","capabilityMatch"):v},v))}),d.jsx("span",{className:"flex-1"}),!n&&d.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors","aria-label":r("rulesEditor.removeCondition","Remove"),children:d.jsx(_n,{className:"h-3.5 w-3.5"})})]}),o&&d.jsxs("div",{className:"space-y-2 px-3 pb-3",children:[c.map(([v,_],w)=>d.jsx(Jat,{configKey:v,value:_,onKeyChange:k=>g(v,k),onValueChange:k=>u(v,k),onRemove:()=>h(v),readOnly:n},w)),!n&&d.jsxs("button",{type:"button",onClick:f,className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),r("rulesEditor.addConfig","Add config")]}),l&&d.jsxs("div",{className:"mt-2 space-y-2 ps-3 border-s-2 border-muted",children:[d.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("rulesEditor.nestedConditions","Nested Conditions")}),(i.conditions??[]).map((v,_)=>d.jsx(pDe,{condition:v,onChange:w=>{const k=[...i.conditions??[]];k[_]=w,e({...i,conditions:k})},onRemove:()=>{e({...i,conditions:(i.conditions??[]).filter((w,k)=>k!==_)})},readOnly:n,depth:s+1},_)),!n&&d.jsxs("button",{type:"button",onClick:m,className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),r("rulesEditor.addCondition","Add Condition")]})]})]})]})}function elt({rule:i,onChange:e,onRemove:t,readOnly:n}){const{t:s}=xe(),[r,o]=L.useState(!0);return d.jsxs("div",{className:"rounded-lg border border-border bg-card shadow-sm","data-testid":"rule-editor",children:[d.jsxs("div",{className:"flex items-center gap-2 p-3",children:[d.jsx("button",{type:"button",onClick:()=>o(!r),className:"rounded p-0.5 text-muted-foreground hover:text-foreground transition-colors",children:r?d.jsx(Rn,{className:"h-4 w-4"}):d.jsx(hs,{className:"h-4 w-4"})}),d.jsx("input",{type:"text",value:i.name,onChange:a=>e({...i,name:a.target.value}),readOnly:n,placeholder:s("rulesEditor.ruleName","Rule Name"),className:"h-8 flex-1 rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"rule-name-input"}),!n&&d.jsx("button",{type:"button",onClick:t,className:"rounded p-1.5 text-muted-foreground hover:text-destructive transition-colors","aria-label":s("rulesEditor.removeRule","Remove Rule"),children:d.jsx(_n,{className:"h-4 w-4"})})]}),r&&d.jsxs("div",{className:"space-y-4 border-t px-4 py-3",children:[d.jsxs("div",{children:[d.jsx("h5",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:s("rulesEditor.actions","Actions")}),d.jsx(Zat,{actions:i.actions,onChange:a=>e({...i,actions:a}),readOnly:n})]}),d.jsxs("div",{children:[d.jsx("h5",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:s("rulesEditor.conditions","Conditions")}),d.jsxs("div",{className:"space-y-2",children:[(i.conditions??[]).length===0&&d.jsx("p",{className:"text-xs italic text-muted-foreground",children:s("rulesEditor.noConditions","No conditions")}),(i.conditions??[]).map((a,l)=>d.jsx(pDe,{condition:a,onChange:c=>{const u=[...i.conditions??[]];u[l]=c,e({...i,conditions:u})},onRemove:()=>e({...i,conditions:(i.conditions??[]).filter((c,u)=>u!==l)}),readOnly:n},l)),!n&&d.jsxs("button",{type:"button",onClick:()=>e({...i,conditions:[...i.conditions??[],{type:"inputmatcher",configs:{expressions:"",occurrence:"currentStep"}}]}),className:"inline-flex items-center gap-1.5 rounded-md border border-dashed border-muted-foreground/40 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:border-primary hover:text-primary","data-testid":"add-condition-btn",children:[d.jsx(Gt,{className:"h-3.5 w-3.5"}),s("rulesEditor.addCondition","Add Condition")]})]})]})]})]})}function tlt({data:i,onChange:e,readOnly:t}){const{t:n}=xe();i=i??{};const[s,r]=L.useState(()=>Object.fromEntries((i.behaviorGroups??[]).map((h,g)=>[g,!0]))),o=L.useCallback(h=>{r(g=>({...g,[h]:!g[h]}))},[]),a=L.useCallback((h,g)=>{const f=[...i.behaviorGroups??[]];f[h]=g,e({...i,behaviorGroups:f})},[i,e]),l=L.useCallback(h=>{e({...i,behaviorGroups:(i.behaviorGroups??[]).filter((g,f)=>f!==h)})},[i,e]),c=L.useCallback(()=>{e({...i,behaviorGroups:[...i.behaviorGroups??[],{name:"",executionStrategy:"currentStepOnly",behaviorRules:[]}]})},[i,e]),u=L.useCallback(h=>{const g=[...i.behaviorGroups??[]],f=g[h];f&&(g[h]={...f,behaviorRules:[...f.behaviorRules??[],{name:"",actions:[],conditions:[]}]},e({...i,behaviorGroups:g}))},[i,e]);return d.jsxs("div",{className:"space-y-6","data-testid":"rules-editor",children:[d.jsxs("div",{className:"flex flex-wrap gap-6",children:[d.jsxs("label",{className:"inline-flex items-center gap-2 text-sm text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.appendActions??!1,onChange:h=>e({...i,appendActions:h.target.checked}),disabled:t,className:"h-4 w-4 rounded border-input accent-primary"}),n("rulesEditor.appendActions","Append Actions")]}),d.jsxs("label",{className:"inline-flex items-center gap-2 text-sm text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.expressionsAsActions??!1,onChange:h=>e({...i,expressionsAsActions:h.target.checked}),disabled:t,className:"h-4 w-4 rounded border-input accent-primary"}),n("rulesEditor.expressionsAsActions","Expressions as Actions")]})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[d.jsx(Vb,{className:"h-4 w-4 text-primary"}),n("rulesEditor.groups","Behavior Groups")]}),!t&&d.jsxs("button",{type:"button",onClick:c,className:"inline-flex items-center gap-1.5 rounded-lg border border-dashed border-muted-foreground/40 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:border-primary hover:text-primary","data-testid":"add-group-btn",children:[d.jsx(Gt,{className:"h-3.5 w-3.5"}),n("rulesEditor.addGroup","Add Group")]})]}),(i.behaviorGroups??[]).length===0&&d.jsx("div",{className:"rounded-lg border border-dashed py-8 text-center text-sm text-muted-foreground",children:n("rulesEditor.noGroups","No rules groups defined")}),(i.behaviorGroups??[]).map((h,g)=>d.jsxs("div",{className:"rounded-xl border bg-card shadow-sm","data-testid":"rules-group",children:[d.jsxs("div",{className:"flex items-center gap-2 p-3",children:[d.jsx("button",{type:"button",onClick:()=>o(g),className:"rounded p-0.5 text-muted-foreground hover:text-foreground transition-colors",children:s[g]!==!1?d.jsx(Rn,{className:"h-4 w-4"}):d.jsx(hs,{className:"h-4 w-4"})}),d.jsx("input",{type:"text",value:h.name??"",onChange:f=>a(g,{...h,name:f.target.value}),readOnly:t,placeholder:n("rulesEditor.groupName","Group Name"),className:"h-8 flex-1 rounded-md border border-input bg-background px-3 text-sm font-semibold text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("select",{value:h.executionStrategy??"currentStepOnly",onChange:f=>a(g,{...h,executionStrategy:f.target.value}),disabled:t,className:"h-8 rounded-md border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60",children:Xat.map(f=>d.jsx("option",{value:f,children:f},f))}),!t&&d.jsx("button",{type:"button",onClick:()=>l(g),className:"rounded p-1.5 text-muted-foreground hover:text-destructive transition-colors","aria-label":n("rulesEditor.removeGroup","Remove Group"),children:d.jsx(_n,{className:"h-4 w-4"})})]}),s[g]!==!1&&d.jsxs("div",{className:"space-y-3 border-t px-4 py-3",children:[(h.behaviorRules??[]).length===0&&d.jsx("p",{className:"text-xs italic text-muted-foreground",children:n("rulesEditor.noRules","No rules in this group")}),(h.behaviorRules??[]).map((f,m)=>d.jsx(elt,{rule:f,onChange:x=>{const v=[...h.behaviorRules??[]];v[m]=x,a(g,{...h,behaviorRules:v})},onRemove:()=>a(g,{...h,behaviorRules:(h.behaviorRules??[]).filter((x,v)=>v!==m)}),readOnly:t},m)),!t&&d.jsxs("button",{type:"button",onClick:()=>u(g),className:"inline-flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-muted-foreground/40 py-2 text-xs font-medium text-muted-foreground transition-colors hover:border-primary hover:text-primary","data-testid":"add-rule-btn",children:[d.jsx(Gt,{className:"h-3.5 w-3.5"}),n("rulesEditor.addRule","Add Rule")]})]})]},g))]})]})}async function nlt(i){return Oe.post("/administration/preview/template",i)}function ilt(){return Kt({mutationFn:nlt})}const slt={properties:{labelKey:"promptPreview.varProperties",fallback:"Properties",color:"text-emerald-600 dark:text-emerald-400"},memory:{labelKey:"promptPreview.varMemory",fallback:"Memory",color:"text-blue-600 dark:text-blue-400"},context:{labelKey:"promptPreview.varContext",fallback:"Context",color:"text-violet-600 dark:text-violet-400"},snippets:{labelKey:"promptPreview.varSnippets",fallback:"Snippets",color:"text-amber-600 dark:text-amber-400"},userInfo:{labelKey:"promptPreview.varUserInfo",fallback:"User Info",color:"text-cyan-600 dark:text-cyan-400"},conversationInfo:{labelKey:"promptPreview.varConversationInfo",fallback:"Conversation Info",color:"text-pink-600 dark:text-pink-400"},input:{labelKey:"promptPreview.varInput",fallback:"Input",color:"text-orange-600 dark:text-orange-400"},conversationLog:{labelKey:"promptPreview.varConversationLog",fallback:"Conversation Log",color:"text-gray-600 dark:text-gray-400"}};function rlt({template:i}){const{t:e}=xe(),[t,n]=L.useState(""),{mutate:s,data:r,isPending:o,error:a}=ilt(),{data:l}=hn({queryKey:["conversations","preview-picker"],queryFn:()=>PL(20,0,""),staleTime:3e4}),c=L.useCallback(()=>{i&&s({template:i,conversationId:t||void 0})},[s,i,t]);L.useEffect(()=>{c()},[c]);const u=(r==null?void 0:r.error)||a;return d.jsxs("div",{className:"space-y-3","data-testid":"prompt-preview",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(C_,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),d.jsxs("select",{value:t,onChange:h=>n(h.target.value),className:"h-7 flex-1 min-w-0 rounded-md border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"preview-conversation-picker",children:[d.jsx("option",{value:"",children:e("promptPreview.sampleData","Sample data (no conversation)")}),l==null?void 0:l.map(h=>{const g=dg(h.resource);return d.jsxs("option",{value:g,children:[h.name||g.substring(0,12)," — ",h.conversationState]},g)})]}),d.jsxs("button",{type:"button",onClick:c,disabled:o,className:be("inline-flex items-center gap-1 rounded-md border border-input px-2 py-1 text-xs font-medium text-foreground transition-colors hover:bg-secondary",o&&"opacity-50"),"data-testid":"preview-refresh",children:[d.jsx(xi,{className:be("h-3 w-3",o&&"animate-spin")}),e("promptPreview.refresh","Refresh")]})]}),d.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-primary/5 px-3 py-2 text-[11px] text-muted-foreground",children:[d.jsx(Ll,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-primary/60"}),d.jsx("span",{children:t?e("promptPreview.disclaimerReal","Preview uses the real Qute engine with actual conversation data."):e("promptPreview.disclaimerSample","Preview uses the real Qute engine with built-in sample data. Select a conversation for real values.")})]}),u&&d.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive","data-testid":"preview-error",children:[d.jsx(Vi,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),d.jsxs("div",{children:[d.jsx("p",{className:"font-medium",children:e("promptPreview.error","Template resolution error")}),d.jsx("pre",{className:"mt-1 text-[10px] font-mono whitespace-pre-wrap break-all opacity-80",children:(r==null?void 0:r.error)||(a==null?void 0:a.message)})]})]}),(r==null?void 0:r.resolved)!=null&&d.jsx(olt,{original:i,resolved:r.resolved}),o&&!r&&d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[d.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"}),e("promptPreview.loading","Resolving template…")]})}),r&&d.jsx(alt,{availableVariables:r.availableVariables,variableValues:r.variableValues})]})}function olt({original:i,resolved:e}){const{t}=xe(),[n,s]=L.useState(!1),r=async()=>{try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3)}catch{}},o=L.useMemo(()=>llt(i,e),[i,e]);return d.jsxs("div",{className:"rounded-lg border border-border bg-card","data-testid":"resolved-prompt",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(Sh,{className:"h-3.5 w-3.5 text-primary"}),d.jsx("span",{className:"text-xs font-semibold text-foreground",children:t("promptPreview.resolvedPrompt","Resolved Prompt")})]}),d.jsxs("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-medium text-muted-foreground transition-colors hover:text-foreground hover:bg-secondary","data-testid":"preview-copy",children:[n?d.jsx(Ns,{className:"h-3 w-3 text-emerald-500"}):d.jsx(mo,{className:"h-3 w-3"}),n?t("promptPreview.copied","Copied!"):t("promptPreview.copy","Copy")]})]}),d.jsx("div",{className:"px-4 py-3 text-xs leading-relaxed text-foreground/90 font-mono whitespace-pre-wrap break-words max-h-[400px] overflow-y-auto",dangerouslySetInnerHTML:{__html:o},"data-testid":"resolved-prompt-content"})]})}function alt({availableVariables:i,variableValues:e}){const{t}=xe(),[n,s]=L.useState(!1),[r,o]=L.useState(null),a=L.useMemo(()=>{const c=new Map;for(const u of i){const h=u.indexOf("."),g=h>0?u.substring(0,h):u;c.has(g)||c.set(g,[]),c.get(g).push(u)}return c},[i]),l=async c=>{try{await navigator.clipboard.writeText(`{${c}}`),o(c),setTimeout(()=>o(null),1500)}catch{}};return d.jsxs("div",{className:"rounded-lg border border-border","data-testid":"variable-reference",children:[d.jsxs("button",{type:"button",onClick:()=>s(!n),className:"flex w-full items-center gap-2 px-3 py-2 text-start text-xs font-semibold text-muted-foreground hover:text-foreground transition-colors",children:[n?d.jsx(Rn,{className:"h-3 w-3"}):d.jsx(hs,{className:"h-3 w-3"}),t("promptPreview.availableVariables","Available Variables"),d.jsx("span",{className:"rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium",children:i.length})]}),n&&d.jsx("div",{className:"border-t border-border px-3 py-2 space-y-3",children:Array.from(a.entries()).map(([c,u])=>{const h=slt[c]??{labelKey:"",fallback:c,color:"text-foreground"};return d.jsxs("div",{children:[d.jsx("div",{className:be("text-[10px] font-bold uppercase tracking-wider mb-1",h.color),children:t(h.labelKey,h.fallback)}),d.jsx("div",{className:"flex flex-wrap gap-1",children:u.map(g=>{const f=e[g],m=r===g;return d.jsxs("button",{type:"button",onClick:()=>l(g),title:f!=null?`${g} = ${String(f)}`:g,className:be("inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[10px] font-mono transition-all","border border-border bg-muted/50 text-foreground/80","hover:bg-primary/10 hover:border-primary/30 hover:text-primary",m&&"bg-emerald-500/10 border-emerald-500/30 text-emerald-600 dark:text-emerald-400"),"data-testid":`var-chip-${g}`,children:[m?d.jsx(Ns,{className:"h-2.5 w-2.5"}):null,`{${g}}`]},g)})})]},c)})})]})}function llt(i,e){if(!i||!e)return Lx(e||"");if(!/\{[a-zA-Z_#/!|][^}]*\}/g.test(i))return Lx(e);const r=i.split(/\{[a-zA-Z_#/!|][^}]*\}/).map(g=>g.trim()).filter(Boolean);if(r.length===0)return`${Lx(e)}`;const o=e,a=[];let l=0;const c=[];for(const g of r){const f=o.indexOf(g,l);f>=0&&(c.push({text:g,pos:f}),l=f+g.length)}if(c.length>0){let g=0;for(const f of c)f.pos>g&&a.push({start:g,end:f.pos}),g=f.pos+f.text.length;g${Lx(f)}`:u+=Lx(f),h=g.end}return u+=Lx(o.substring(h)),u}function Lx(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}const clt=19,dlt=24;let mme=!1;function mDe(i){mme||(mme=!0,i.languages.register({id:"prompt"}),i.languages.setMonarchTokensProvider("prompt",{tokenizer:{root:[[/\{!/,"comment.qute","@quteComment"],[/\{[#/][a-zA-Z][a-zA-Z0-9]*[^}]*\}/,"keyword.qute"],[/\{\|/,"string.qute","@quteRaw"],[/\{[a-zA-Z_][a-zA-Z0-9_.?:' ]*\}/,"variable.qute"],[/\[\[\$\{[^}]*\}\]\]/,"variable.legacy"],[/\$\{[^}]*\}/,"variable.legacy"],[/"(?:[^"\\]|\\.)*"/,"string"],[/'(?:[^'\\]|\\.)*'/,"string"],[/\b\d+(\.\d+)?\b/,"number"],[/[[\]]/,"delimiter.bracket"],[/[{}]/,"delimiter.brace"],[/:/,"delimiter"],[/,/,"delimiter"],[/\b(?:true|false|null|undefined)\b/,"keyword"]],quteComment:[[/!}/,"comment.qute","@pop"],[/./,"comment.qute"]],quteRaw:[[/\|}/,"string.qute","@pop"],[/./,"string.qute"]]}}),i.editor.defineTheme("prompt-dark",{base:"vs-dark",inherit:!0,rules:[{token:"variable.qute",foreground:"d4a843",fontStyle:"bold"},{token:"keyword.qute",foreground:"c586c0",fontStyle:"bold"},{token:"comment.qute",foreground:"6a9955",fontStyle:"italic"},{token:"string.qute",foreground:"ce9178"},{token:"variable.legacy",foreground:"d4a843"},{token:"string",foreground:"ce9178"},{token:"number",foreground:"b5cea8"},{token:"keyword",foreground:"569cd6"},{token:"delimiter.bracket",foreground:"ffd700"},{token:"delimiter.brace",foreground:"da70d6"},{token:"delimiter",foreground:"808080"}],colors:{}}),i.editor.defineTheme("prompt-light",{base:"vs",inherit:!0,rules:[{token:"variable.qute",foreground:"9c6b10",fontStyle:"bold"},{token:"keyword.qute",foreground:"af00db",fontStyle:"bold"},{token:"comment.qute",foreground:"008000",fontStyle:"italic"},{token:"string.qute",foreground:"a31515"},{token:"variable.legacy",foreground:"9c6b10"},{token:"string",foreground:"a31515"},{token:"number",foreground:"098658"},{token:"keyword",foreground:"0000ff"},{token:"delimiter.bracket",foreground:"b8860b"},{token:"delimiter.brace",foreground:"800080"},{token:"delimiter",foreground:"808080"}],colors:{}}))}function bDe(i,e){return i==="prompt"?{monacoLanguage:"prompt",monacoTheme:e==="dark"?"prompt-dark":"prompt-light"}:{monacoLanguage:i,monacoTheme:e==="dark"?"vs-dark":"vs"}}function xDe(i){return i?i.split(`
-`).length:0}function ult(i,e,t){const n=Math.max(xDe(i),1);return Math.min(Math.max(n,e),t)*clt+dlt}function vDe(i){return{readOnly:i,minimap:{enabled:!1},fontSize:13,lineNumbers:"on",wordWrap:"on",scrollBeyondLastLine:!1,tabSize:2,automaticLayout:!0,folding:!0,renderLineHighlight:"gutter",bracketPairColorization:{enabled:!0},scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8},padding:{top:12,bottom:12},accessibilitySupport:"on"}}function _De({value:i,className:e}){const{t}=xe(),n=xDe(i),s=i.length;return d.jsxs("div",{className:be("flex items-center justify-end gap-3 border-t border-border bg-muted/50 px-3 py-1 text-[11px] text-muted-foreground select-none",e),"aria-live":"polite","aria-atomic":"true",children:[d.jsxs("span",{children:[n," ",t("contentEditor.lines","lines")]}),d.jsx("span",{"aria-hidden":"true",children:"·"}),d.jsxs("span",{children:[s.toLocaleString()," ",t("contentEditor.chars","chars")]})]})}function hlt({open:i,onOpenChange:e,value:t,onChange:n,readOnly:s,language:r,label:o,testId:a}){const{resolvedTheme:l}=RM(),{t:c}=xe(),u=L.useRef(null),h=L.useCallback(_=>{u.current=_,_.focus()},[]),g=L.useCallback(_=>{mDe(_)},[]),{monacoLanguage:f,monacoTheme:m}=bDe(r,l??"dark"),x=L.useCallback(_=>{_!==void 0&&n(_)},[n]),v=L.useCallback(_=>{var w,k;_.key==="Escape"&&((k=(w=u.current)==null?void 0:w.getDomNode())!=null&&k.querySelector(".find-widget.visible")||(_.preventDefault(),e(!1)))},[e]);return d.jsx(Ose,{open:i,onOpenChange:e,children:d.jsxs(jse,{children:[d.jsx(Fse,{className:"fixed inset-0 z-50 bg-black/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),d.jsxs(Bse,{className:be("fixed z-50 flex flex-col bg-card shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-[0.98] data-[state=open]:zoom-in-[0.98]","inset-0","sm:inset-[5vh_2.5vw] sm:rounded-xl sm:border sm:border-border","lg:inset-[7.5vh_5vw]"),onKeyDown:v,"aria-label":o||c("contentEditor.fullscreenTitle","Content Editor"),"data-testid":a?`${a}-fullscreen`:"content-editor-fullscreen",children:[d.jsxs("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3 shrink-0",children:[d.jsx(BSe,{className:"h-4 w-4 text-muted-foreground shrink-0","aria-hidden":"true"}),d.jsx(uLe,{className:"flex-1 truncate text-sm font-semibold text-foreground",children:o||c("contentEditor.fullscreenTitle","Content Editor")}),s&&d.jsx("span",{className:"rounded bg-muted px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:c("editor.readOnly","Read-only")}),d.jsx(gLe,{className:be("inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-colors","bg-primary text-primary-foreground hover:bg-primary/90","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),"aria-label":c("contentEditor.close","Done"),children:c("contentEditor.close","Done")})]}),d.jsx(hLe,{className:"sr-only",children:c("contentEditor.fullscreenDescription","Full-screen content editor. Press Escape to close.")}),d.jsx("div",{className:"flex-1 overflow-hidden",children:d.jsx(W7,{height:"100%",language:f,theme:m,value:t,onChange:x,onMount:h,beforeMount:g,options:{...vDe(s),lineNumbers:"on",minimap:{enabled:!0},folding:!0,find:{addExtraSpaceOnTop:!0,autoFindInSelection:"never",seedSearchStringFromSelection:"always"}},loading:d.jsx("div",{className:"flex h-full items-center justify-center",children:d.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[d.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"}),c("common.loading","Loading...")]})})})}),d.jsx(_De,{value:t,className:"shrink-0 rounded-b-xl"})]})]})})}function V7({value:i,onChange:e,readOnly:t=!1,language:n="plaintext",label:s,placeholder:r,testId:o="content-editor",minLines:a=4,maxLines:l=20}){const{resolvedTheme:c}=RM(),{t:u}=xe(),[h,g]=L.useState(!1),f=L.useRef(null),m=L.useMemo(()=>ult(i,a,l),[i,a,l]),x=L.useCallback(E=>{f.current=E},[]),v=L.useCallback(E=>{mDe(E)},[]),{monacoLanguage:_,monacoTheme:w}=bDe(n,c??"dark"),k=L.useCallback(E=>{E!==void 0&&e(E)},[e]),C=L.useRef(null);return L.useEffect(()=>{!h&&C.current&&C.current.focus()},[h]),L.useEffect(()=>{const E=D=>{var T;if((D.ctrlKey||D.metaKey)&&D.shiftKey&&D.key==="f"){const I=(T=f.current)==null?void 0:T.getDomNode();I!=null&&I.contains(document.activeElement)&&(D.preventDefault(),g(!0))}};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[]),d.jsxs("div",{className:"group relative","data-testid":o,children:[d.jsxs("div",{className:"overflow-hidden rounded-lg border border-input transition-colors focus-within:border-ring focus-within:ring-1 focus-within:ring-ring",children:[!i&&r&&d.jsx("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-start px-14 pt-3 text-xs text-muted-foreground/60","aria-hidden":"true",children:r}),d.jsx(W7,{height:`${m}px`,language:_,theme:w,value:i,onChange:k,onMount:x,beforeMount:v,options:{...vDe(t),lineNumbers:"on",glyphMargin:!1,lineDecorationsWidth:4,lineNumbersMinChars:3},loading:d.jsx("div",{className:"flex items-center justify-center text-xs text-muted-foreground",style:{height:`${m}px`},children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"h-3.5 w-3.5 animate-spin rounded-full border-2 border-primary border-t-transparent"}),u("common.loading","Loading...")]})})}),d.jsxs("div",{className:"flex items-center border-t border-border bg-muted/50",children:[d.jsx(_De,{value:i,className:"flex-1 border-t-0"}),d.jsxs("button",{ref:C,type:"button",onClick:()=>g(!0),className:be("inline-flex items-center gap-1 px-2.5 py-1 text-[11px] font-medium text-muted-foreground","transition-colors hover:text-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1","opacity-0 group-hover:opacity-100 group-focus-within:opacity-100","motion-safe:transition-opacity"),"aria-label":u("contentEditor.expand","Expand editor"),title:u("contentEditor.expandHint","Expand to fullscreen (Ctrl+Shift+F)"),"data-testid":`${o}-expand-btn`,children:[d.jsx(jie,{className:"h-3.5 w-3.5","aria-hidden":"true"}),d.jsx("span",{className:"hidden sm:inline",children:u("contentEditor.expand","Expand")})]})]})]}),d.jsx(hlt,{open:h,onOpenChange:g,value:i,onChange:e,readOnly:t,language:n,label:s,testId:o})]})}async function glt(i,e="",t=""){const n=new URLSearchParams({specUrl:i});return e&&n.set("apiBaseUrl",e),t&&n.set("apiAuth",t),Oe.get(`/apicallstore/apicalls/discover-endpoints?${n}`)}const flt=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"];function plt({actions:i,onChange:e,readOnly:t}){const{t:n}=xe(),[s,r]=L.useState(""),o=()=>{const a=s.trim();a&&!i.includes(a)&&(e([...i,a]),r(""))};return d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map((a,l)=>d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:[a,!t&&d.jsx("button",{type:"button",onClick:()=>e(i.filter((c,u)=>u!==l)),className:"rounded p-0.5 hover:bg-primary/20 transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]},l)),i.length===0&&d.jsx("span",{className:"text-xs text-muted-foreground italic",children:n("apiCallsEditor.noActions","No actions")})]}),!t&&d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("input",{type:"text",value:s,onChange:a=>r(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),o())},placeholder:n("apiCallsEditor.actionPlaceholder","e.g. get_weather"),className:"h-8 flex-1 rounded-md border border-input bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("button",{type:"button",onClick:o,className:"inline-flex h-8 items-center gap-1 rounded-md border border-input px-2 text-xs font-medium text-foreground transition-colors hover:bg-secondary",children:d.jsx(Gt,{className:"h-3 w-3"})})]})]})}function BU({entries:i,onChange:e,keyPlaceholder:t="Key",valuePlaceholder:n="Value",addLabel:s="Add",readOnly:r}){const o=Object.entries(i??{}),a=(u,h,g)=>{const f={};for(const[m,x]of o)m===u?f[h]=g:f[m]=x;e(f)},l=u=>{const h={...i};delete h[u],e(h)},c=()=>{const u=`key${o.length}`;e({...i,[u]:""})};return d.jsxs("div",{className:"space-y-1.5",children:[o.map(([u,h],g)=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("input",{type:"text",value:u,onChange:f=>a(u,f.target.value,h),readOnly:r,placeholder:t,className:"h-7 w-36 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:":"}),d.jsx("input",{type:"text",value:h,onChange:f=>a(u,u,f.target.value),readOnly:r,placeholder:n,className:"h-7 flex-1 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),!r&&d.jsx("button",{type:"button",onClick:()=>l(u),className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]},g)),!r&&d.jsxs("button",{type:"button",onClick:c,className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),s]})]})}function Xse({validator:i,onChange:e,readOnly:t}){var c,u;const{t:n}=xe(),[s,r]=L.useState(!!i&&(!!((c=i.runOnHttpCode)!=null&&c.length)||!!((u=i.skipOnHttpCode)!=null&&u.length))),o=(i==null?void 0:i.runOnHttpCode)??[],a=(i==null?void 0:i.skipOnHttpCode)??[],l=h=>h.split(",").map(g=>parseInt(g.trim(),10)).filter(g=>!isNaN(g));return!s&&!t?d.jsxs("button",{type:"button",onClick:()=>{r(!0),e({runOnHttpCode:[],skipOnHttpCode:[]})},className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(OE,{className:"h-2.5 w-2.5"}),n("apiCallsEditor.addHttpCodeValidator","Add HTTP Code Filter")]}):!s&&t?null:d.jsxs("div",{className:"rounded-md border border-border/50 bg-muted/30 p-2 space-y-1.5",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground flex items-center gap-1",children:[d.jsx(OE,{className:"h-2.5 w-2.5"}),n("apiCallsEditor.httpCodeFilter","HTTP Code Filter")]}),!t&&d.jsx("button",{type:"button",onClick:()=>{r(!1),e(void 0)},className:"rounded p-0.5 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("apiCallsEditor.runOnCodes","Run on codes")}),d.jsx("input",{type:"text",value:o.join(", "),onChange:h=>e({...i,runOnHttpCode:l(h.target.value)}),readOnly:t,placeholder:"200, 201",className:"h-6 w-full rounded border border-input bg-background px-1.5 font-mono text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("apiCallsEditor.skipOnCodes","Skip on codes")}),d.jsx("input",{type:"text",value:a.join(", "),onChange:h=>e({...i,skipOnHttpCode:l(h.target.value)}),readOnly:t,placeholder:"400, 500",className:"h-6 w-full rounded border border-input bg-background px-1.5 font-mono text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]})]})}const mlt=["step","conversation","longTerm","secret"];function blt({instruction:i,onChange:e,onRemove:t,readOnly:n}){const{t:s}=xe(),[r,o]=L.useState(!!i.fromObjectPath||!!i.toObjectPath||!!i.convertToObject||!!i.runOnValidationError);return d.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/50 p-2.5 space-y-2","data-testid":"property-instruction-row",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("input",{type:"text",value:i.name??"",onChange:a=>e({...i,name:a.target.value}),readOnly:n,placeholder:s("apiCallsEditor.propName","Property name"),className:"h-7 w-32 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"="}),d.jsx("input",{type:"text",value:i.valueString??"",onChange:a=>e({...i,valueString:a.target.value}),readOnly:n,placeholder:s("apiCallsEditor.propValue","Value or template"),className:"h-7 flex-1 rounded border border-input bg-background px-2 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("select",{value:i.scope??"conversation",onChange:a=>e({...i,scope:a.target.value}),disabled:n,className:"h-7 rounded border border-input bg-background px-1.5 text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60",children:mlt.map(a=>d.jsx("option",{value:a,children:a},a))}),d.jsxs("label",{className:"inline-flex items-center gap-1 text-[10px] text-foreground whitespace-nowrap",title:s("apiCallsEditor.overrideTitle","Override existing value"),children:[d.jsx("input",{type:"checkbox",checked:i.override??!0,onChange:a=>e({...i,override:a.target.checked}),disabled:n,className:"h-3 w-3 accent-primary"}),s("apiCallsEditor.override","Override")]}),!n&&d.jsx("button",{type:"button",onClick:t,className:"rounded p-0.5 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]}),d.jsxs("div",{children:[d.jsxs("button",{type:"button",onClick:()=>o(!r),className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors flex items-center gap-0.5",children:[r?d.jsx(Rn,{className:"h-2.5 w-2.5"}):d.jsx(hs,{className:"h-2.5 w-2.5"}),s("apiCallsEditor.advancedMapping","Object Path Mapping")]}),r&&d.jsxs("div",{className:"mt-1.5 space-y-1.5 ps-3",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("apiCallsEditor.fromPath","From Object Path")}),d.jsx("input",{type:"text",value:i.fromObjectPath??"",onChange:a=>e({...i,fromObjectPath:a.target.value}),readOnly:n,placeholder:"response.data.items",className:"h-6 w-full rounded border border-input bg-background px-1.5 font-mono text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("apiCallsEditor.toPath","To Object Path")}),d.jsx("input",{type:"text",value:i.toObjectPath??"",onChange:a=>e({...i,toObjectPath:a.target.value}),readOnly:n,placeholder:"properties.result",className:"h-6 w-full rounded border border-input bg-background px-1.5 font-mono text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("label",{className:"inline-flex items-center gap-1 text-[10px] text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.convertToObject??!1,onChange:a=>e({...i,convertToObject:a.target.checked}),disabled:n,className:"h-3 w-3 accent-primary"}),s("apiCallsEditor.convertToObject","Convert to Object")]}),d.jsxs("label",{className:"inline-flex items-center gap-1 text-[10px] text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.runOnValidationError??!1,onChange:a=>e({...i,runOnValidationError:a.target.checked}),disabled:n,className:"h-3 w-3 accent-primary"}),s("apiCallsEditor.runOnValidationError","Run on Validation Error")]})]}),d.jsx(Xse,{validator:i.httpCodeValidator,onChange:a=>e({...i,httpCodeValidator:a}),readOnly:n})]})]})]})}function Fj({instructions:i,onChange:e,readOnly:t}){const{t:n}=xe();return d.jsxs("div",{className:"space-y-1.5",children:[i.length===0&&d.jsx("p",{className:"text-[10px] italic text-muted-foreground",children:n("apiCallsEditor.noPropertyInstructions","No property instructions")}),i.map((s,r)=>d.jsx(blt,{instruction:s,onChange:o=>{const a=[...i];a[r]=o,e(a)},onRemove:()=>e(i.filter((o,a)=>a!==r)),readOnly:t},r)),!t&&d.jsxs("button",{type:"button",onClick:()=>e([...i,{name:"",valueString:"",scope:"conversation",override:!0}]),className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),n("apiCallsEditor.addPropertyInstruction","Add Property Instruction")]})]})}const xlt=["text","image","other"];function vlt({instruction:i,onChange:e,onRemove:t,readOnly:n}){const{t:s}=xe();return d.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/50 p-2.5 space-y-2","data-testid":"output-build-instruction-row",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsxs("div",{className:"flex-1 grid grid-cols-3 gap-1.5",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("apiCallsEditor.pathToTargetArray","Path to Target Array")}),d.jsx("input",{type:"text",value:i.pathToTargetArray??"",onChange:r=>e({...i,pathToTargetArray:r.target.value}),readOnly:n,placeholder:"aiOutput.outputs",className:"h-6 w-full rounded border border-input bg-background px-1.5 font-mono text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("apiCallsEditor.iterationObjName","Iteration Object")}),d.jsx("input",{type:"text",value:i.iterationObjectName??"obj",onChange:r=>e({...i,iterationObjectName:r.target.value}),readOnly:n,placeholder:"obj",className:"h-6 w-full rounded border border-input bg-background px-1.5 font-mono text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("apiCallsEditor.templateFilter","Filter Expression")}),d.jsx("input",{type:"text",value:i.templateFilterExpression??"",onChange:r=>e({...i,templateFilterExpression:r.target.value}),readOnly:n,placeholder:s("apiCallsEditor.filterPlaceholder","Optional filter..."),className:"h-6 w-full rounded border border-input bg-background px-1.5 font-mono text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),!n&&d.jsx("button",{type:"button",onClick:t,className:"mt-3 rounded p-0.5 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-1.5",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("apiCallsEditor.outputType","Output Type")}),d.jsx("select",{value:i.outputType??"text",onChange:r=>e({...i,outputType:r.target.value}),disabled:n,className:"h-6 w-full rounded border border-input bg-background px-1 text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60",children:xlt.map(r=>d.jsx("option",{value:r,children:r},r))})]}),d.jsxs("div",{className:"col-span-2",children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("apiCallsEditor.outputValue","Output Value")}),d.jsx("input",{type:"text",value:i.outputValue??"",onChange:r=>e({...i,outputValue:r.target.value}),readOnly:n,placeholder:"{aiOutput.htmlResponseText}",className:"h-6 w-full rounded border border-input bg-background px-1.5 font-mono text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),d.jsx(Xse,{validator:i.httpCodeValidator,onChange:r=>e({...i,httpCodeValidator:r}),readOnly:n})]})}function yDe({instructions:i,onChange:e,readOnly:t}){const{t:n}=xe();return d.jsxs("div",{className:"space-y-1.5",children:[i.length===0&&d.jsx("p",{className:"text-[10px] italic text-muted-foreground",children:n("apiCallsEditor.noOutputInstructions","No output build instructions")}),i.map((s,r)=>d.jsx(vlt,{instruction:s,onChange:o=>{const a=[...i];a[r]=o,e(a)},onRemove:()=>e(i.filter((o,a)=>a!==r)),readOnly:t},r)),!t&&d.jsxs("button",{type:"button",onClick:()=>e([...i,{iterationObjectName:"obj",outputType:"text",outputValue:"",httpCodeValidator:{}}]),className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),n("apiCallsEditor.addOutputInstruction","Add Output Instruction")]})]})}function _lt({instruction:i,onChange:e,onRemove:t,readOnly:n}){const{t:s}=xe();return d.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/50 p-2.5 space-y-2","data-testid":"qr-build-instruction-row",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsxs("div",{className:"flex-1 grid grid-cols-3 gap-1.5",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("apiCallsEditor.pathToTargetArray","Path to Target Array")}),d.jsx("input",{type:"text",value:i.pathToTargetArray??"",onChange:r=>e({...i,pathToTargetArray:r.target.value}),readOnly:n,placeholder:"aiOutput.quickReplies",className:"h-6 w-full rounded border border-input bg-background px-1.5 font-mono text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("apiCallsEditor.iterationObjName","Iteration Object")}),d.jsx("input",{type:"text",value:i.iterationObjectName??"obj",onChange:r=>e({...i,iterationObjectName:r.target.value}),readOnly:n,placeholder:"obj",className:"h-6 w-full rounded border border-input bg-background px-1.5 font-mono text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("apiCallsEditor.templateFilter","Filter Expression")}),d.jsx("input",{type:"text",value:i.templateFilterExpression??"",onChange:r=>e({...i,templateFilterExpression:r.target.value}),readOnly:n,placeholder:s("apiCallsEditor.filterPlaceholder","Optional filter..."),className:"h-6 w-full rounded border border-input bg-background px-1.5 font-mono text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),!n&&d.jsx("button",{type:"button",onClick:t,className:"mt-3 rounded p-0.5 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("apiCallsEditor.qrValue","Quick Reply Value")}),d.jsx("input",{type:"text",value:i.quickReplyValue??"",onChange:r=>e({...i,quickReplyValue:r.target.value}),readOnly:n,placeholder:"{obj.value}",className:"h-6 w-full rounded border border-input bg-background px-1.5 font-mono text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("apiCallsEditor.qrExpressions","Quick Reply Expressions")}),d.jsx("input",{type:"text",value:i.quickReplyExpressions??"",onChange:r=>e({...i,quickReplyExpressions:r.target.value}),readOnly:n,placeholder:"{obj.expressions}",className:"h-6 w-full rounded border border-input bg-background px-1.5 font-mono text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),d.jsx(Xse,{validator:i.httpCodeValidator,onChange:r=>e({...i,httpCodeValidator:r}),readOnly:n})]})}function wDe({instructions:i,onChange:e,readOnly:t}){const{t:n}=xe();return d.jsxs("div",{className:"space-y-1.5",children:[i.length===0&&d.jsx("p",{className:"text-[10px] italic text-muted-foreground",children:n("apiCallsEditor.noQrInstructions","No quick reply build instructions")}),i.map((s,r)=>d.jsx(_lt,{instruction:s,onChange:o=>{const a=[...i];a[r]=o,e(a)},onRemove:()=>e(i.filter((o,a)=>a!==r)),readOnly:t},r)),!t&&d.jsxs("button",{type:"button",onClick:()=>e([...i,{pathToTargetArray:"",iterationObjectName:"obj",quickReplyValue:"",quickReplyExpressions:"",httpCodeValidator:{}}]),className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),n("apiCallsEditor.addQrInstruction","Add Quick Reply Instruction")]})]})}function ylt({preRequest:i,onChange:e,readOnly:t}){const{t:n}=xe(),s=i??{propertyInstructions:[]};return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Vie,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsx("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:n("apiCallsEditor.delayMs","Delay (ms)")}),d.jsx("input",{type:"number",value:s.delayBeforeExecutingInMillis??0,onChange:r=>e({...s,delayBeforeExecutingInMillis:parseInt(r.target.value,10)||0}),readOnly:t,min:0,className:"h-7 w-24 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsxs("h6",{className:"mb-1 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(fN,{className:"h-3 w-3"}),n("apiCallsEditor.propertyInstructions","Property Instructions")]}),d.jsx(Fj,{instructions:s.propertyInstructions??[],onChange:r=>e({...s,propertyInstructions:r}),readOnly:t})]})]})}function wlt({postResponse:i,onChange:e,readOnly:t}){const{t:n}=xe(),s=i??{propertyInstructions:[],outputBuildInstructions:[],qrBuildInstructions:[]};return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsxs("h6",{className:"mb-1 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(fN,{className:"h-3 w-3"}),n("apiCallsEditor.propertyInstructions","Property Instructions")]}),d.jsx(Fj,{instructions:s.propertyInstructions??[],onChange:r=>e({...s,propertyInstructions:r}),readOnly:t})]}),d.jsxs("div",{children:[d.jsxs("h6",{className:"mb-1 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(vj,{className:"h-3 w-3"}),n("apiCallsEditor.outputBuildInstructions","Output Build Instructions")]}),d.jsx(yDe,{instructions:s.outputBuildInstructions??[],onChange:r=>e({...s,outputBuildInstructions:r}),readOnly:t})]}),d.jsxs("div",{children:[d.jsxs("h6",{className:"mb-1 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(Jf,{className:"h-3 w-3"}),n("apiCallsEditor.qrBuildInstructions","Quick Reply Build Instructions")]}),d.jsx(wDe,{instructions:s.qrBuildInstructions??[],onChange:r=>e({...s,qrBuildInstructions:r}),readOnly:t})]})]})}function Clt({call:i,onChange:e,onRemove:t,readOnly:n}){var l,c,u,h,g,f,m,x,v;const{t:s}=xe(),[r,o]=L.useState(!0),a=L.useCallback(_=>{e({...i,request:{...i.request,..._}})},[i,e]);return d.jsxs("div",{className:"rounded-xl border border-border bg-card shadow-sm","data-testid":"httpcall-editor",children:[d.jsxs("div",{className:"flex items-center gap-2 p-3",children:[d.jsx("button",{type:"button",onClick:()=>o(!r),className:"rounded p-0.5 text-muted-foreground hover:text-foreground transition-colors",children:r?d.jsx(Rn,{className:"h-4 w-4"}):d.jsx(hs,{className:"h-4 w-4"})}),d.jsx("span",{className:`inline-flex rounded px-1.5 py-0.5 text-[10px] font-bold tracking-wider ${i.request.method==="GET"?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400":i.request.method==="POST"?"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400":i.request.method==="PUT"?"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400":i.request.method==="DELETE"?"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400":"bg-muted text-muted-foreground"}`,children:i.request.method}),d.jsx("input",{type:"text",value:i.name??"",onChange:_=>e({...i,name:_.target.value}),readOnly:n,placeholder:s("apiCallsEditor.callName","Call Name"),className:"h-8 flex-1 rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"call-name-input"}),!n&&d.jsx("button",{type:"button",onClick:t,className:"rounded p-1.5 text-muted-foreground hover:text-destructive transition-colors","aria-label":s("apiCallsEditor.removeCall","Remove Call"),children:d.jsx(_n,{className:"h-4 w-4"})})]}),r&&d.jsxs("div",{className:"space-y-4 border-t px-4 py-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:s("apiCallsEditor.callDescription","Description")}),d.jsx("input",{type:"text",value:i.description??"",onChange:_=>e({...i,description:_.target.value}),readOnly:n,placeholder:s("apiCallsEditor.descriptionPlaceholder","Natural language description for LLM agents"),className:"h-8 w-full rounded-md border border-input bg-background px-3 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsx(ls,{label:s("apiCallsEditor.actions","Trigger Actions"),children:d.jsx(plt,{actions:i.actions??[],onChange:_=>e({...i,actions:_}),readOnly:n})}),d.jsxs(ls,{label:s("apiCallsEditor.request","Request"),children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsx("select",{value:i.request.method,onChange:_=>a({method:_.target.value}),disabled:n,className:"h-8 rounded-md border border-input bg-background px-2 text-xs font-semibold text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60","data-testid":"method-select",children:flt.map(_=>d.jsx("option",{value:_,children:_},_))}),d.jsx("input",{type:"text",value:i.request.path??"",onChange:_=>a({path:_.target.value}),readOnly:n,placeholder:s("apiCallsEditor.pathPlaceholder","/api/endpoint"),className:"h-8 flex-1 rounded-md border border-input bg-background px-3 text-xs font-mono text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:s("apiCallsEditor.contentType","Content Type")}),d.jsx("input",{type:"text",value:i.request.contentType??"",onChange:_=>a({contentType:_.target.value}),readOnly:n,placeholder:"application/json",className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),d.jsx(ls,{label:s("apiCallsEditor.headers","Headers"),defaultOpen:Object.keys(i.request.headers??{}).length>0,children:d.jsx(BU,{entries:i.request.headers??{},onChange:_=>a({headers:_}),keyPlaceholder:"Header name",valuePlaceholder:"Header value",addLabel:s("apiCallsEditor.addHeader","Add Header"),readOnly:n})}),d.jsx(ls,{label:s("apiCallsEditor.queryParams","Query Parameters"),defaultOpen:Object.keys(i.request.queryParams??{}).length>0,children:d.jsx(BU,{entries:i.request.queryParams??{},onChange:_=>a({queryParams:_}),keyPlaceholder:"Param name",valuePlaceholder:"Param value",addLabel:s("apiCallsEditor.addQueryParam","Add Query Param"),readOnly:n})}),d.jsx(ls,{label:s("apiCallsEditor.body","Request Body"),defaultOpen:!!i.request.body,children:d.jsx(V7,{value:i.request.body??"",onChange:_=>a({body:_}),readOnly:n,language:"json",label:s("apiCallsEditor.body","Request Body"),placeholder:s("apiCallsEditor.bodyPlaceholder","JSON body template..."),testId:"request-body-editor"})}),d.jsx(ls,{label:s("apiCallsEditor.parameters","Parameters (for LLM agents)"),defaultOpen:Object.keys(i.parameters??{}).length>0,children:d.jsx(BU,{entries:i.parameters??{},onChange:_=>e({...i,parameters:_}),keyPlaceholder:s("apiCallsEditor.paramName","Param name"),valuePlaceholder:s("apiCallsEditor.paramDescription","Description"),addLabel:s("apiCallsEditor.addParam","Add Parameter"),readOnly:n})}),d.jsx(ls,{label:s("apiCallsEditor.options","Options"),defaultOpen:!1,children:d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.saveResponse??!1,onChange:_=>e({...i,saveResponse:_.target.checked}),disabled:n,className:"h-3.5 w-3.5 rounded border-input accent-primary"}),s("apiCallsEditor.saveResponse","Save Response")]}),i.saveResponse&&d.jsx("input",{type:"text",value:i.responseObjectName??"",onChange:_=>e({...i,responseObjectName:_.target.value}),readOnly:n,placeholder:s("apiCallsEditor.responseObjectName","Response Object Name"),className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),i.saveResponse&&d.jsx("input",{type:"text",value:i.responseHeaderObjectName??"",onChange:_=>e({...i,responseHeaderObjectName:_.target.value}),readOnly:n,placeholder:s("apiCallsEditor.responseHeaderObjectName","Response Header Object Name"),className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.fireAndForget??!1,onChange:_=>e({...i,fireAndForget:_.target.checked}),disabled:n,className:"h-3.5 w-3.5 rounded border-input accent-primary"}),s("apiCallsEditor.fireAndForget","Fire and Forget")]}),d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.isBatchCalls??!1,onChange:_=>e({...i,isBatchCalls:_.target.checked}),disabled:n,className:"h-3.5 w-3.5 rounded border-input accent-primary"}),s("apiCallsEditor.batchCalls","Batch Calls")]}),i.isBatchCalls&&d.jsx("input",{type:"text",value:i.iterationObjectName??"",onChange:_=>e({...i,iterationObjectName:_.target.value}),readOnly:n,placeholder:s("apiCallsEditor.iterationObjectName","Iteration Object Name"),className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})}),d.jsx(ls,{label:s("apiCallsEditor.preRequest","Pre-Request"),defaultOpen:!!((c=(l=i.preRequest)==null?void 0:l.propertyInstructions)!=null&&c.length||(u=i.preRequest)!=null&&u.delayBeforeExecutingInMillis),children:d.jsx(ylt,{preRequest:i.preRequest,onChange:_=>e({...i,preRequest:_}),readOnly:n})}),d.jsx(ls,{label:s("apiCallsEditor.postResponse","Post-Response"),defaultOpen:!!((g=(h=i.postResponse)==null?void 0:h.propertyInstructions)!=null&&g.length||(m=(f=i.postResponse)==null?void 0:f.outputBuildInstructions)!=null&&m.length||(v=(x=i.postResponse)==null?void 0:x.qrBuildInstructions)!=null&&v.length),children:d.jsx(wlt,{postResponse:i.postResponse,onChange:_=>e({...i,postResponse:_}),readOnly:n})})]})]})}function Slt({result:i,selected:e,onToggle:t,onToggleGroup:n,readOnly:s}){const{t:r}=xe();return d.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-card/50 p-3","data-testid":"discovered-endpoints-panel",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[r("apiCallsEditor.discoveredEndpoints","Discovered Endpoints")," (",i.endpointCount,")"]}),d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[i.title," — ",i.baseUrl]})]}),Object.entries(i.groups).map(([o,a])=>{const l=a.httpCalls.map((h,g)=>`${o}::${g}::${h.name}`),c=l.every(h=>e.has(h)),u=l.some(h=>e.has(h));return d.jsxs("div",{className:"space-y-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[!s&&d.jsx("button",{type:"button",onClick:()=>n(o,l),className:`h-3.5 w-3.5 rounded border flex items-center justify-center transition-colors ${c?"bg-primary border-primary text-primary-foreground":u?"bg-primary/30 border-primary":"border-input hover:border-primary"}`,"data-testid":`group-toggle-${o}`,children:c&&d.jsx(Ns,{className:"h-2.5 w-2.5"})}),d.jsx("span",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:o}),d.jsx("span",{className:"rounded-full bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:a.httpCalls.length})]}),d.jsx("div",{className:"grid gap-1 ps-5",children:a.httpCalls.map((h,g)=>{var _,w,k;const f=`${o}::${g}::${h.name}`,m=e.has(f),x=((w=(_=h.request)==null?void 0:_.method)==null?void 0:w.toUpperCase())??"GET",v=x==="GET"?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400":x==="POST"?"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400":x==="PUT"?"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400":x==="DELETE"?"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400":"bg-muted text-muted-foreground";return d.jsxs("label",{className:`group flex items-center gap-2 rounded-md border px-2.5 py-1.5 transition-colors cursor-pointer ${m?"border-primary/30 bg-primary/5":"border-border/50 bg-background hover:border-border"}`,"data-testid":"discovered-endpoint-item",children:[!s&&d.jsx("input",{type:"checkbox",checked:m,onChange:()=>t(f),className:"h-3.5 w-3.5 rounded border-input accent-primary"}),d.jsx("span",{className:`inline-flex rounded px-1.5 py-0.5 text-[10px] font-bold tracking-wider ${v}`,children:x}),d.jsx("span",{className:"font-mono text-xs text-foreground",children:((k=h.request)==null?void 0:k.path)??""}),h.description&&d.jsxs("span",{className:"text-[10px] text-muted-foreground truncate",children:["— ",h.description]})]},f)})})]},o)})]})}function klt({data:i,onChange:e,readOnly:t}){const{t:n}=xe(),[s,r]=L.useState(""),[o,a]=L.useState(null),[l,c]=L.useState(!1),[u,h]=L.useState(null),[g,f]=L.useState(!1),[m,x]=L.useState(new Set),[v,_]=L.useState(!1),w=s.trim().length>0&&lVe(s.trim()),k=L.useCallback(async()=>{if(w){c(!0),h(null),a(null),x(new Set);try{const P=await glt(s);a(P);const j=new Set;for(const[B,U]of Object.entries(P.groups))U.httpCalls.forEach(($,K)=>{j.add(`${B}::${K}::${$.name}`)});x(j),f(!0)}catch(P){const j=P&&typeof P=="object"&&"message"in P?String(P.message):n("apiCallsEditor.discoveryError","Could not parse OpenAPI spec");h(j),f(!0)}finally{c(!1)}}},[s,w,n]),C=L.useCallback(P=>{x(j=>{const B=new Set(j);return B.has(P)?B.delete(P):B.add(P),B})},[]),E=L.useCallback((P,j)=>{x(B=>{const U=new Set(B);return j.every(K=>U.has(K))?j.forEach(K=>U.delete(K)):j.forEach(K=>U.add(K)),U})},[]),D=L.useCallback(()=>{if(!o)return[];const P=[];for(const[j,B]of Object.entries(o.groups))B.httpCalls.forEach((U,$)=>{m.has(`${j}::${$}::${U.name}`)&&P.push(U)});return P},[o,m]),T=L.useCallback(()=>{const P=D();if(P.length===0)return;const j={...i,httpCalls:[...i.httpCalls??[],...P]};!i.targetServerUrl&&(o!=null&&o.baseUrl)&&(j.targetServerUrl=o.baseUrl),e(j),a(null),f(!1),r("")},[D,i,e,o]),I=L.useCallback(()=>{const P=D();if(P.length===0)return;if((i.httpCalls??[]).length>0&&!v){_(!0);return}const j={...i,httpCalls:P};!i.targetServerUrl&&(o!=null&&o.baseUrl)&&(j.targetServerUrl=o.baseUrl),e(j),a(null),f(!1),r(""),_(!1)},[D,i,e,o,v]),R=L.useCallback(()=>{const P={name:"",actions:[],request:{path:"",method:"GET",headers:{},queryParams:{},contentType:"application/json",body:""}};e({...i,httpCalls:[...i.httpCalls??[],P]})},[i,e]);return d.jsxs("div",{className:"space-y-6","data-testid":"apicalls-editor",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"mb-1.5 block text-sm font-medium text-foreground",children:[d.jsx(Su,{className:"me-1.5 inline h-4 w-4 text-primary"}),n("apiCallsEditor.targetServerUrl","Target Server URL")]}),d.jsx("input",{type:"text",value:i.targetServerUrl??"",onChange:P=>e({...i,targetServerUrl:P.target.value}),readOnly:t,placeholder:n("apiCallsEditor.targetServerUrlPlaceholder","https://api.example.com"),className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-sm font-mono text-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"server-url-input"})]}),!t&&d.jsxs("div",{className:"space-y-3 rounded-xl border border-dashed border-primary/30 bg-primary/5 p-4",children:[d.jsxs("label",{className:"mb-1 block text-sm font-medium text-foreground",children:[d.jsx(Wge,{className:"me-1.5 inline h-4 w-4 text-primary"}),n("apiCallsEditor.openApiSpecUrl","Import from OpenAPI Spec")]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"url",value:s,onChange:P=>r(P.target.value),placeholder:n("apiCallsEditor.specUrlPlaceholder","https://api.example.com/openapi.json"),className:"h-8 flex-1 rounded-md border border-input bg-background px-3 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"spec-url-input",onKeyDown:P=>{P.key==="Enter"&&w&&!l&&(P.preventDefault(),k())}}),d.jsxs("button",{type:"button",onClick:k,disabled:l||!w,title:s.trim()&&!w?n("apiCallsEditor.invalidUrl","Enter a valid http:// or https:// URL"):void 0,className:"inline-flex h-8 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed","data-testid":"discover-endpoints-btn",children:[l?d.jsx(ni,{className:"h-3.5 w-3.5 animate-spin"}):d.jsx(br,{className:"h-3.5 w-3.5"}),l?n("apiCallsEditor.discovering","Parsing…"):n("apiCallsEditor.discoverEndpoints","Discover Endpoints")]})]}),l&&d.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-card/50 px-3 py-4 text-xs text-muted-foreground","data-testid":"discovery-loading",children:[d.jsx(ni,{className:"h-4 w-4 animate-spin text-primary"}),n("apiCallsEditor.discovering","Parsing…")]}),u&&d.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-3","data-testid":"discovery-error",children:[d.jsx(Lo,{className:"h-4 w-4 shrink-0 text-destructive"}),d.jsx("p",{className:"flex-1 text-xs text-destructive",children:u}),d.jsxs("button",{type:"button",onClick:k,className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs font-medium text-destructive hover:bg-destructive/10 transition-colors",children:[d.jsx(xi,{className:"h-3 w-3"}),n("apiCallsEditor.retry","Retry")]})]}),!l&&g&&!u&&!o&&d.jsx("div",{className:"rounded-lg border border-border bg-card/50 px-3 py-4 text-center text-xs text-muted-foreground","data-testid":"discovery-empty",children:n("apiCallsEditor.noEndpointsFound","No endpoints found in the spec")}),o&&d.jsxs(d.Fragment,{children:[d.jsx(Slt,{result:o,selected:m,onToggle:C,onToggleGroup:E,readOnly:t}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[m.size," ",n("apiCallsEditor.selectedCount","selected")]}),d.jsx("div",{className:"flex-1"}),d.jsxs("button",{type:"button",onClick:T,disabled:m.size===0,className:"inline-flex items-center gap-1.5 rounded-md border border-primary/50 px-3 py-1.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10 disabled:opacity-50","data-testid":"import-append-btn",children:[d.jsx(Gt,{className:"h-3 w-3"}),n("apiCallsEditor.importAppend","Append to Calls")]}),d.jsxs("button",{type:"button",onClick:I,disabled:m.size===0,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50","data-testid":"import-replace-btn",children:[d.jsx(Wge,{className:"h-3 w-3"}),n("apiCallsEditor.importReplace","Replace All Calls")]})]}),v&&d.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2.5","data-testid":"replace-confirm",children:[d.jsx(h7,{className:"h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400"}),d.jsx("p",{className:"flex-1 text-xs text-amber-700 dark:text-amber-300",children:n("apiCallsEditor.replaceConfirmMessage",`This will replace ${(i.httpCalls??[]).length} existing call(s). Are you sure?`)}),d.jsx("button",{type:"button",onClick:()=>_(!1),className:"rounded px-2 py-1 text-xs font-medium text-amber-700 dark:text-amber-300 hover:bg-amber-500/20 transition-colors",children:n("common.cancel","Cancel")}),d.jsx("button",{type:"button",onClick:I,className:"rounded bg-amber-600 px-2.5 py-1 text-xs font-medium text-white hover:bg-amber-700 transition-colors","data-testid":"replace-confirm-yes",children:n("apiCallsEditor.confirmReplace","Yes, Replace All")})]})]})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[d.jsx(Su,{className:"h-4 w-4 text-primary"}),n("apiCallsEditor.calls","HTTP Calls")]}),!t&&d.jsxs("button",{type:"button",onClick:R,className:"inline-flex items-center gap-1.5 rounded-lg border border-dashed border-muted-foreground/40 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:border-primary hover:text-primary","data-testid":"add-call-btn",children:[d.jsx(Gt,{className:"h-3.5 w-3.5"}),n("apiCallsEditor.addCall","Add HTTP Call")]})]}),(i.httpCalls??[]).length===0&&d.jsx("div",{className:"rounded-lg border border-dashed py-8 text-center text-sm text-muted-foreground",children:n("apiCallsEditor.noCalls","No HTTP calls configured")}),(i.httpCalls??[]).map((P,j)=>d.jsx(Clt,{call:P,onChange:B=>{const U=[...i.httpCalls??[]];U[j]=B,e({...i,httpCalls:U})},onRemove:()=>e({...i,httpCalls:(i.httpCalls??[]).filter((B,U)=>U!==j)}),readOnly:t},j))]})]})}const Nlt=new Set(["systemMessage"]),Zse=["openai","anthropic","gemini","gemini-vertex","ollama","huggingface","jlama","mistral","azure-openai","bedrock","oracle-genai"],wv=["calculator","datetime","websearch","dataformatter","webscraper","textsummarizer","pdfreader","weather"];function Elt({task:i,onChange:e,readOnly:t}){var s,r,o;const{t:n}=xe();return d.jsx(ls,{label:n("llmEditor.cascade","Model Cascade"),icon:Uf,accent:"text-purple-500",defaultOpen:!!((s=i.modelCascade)!=null&&s.enabled),children:d.jsxs("div",{className:"space-y-3","data-testid":"cascade-section",children:[d.jsx("p",{className:"text-[10px] text-muted-foreground leading-relaxed",children:n("llmEditor.cascadeDesc","Try a cheap/fast model first. If confidence is too low, automatically escalate to a more powerful (and expensive) model. Saves costs without sacrificing quality.")}),d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs font-medium text-foreground",children:[d.jsx("input",{type:"checkbox",checked:((r=i.modelCascade)==null?void 0:r.enabled)??!1,onChange:a=>{var l,c,u,h;return e({...i,modelCascade:{...i.modelCascade,enabled:a.target.checked,strategy:((l=i.modelCascade)==null?void 0:l.strategy)??"cascade",evaluationStrategy:((c=i.modelCascade)==null?void 0:c.evaluationStrategy)??"structured_output",enableInAgentMode:((u=i.modelCascade)==null?void 0:u.enableInAgentMode)??!0,steps:((h=i.modelCascade)==null?void 0:h.steps)??[]}})},disabled:t,className:"h-3.5 w-3.5 rounded border-input accent-primary","data-testid":"cascade-enable"}),d.jsx(Uf,{className:"h-3.5 w-3.5 text-primary"}),n("llmEditor.cascadeEnable","Enable Model Cascade")]}),((o=i.modelCascade)==null?void 0:o.enabled)&&d.jsxs("div",{className:"space-y-3 rounded-lg border border-primary/20 bg-primary/5 p-3",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("llmEditor.cascadeStrategy","Strategy")}),d.jsxs("select",{value:i.modelCascade.strategy??"cascade",onChange:a=>e({...i,modelCascade:{...i.modelCascade,strategy:a.target.value}}),disabled:t,className:"h-8 w-full rounded-md border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60",children:[d.jsx("option",{value:"cascade",children:n("llmEditor.strategyCascade","Sequential Escalation")}),d.jsx("option",{value:"parallel",children:n("llmEditor.strategyParallel","Parallel (future)")})]}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:n("llmEditor.cascadeStrategyHint","Sequential tries cheap first, escalates on low confidence")})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("llmEditor.cascadeEvalStrategy","Confidence Evaluation")}),d.jsxs("select",{value:i.modelCascade.evaluationStrategy??"structured_output",onChange:a=>e({...i,modelCascade:{...i.modelCascade,evaluationStrategy:a.target.value}}),disabled:t,className:"h-8 w-full rounded-md border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60",children:[d.jsx("option",{value:"structured_output",children:n("llmEditor.evalStructured","Structured Output (JSON)")}),d.jsx("option",{value:"heuristic",children:n("llmEditor.evalHeuristic","Heuristic (hedging detection)")}),d.jsx("option",{value:"judge_model",children:n("llmEditor.evalJudge","Judge Model (secondary LLM)")}),d.jsx("option",{value:"none",children:n("llmEditor.evalNone","None (always accept)")})]}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:n("llmEditor.cascadeEvalHint","How to determine if a response is good enough")})]})]}),d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.modelCascade.enableInAgentMode??!0,onChange:a=>e({...i,modelCascade:{...i.modelCascade,enableInAgentMode:a.target.checked}}),disabled:t,className:"h-3.5 w-3.5 rounded border-input accent-primary"}),n("llmEditor.cascadeInAgent","Also use cascade in Agent Mode (with tools)")]}),d.jsxs("div",{children:[d.jsxs("label",{className:"mb-1.5 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(zf,{className:"h-3 w-3"}),n("llmEditor.cascadeSteps","Cascade Steps (cheap → expensive)")]}),d.jsx("p",{className:"mb-2 text-[10px] text-muted-foreground",children:n("llmEditor.cascadeStepsDesc","Order matters: first step tried first. Last step is always accepted (set confidence to empty).")}),d.jsx("div",{className:"space-y-2",children:(i.modelCascade.steps??[]).map((a,l)=>{var c;return d.jsxs("div",{className:"rounded-lg border border-border bg-card p-3 space-y-2","data-testid":`cascade-step-${l}`,children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-full bg-primary/10 text-[10px] font-bold text-primary",children:l+1}),d.jsx("select",{value:a.type??"openai",onChange:u=>{const h=[...i.modelCascade.steps??[]];h[l]={...a,type:u.target.value},e({...i,modelCascade:{...i.modelCascade,steps:h}})},disabled:t,className:"h-7 rounded-md border border-input bg-background px-2 text-xs font-semibold text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60",children:Zse.map(u=>d.jsx("option",{value:u,children:u},u))}),d.jsx("input",{type:"text",value:((c=a.parameters)==null?void 0:c.model)??"",onChange:u=>{const h=[...i.modelCascade.steps??[]];h[l]={...a,parameters:{...a.parameters??{},model:u.target.value}},e({...i,modelCascade:{...i.modelCascade,steps:h}})},readOnly:t,placeholder:n("llmEditor.cascadeModelName","e.g. claude-sonnet-4-6"),className:"h-7 flex-1 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),!t&&d.jsxs("div",{className:"flex items-center gap-0.5",children:[d.jsx("button",{type:"button",disabled:l===0,onClick:()=>{const u=[...i.modelCascade.steps??[]],h=u[l];u[l]=u[l-1],u[l-1]=h,e({...i,modelCascade:{...i.modelCascade,steps:u}})},className:"rounded p-1 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-30",title:n("llmEditor.moveUp","Move up"),children:d.jsx(zv,{className:"h-3.5 w-3.5"})}),d.jsx("button",{type:"button",disabled:l===(i.modelCascade.steps??[]).length-1,onClick:()=>{const u=[...i.modelCascade.steps??[]],h=u[l];u[l]=u[l+1],u[l+1]=h,e({...i,modelCascade:{...i.modelCascade,steps:u}})},className:"rounded p-1 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-30",title:n("llmEditor.moveDown","Move down"),children:d.jsx(zf,{className:"h-3.5 w-3.5"})}),d.jsx("button",{type:"button",onClick:()=>{const u=(i.modelCascade.steps??[]).filter((h,g)=>g!==l);e({...i,modelCascade:{...i.modelCascade,steps:u}})},className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(_n,{className:"h-3.5 w-3.5"})})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2 ps-7",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.cascadeConfidence","Min. Confidence (0–1)")}),d.jsx("input",{type:"text",inputMode:"decimal",pattern:"[0-9]*(\\.[0-9]+)?",value:a.confidenceThreshold??"",onChange:u=>{const h=[...i.modelCascade.steps??[]],g=u.target.value;h[l]={...a,confidenceThreshold:g===""?null:isNaN(parseFloat(g))?0:parseFloat(g)},e({...i,modelCascade:{...i.modelCascade,steps:h}})},readOnly:t,placeholder:n("llmEditor.cascadeConfidencePlaceholder","empty = always accept"),className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.cascadeTimeout","Timeout (ms)")}),d.jsx("input",{type:"number",value:a.timeoutMs??3e4,onChange:u=>{const h=[...i.modelCascade.steps??[]];h[l]={...a,timeoutMs:parseInt(u.target.value,10)||3e4},e({...i,modelCascade:{...i.modelCascade,steps:h}})},readOnly:t,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),d.jsxs("div",{className:"flex items-start gap-1.5 ps-7 mt-1",children:[d.jsx(_d,{className:"h-3 w-3 text-muted-foreground/60 shrink-0 mt-0.5"}),d.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-relaxed",children:n("llmEditor.cascadeApiKeyHint","API key is inherited from the parent task and resolved from the Secrets Vault. Ensure a matching key is configured for this provider.")})]})]},l)})}),!t&&d.jsxs("button",{type:"button",onClick:()=>{var l;const a=[...((l=i.modelCascade)==null?void 0:l.steps)??[],{type:"openai",parameters:{model:""},confidenceThreshold:.7,timeoutMs:3e4}];e({...i,modelCascade:{...i.modelCascade,steps:a}})},className:"mt-2 inline-flex items-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-1.5 text-xs font-medium text-primary/70 transition-colors hover:border-primary hover:text-primary","data-testid":"add-cascade-step",children:[d.jsx(Gt,{className:"h-3.5 w-3.5"}),n("llmEditor.addCascadeStep","Add Cascade Step")]})]})]})]})})}function Llt({task:i,onChange:e,readOnly:t}){var s,r,o,a,l,c,u;const{t:n}=xe();return d.jsxs(d.Fragment,{children:[d.jsx(ls,{label:n("llmEditor.tokenWindow","Token-Aware Context Window"),icon:$v,accent:"text-cyan-500",defaultOpen:i.maxContextTokens!=null&&i.maxContextTokens>0,children:d.jsxs("div",{className:"space-y-3","data-testid":"token-window-section",children:[d.jsx("p",{className:"text-[10px] text-muted-foreground leading-relaxed",children:n("llmEditor.tokenWindowDesc","Replace step-count-based history with token-aware packing. When maxContextTokens is set (> 0), the engine fits as many recent turns as possible within the budget, optionally anchoring the opening turns.")}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.maxContextTokens","Max Context Tokens")}),d.jsx("input",{type:"number",value:i.maxContextTokens??-1,onChange:h=>e({...i,maxContextTokens:parseInt(h.target.value,10)||-1}),readOnly:t,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"max-context-tokens"}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:n("llmEditor.maxContextTokensHint","-1 = use step count instead")})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.anchorFirstSteps","Anchor First Steps")}),d.jsx("input",{type:"number",value:i.anchorFirstSteps??2,onChange:h=>e({...i,anchorFirstSteps:parseInt(h.target.value,10)||0}),readOnly:t,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"anchor-first-steps"}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:n("llmEditor.anchorFirstStepsHint","Opening turns always retained (0 = none)")})]})]})]})}),d.jsx(ls,{label:n("llmEditor.conversationMemory","Conversation Memory"),icon:$v,accent:"text-teal-500",defaultOpen:!!((s=i.conversationSummary)!=null&&s.enabled),children:d.jsxs("div",{className:"space-y-3","data-testid":"conversation-memory-section",children:[d.jsx("p",{className:"text-[10px] text-muted-foreground leading-relaxed",children:n("llmEditor.conversationMemoryDesc","Older turns are incrementally compressed into a rolling summary. The LLM sees: [system prompt + summary] + [recent N turns verbatim]. A built-in conversationRecall tool allows the agent to drill back into summarized turns on demand.")}),d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs font-medium text-foreground",children:[d.jsx("input",{type:"checkbox",checked:((r=i.conversationSummary)==null?void 0:r.enabled)??!1,onChange:h=>{var g,f,m,x,v;return e({...i,conversationSummary:{...i.conversationSummary,enabled:h.target.checked,llmProvider:((g=i.conversationSummary)==null?void 0:g.llmProvider)??"anthropic",llmModel:((f=i.conversationSummary)==null?void 0:f.llmModel)??"claude-sonnet-4-6",maxSummaryTokens:((m=i.conversationSummary)==null?void 0:m.maxSummaryTokens)??800,recentWindowSteps:((x=i.conversationSummary)==null?void 0:x.recentWindowSteps)??5,maxRecallTurns:((v=i.conversationSummary)==null?void 0:v.maxRecallTurns)??20}})},disabled:t,className:"h-3.5 w-3.5 rounded border-input accent-primary","data-testid":"summary-enable"}),d.jsx($v,{className:"h-3.5 w-3.5 text-teal-500"}),n("llmEditor.enableSummary","Enable Rolling Summary")]}),((o=i.conversationSummary)==null?void 0:o.enabled)&&d.jsxs("div",{className:"space-y-3 rounded-lg border border-teal-500/20 bg-teal-500/5 p-3",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("llmEditor.summaryProvider","Summary Provider")}),d.jsx("select",{value:i.conversationSummary.llmProvider??"anthropic",onChange:h=>e({...i,conversationSummary:{...i.conversationSummary,llmProvider:h.target.value}}),disabled:t,className:"h-8 w-full rounded-md border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60",children:Zse.map(h=>d.jsx("option",{value:h,children:h},h))}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:n("llmEditor.summaryProviderHint","Use a cheap/fast model for summarization")})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("llmEditor.summaryModel","Summary Model")}),d.jsx("input",{type:"text",value:i.conversationSummary.llmModel??"",onChange:h=>e({...i,conversationSummary:{...i.conversationSummary,llmModel:h.target.value}}),readOnly:t,placeholder:"claude-sonnet-4-6",className:"h-8 w-full rounded-md border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.recentWindow","Recent Window (steps)")}),d.jsx("input",{type:"number",value:i.conversationSummary.recentWindowSteps??5,onChange:h=>e({...i,conversationSummary:{...i.conversationSummary,recentWindowSteps:parseInt(h.target.value,10)||5}}),readOnly:t,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:n("llmEditor.recentWindowHint","Turns kept verbatim")})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.maxRecallTurns","Max Recall Turns")}),d.jsx("input",{type:"number",value:i.conversationSummary.maxRecallTurns??20,onChange:h=>e({...i,conversationSummary:{...i.conversationSummary,maxRecallTurns:parseInt(h.target.value,10)||20}}),readOnly:t,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:n("llmEditor.maxRecallHint","Per recall invocation")})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.maxSummaryTokens","Max Summary Tokens")}),d.jsx("input",{type:"number",value:i.conversationSummary.maxSummaryTokens??800,onChange:h=>e({...i,conversationSummary:{...i.conversationSummary,maxSummaryTokens:parseInt(h.target.value,10)||800}}),readOnly:t,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.conversationSummary.excludePropertiesFromSummary??!0,onChange:h=>e({...i,conversationSummary:{...i.conversationSummary,excludePropertiesFromSummary:h.target.checked}}),disabled:t,className:"h-3.5 w-3.5 rounded border-input accent-primary"}),n("llmEditor.excludeProps","Exclude properties from summary")]}),d.jsx("p",{className:"text-[10px] text-muted-foreground ps-5 -mt-2",children:n("llmEditor.excludePropsDesc","Skip facts already captured as persistent properties — focus on reasoning and implicit context")}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("llmEditor.summarizationPrompt","Custom Summarization Prompt (optional)")}),d.jsx(V7,{value:i.conversationSummary.summarizationPrompt??"",onChange:h=>e({...i,conversationSummary:{...i.conversationSummary,summarizationPrompt:h||void 0}}),readOnly:t,language:"prompt",label:n("llmEditor.summarizationPrompt","Custom Summarization Prompt"),placeholder:n("llmEditor.summarizationPromptPlaceholder","Leave empty to use the default structured prompt that preserves goals, decisions, reasoning, and tone."),testId:"summarization-prompt"})]})]})]})}),d.jsx(ls,{label:n("llmEditor.retryConfig","Retry Configuration"),icon:S_,accent:"text-orange-500",defaultOpen:!1,children:d.jsxs("div",{className:"space-y-2","data-testid":"retry-section",children:[d.jsx("p",{className:"text-[10px] text-muted-foreground",children:n("llmEditor.retryDesc","Configure automatic retries for failed LLM API calls with exponential backoff.")}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:[d.jsx(S_,{className:"inline h-3 w-3 me-1"}),n("llmEditor.retryMaxAttempts","Max Attempts")]}),d.jsx("input",{type:"number",value:((a=i.retry)==null?void 0:a.maxAttempts)??3,onChange:h=>e({...i,retry:{...i.retry,maxAttempts:parseInt(h.target.value,10)||1}}),readOnly:t,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.retryDelay","Initial Delay (ms)")}),d.jsx("input",{type:"number",value:((l=i.retry)==null?void 0:l.backoffDelayMs)??1e3,onChange:h=>e({...i,retry:{...i.retry,backoffDelayMs:parseInt(h.target.value,10)||0}}),readOnly:t,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.retryMultiplier","Backoff Multiplier")}),d.jsx("input",{type:"number",step:"0.1",value:((c=i.retry)==null?void 0:c.backoffMultiplier)??2,onChange:h=>e({...i,retry:{...i.retry,backoffMultiplier:parseFloat(h.target.value)||1}}),readOnly:t,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.retryMaxDelay","Max Delay (ms)")}),d.jsx("input",{type:"number",value:((u=i.retry)==null?void 0:u.maxBackoffDelayMs)??1e4,onChange:h=>e({...i,retry:{...i.retry,maxBackoffDelayMs:parseInt(h.target.value,10)||0}}),readOnly:t,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]})]})})]})}function Dlt({task:i,onChange:e,readOnly:t}){var s,r,o;const{t:n}=xe();return d.jsx(ls,{label:n("llmEditor.ragConfig","RAG (Knowledge Retrieval)"),icon:C_,accent:"text-emerald-500",defaultOpen:!1,children:d.jsxs("div",{className:"space-y-4","data-testid":"rag-section",children:[d.jsx("p",{className:"text-[10px] text-muted-foreground",children:n("llmEditor.ragDesc","Augment LLM responses with relevant documents from knowledge bases. Three modes can be combined.")}),d.jsxs("div",{className:"rounded-md border border-border bg-card/30 p-3 space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-xs font-semibold text-foreground",children:n("llmEditor.knowledgeBases","Knowledge Bases")}),!t&&d.jsxs("button",{type:"button",onClick:()=>e({...i,knowledgeBases:[...i.knowledgeBases??[],{name:"",maxResults:5,minScore:.6}]}),className:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-medium text-primary hover:bg-primary/10 transition-colors","data-testid":"add-kb-ref",children:[d.jsx(Gt,{className:"h-3 w-3"}),n("llmEditor.addKnowledgeBase","Add KB Reference")]})]}),d.jsx("p",{className:"text-[10px] text-muted-foreground",children:n("llmEditor.knowledgeBasesHint","Explicitly reference knowledge bases by name. Each name must match a RagConfiguration in the workflow.")}),(i.knowledgeBases??[]).map((a,l)=>d.jsxs("div",{className:"rounded-md border border-border bg-background p-2.5 space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"text",value:a.name??"",onChange:c=>{const u=[...i.knowledgeBases??[]];u[l]={...a,name:c.target.value||void 0},e({...i,knowledgeBases:u})},readOnly:t,placeholder:n("llmEditor.kbNamePlaceholder","e.g. product-docs"),className:"h-7 flex-1 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":`kb-name-${l}`}),!t&&d.jsx("button",{type:"button",onClick:()=>{const c=(i.knowledgeBases??[]).filter((u,h)=>h!==l);e({...i,knowledgeBases:c.length>0?c:void 0})},className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.ragMaxResults","Max Results")}),d.jsx("input",{type:"number",value:a.maxResults??"",onChange:c=>{const u=[...i.knowledgeBases??[]];u[l]={...a,maxResults:c.target.value?parseInt(c.target.value,10):void 0},e({...i,knowledgeBases:u})},readOnly:t,placeholder:"5",className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.ragMinScore","Min Score")}),d.jsx("input",{type:"number",step:"0.05",min:"0",max:"1",value:a.minScore??"",onChange:c=>{const u=[...i.knowledgeBases??[]];u[l]={...a,minScore:c.target.value?parseFloat(c.target.value):void 0},e({...i,knowledgeBases:u})},readOnly:t,placeholder:"0.6",className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.injectionStrategy","Injection")}),d.jsxs("select",{value:a.injectionStrategy??"system_message",onChange:c=>{const u=[...i.knowledgeBases??[]];u[l]={...a,injectionStrategy:c.target.value},e({...i,knowledgeBases:u})},disabled:t,className:"h-7 w-full rounded border border-input bg-background px-1 text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60",children:[d.jsx("option",{value:"system_message",children:"System Message"}),d.jsx("option",{value:"user_message",children:"User Message"})]})]})]})]},l)),(i.knowledgeBases??[]).length===0&&d.jsx("p",{className:"text-[10px] text-muted-foreground/60 italic",children:n("llmEditor.noKnowledgeBases","No knowledge bases referenced")})]}),d.jsxs("div",{className:"rounded-md border border-border bg-card/30 p-3 space-y-2",children:[d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:i.enableWorkflowRag??!1,onChange:a=>e({...i,enableWorkflowRag:a.target.checked||void 0}),disabled:t,className:"rounded","data-testid":"enable-workflow-rag"}),d.jsx("span",{className:"text-xs font-semibold text-foreground",children:n("llmEditor.enableWorkflowRag","Auto-Discover Workflow RAG")})]}),d.jsx("p",{className:"text-[10px] text-muted-foreground",children:n("llmEditor.workflowRagHint","Automatically discovers all RAG steps from the workflow. Only used when no explicit knowledge bases are listed above.")}),i.enableWorkflowRag&&d.jsxs("div",{className:"ms-6 space-y-2 border-s-2 border-primary/20 ps-3",children:[d.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("llmEditor.ragDefaults","Default Retrieval Parameters")}),d.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.ragMaxResults","Max Results")}),d.jsx("input",{type:"number",value:((s=i.ragDefaults)==null?void 0:s.maxResults)??"",onChange:a=>e({...i,ragDefaults:{...i.ragDefaults,maxResults:a.target.value?parseInt(a.target.value,10):void 0}}),readOnly:t,placeholder:"5",className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.ragMinScore","Min Score")}),d.jsx("input",{type:"number",step:"0.05",min:"0",max:"1",value:((r=i.ragDefaults)==null?void 0:r.minScore)??"",onChange:a=>e({...i,ragDefaults:{...i.ragDefaults,minScore:a.target.value?parseFloat(a.target.value):void 0}}),readOnly:t,placeholder:"0.6",className:"h-7 w-full rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:n("llmEditor.injectionStrategy","Injection")}),d.jsxs("select",{value:((o=i.ragDefaults)==null?void 0:o.injectionStrategy)??"system_message",onChange:a=>e({...i,ragDefaults:{...i.ragDefaults,injectionStrategy:a.target.value}}),disabled:t,className:"h-7 w-full rounded border border-input bg-background px-1 text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60",children:[d.jsx("option",{value:"system_message",children:"System Message"}),d.jsx("option",{value:"user_message",children:"User Message"})]})]})]})]})]}),d.jsxs("div",{className:"rounded-md border border-border bg-card/30 p-3 space-y-2",children:[d.jsx("span",{className:"text-xs font-semibold text-foreground",children:n("llmEditor.httpCallRag","httpCall RAG (Zero Infrastructure)")}),d.jsx("p",{className:"text-[10px] text-muted-foreground",children:n("llmEditor.httpCallRagHint","Execute a named httpCall before the LLM call. The response is injected as context — no vector store needed.")}),d.jsx("input",{type:"text",value:i.httpCallRag??"",onChange:a=>e({...i,httpCallRag:a.target.value||void 0}),readOnly:t,placeholder:n("llmEditor.httpCallRagPlaceholder","e.g. search_docs, query_wiki"),dir:"ltr",className:"h-7 w-full rounded border border-input bg-background px-2 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"httpcall-rag"})]}),i.retrievalAugmentor&&d.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/5 p-3 space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(Vi,{className:"h-3.5 w-3.5 text-amber-500"}),d.jsx("span",{className:"text-xs font-semibold text-amber-600 dark:text-amber-400",children:n("llmEditor.legacyRag","Legacy RAG (deprecated)")})]}),d.jsx("p",{className:"text-[10px] text-muted-foreground",children:n("llmEditor.legacyRagHint","This configuration uses the deprecated retrievalAugmentor format. Migrate to the modes above.")}),d.jsxs("div",{className:"grid grid-cols-2 gap-2 opacity-60",children:[d.jsxs("div",{className:"col-span-2",children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:"httpCall"}),d.jsx("input",{type:"text",value:i.retrievalAugmentor.httpCall??"",readOnly:!0,className:"h-7 w-full rounded border border-input bg-background px-2 font-mono text-xs"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:"embeddingModel"}),d.jsx("input",{type:"text",value:i.retrievalAugmentor.embeddingModel??"",readOnly:!0,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:"embeddingStore"}),d.jsx("input",{type:"text",value:i.retrievalAugmentor.embeddingStore??"",readOnly:!0,className:"h-7 w-full rounded border border-input bg-background px-2 text-xs"})]})]}),!t&&d.jsxs("button",{type:"button",onClick:()=>e({...i,retrievalAugmentor:void 0}),className:"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] text-amber-600 dark:text-amber-400 hover:bg-amber-500/10 transition-colors",children:[d.jsx(_n,{className:"h-3 w-3"}),n("llmEditor.removeLegacyRag","Remove Legacy Config")]})]})]})})}const Tlt=new Set(["apikey","password","secret","token"]);function Ilt({actions:i,onChange:e,readOnly:t}){const{t:n}=xe(),[s,r]=L.useState(""),o=()=>{const a=s.trim();a&&!i.includes(a)&&(e([...i,a]),r(""))};return d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map(a=>d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:[a,!t&&d.jsx("button",{type:"button",onClick:()=>e(i.filter(l=>l!==a)),className:"rounded p-0.5 hover:bg-primary/20 transition-colors","aria-label":`Remove ${a}`,children:d.jsx(An,{className:"h-3 w-3"})})]},a)),i.length===0&&d.jsx("span",{className:"text-xs text-muted-foreground italic",children:n("llmEditor.noActions","No actions")})]}),!t&&d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("input",{type:"text",value:s,onChange:a=>r(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),o())},placeholder:n("llmEditor.actionPlaceholder","e.g. help, chat"),className:"h-8 flex-1 rounded-md border border-input bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("button",{type:"button",onClick:o,className:"inline-flex h-8 items-center gap-1 rounded-md border border-input px-2 text-xs font-medium text-foreground transition-colors hover:bg-secondary",children:d.jsx(Gt,{className:"h-3 w-3"})})]})]})}function Alt({skills:i,onChange:e,readOnly:t}){const[n,s]=L.useState(""),r=()=>{const o=n.trim();o&&!i.includes(o)&&(e([...i,o]),s(""))};return d.jsxs("div",{className:"space-y-1",children:[d.jsxs("div",{className:"flex flex-wrap gap-1",children:[i.map(o=>d.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:[o,!t&&d.jsx("button",{type:"button",onClick:()=>e(i.filter(a=>a!==o)),className:"rounded p-0.5 hover:bg-primary/20 transition-colors",children:d.jsx(An,{className:"h-2.5 w-2.5"})})]},o)),i.length===0&&d.jsx("span",{className:"text-[10px] text-muted-foreground italic",children:"All skills"})]}),!t&&d.jsxs("div",{className:"flex gap-1",children:[d.jsx("input",{type:"text",value:n,onChange:o=>s(o.target.value),onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),r())},placeholder:"e.g. order-tracking",className:"h-6 flex-1 rounded border border-input bg-background px-1.5 text-[10px] text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("button",{type:"button",onClick:r,className:"inline-flex h-6 items-center rounded border border-input px-1.5 text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:d.jsx(Gt,{className:"h-2.5 w-2.5"})})]})]})}function Rlt({task:i,onChange:e,onRemove:t,readOnly:n}){var h,g,f,m,x,v,_,w,k,C,E,D,T,I,R,P,j,B,U,$,K,z,G,ne,te,H,Q,Y,V,ue,he,Te,nt;const{t:s}=xe(),[r,o]=L.useState(!0),[a,l]=L.useState(!1),c=i.tools&&i.tools.length>0||i.enableBuiltInTools||i.a2aAgents&&i.a2aAgents.length>0,u=(ge,_e)=>{e({...i,parameters:{...i.parameters,[ge]:_e}})};return d.jsxs("div",{className:"rounded-xl border border-border bg-card shadow-sm","data-testid":"llm-task-editor",children:[d.jsxs("div",{className:"flex items-center gap-2 p-3",children:[d.jsx("button",{type:"button",onClick:()=>o(!r),className:"rounded p-0.5 text-muted-foreground hover:text-foreground transition-colors",children:r?d.jsx(Rn,{className:"h-4 w-4"}):d.jsx(hs,{className:"h-4 w-4"})}),d.jsx("span",{className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-bold tracking-wider ${c?"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400":"bg-sky-100 text-sky-700 dark:bg-sky-900/30 dark:text-sky-400"}`,"data-testid":"mode-badge",children:c?d.jsxs(d.Fragment,{children:[d.jsx(ai,{className:"h-3 w-3"})," Agent"]}):d.jsxs(d.Fragment,{children:[d.jsx(Nl,{className:"h-3 w-3"})," Chat"]})}),d.jsx("select",{value:i.type??"openai",onChange:ge=>e({...i,type:ge.target.value}),disabled:n,className:"h-8 rounded-md border border-input bg-background px-2 text-xs font-semibold text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60","data-testid":"model-type-select",children:Zse.map(ge=>d.jsx("option",{value:ge,children:ge},ge))}),d.jsx("input",{type:"text",value:i.id??"",onChange:ge=>e({...i,id:ge.target.value}),readOnly:n,placeholder:s("llmEditor.taskId","Task ID"),className:"h-8 w-32 rounded-md border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"flex-1"}),!n&&d.jsx("button",{type:"button",onClick:t,className:"rounded p-1.5 text-muted-foreground hover:text-destructive transition-colors","aria-label":s("llmEditor.removeTask","Remove Task"),children:d.jsx(_n,{className:"h-4 w-4"})})]}),r&&d.jsxs("div",{className:"space-y-4 border-t px-4 py-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:s("llmEditor.description","Description")}),d.jsx("input",{type:"text",value:i.description??"",onChange:ge=>e({...i,description:ge.target.value}),readOnly:n,placeholder:s("llmEditor.descriptionPlaceholder","What this task does"),className:"h-8 w-full rounded-md border border-input bg-background px-3 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsx(ls,{label:s("llmEditor.triggerActions","Trigger Actions"),children:d.jsx(Ilt,{actions:i.actions??[],onChange:ge=>e({...i,actions:ge}),readOnly:n})}),d.jsxs(ls,{label:s("llmEditor.systemPrompt","System Prompt"),children:[d.jsx("div",{className:"mb-2 flex items-center justify-end",children:d.jsxs("button",{type:"button",onClick:()=>l(!a),className:be("inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium transition-all",a?"bg-primary/15 text-primary border border-primary/30":"text-muted-foreground border border-transparent hover:text-foreground hover:border-border"),title:a?s("promptPreview.switchToEdit","Switch to Edit"):s("promptPreview.switchToPreview","Preview resolved prompt"),"data-testid":"system-prompt-preview-toggle",children:[d.jsx(Sh,{className:"h-3 w-3"}),a?s("promptPreview.edit","Edit"):s("promptPreview.preview","Preview")]})}),a?d.jsx(rlt,{template:((h=i.parameters)==null?void 0:h.systemMessage)??""}):d.jsx(V7,{value:((g=i.parameters)==null?void 0:g.systemMessage)??"",onChange:ge=>u("systemMessage",ge),readOnly:n,language:"prompt",label:s("llmEditor.systemPrompt","System Prompt"),placeholder:s("llmEditor.systemPromptPlaceholder","You are a helpful assistant..."),testId:"system-prompt"})]}),d.jsxs(ls,{label:s("llmEditor.modelParams","Model Parameters"),defaultOpen:!1,children:[d.jsx("div",{className:"grid grid-cols-2 gap-2",children:Object.entries(i.parameters??{}).filter(([ge])=>!Nlt.has(ge)).map(([ge,_e])=>{const $e=Tlt.has(ge.toLowerCase());return d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("input",{type:"text",value:ge,readOnly:!0,className:"h-7 w-28 rounded border border-input bg-muted px-2 text-xs text-foreground"}),$e?d.jsx("div",{className:"flex-1",children:d.jsx(Rd,{value:_e,onChange:Ke=>u(ge,Ke),readOnly:n,placeholder:"${vault:...}",testId:`llm-param-${ge}`})}):d.jsx("input",{type:"text",value:_e,onChange:Ke=>u(ge,Ke.target.value),readOnly:n,className:"h-7 flex-1 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),!n&&d.jsx("button",{type:"button",onClick:()=>{const Ke={...i.parameters};delete Ke[ge],e({...i,parameters:Ke})},className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]},ge)})}),!n&&d.jsxs("button",{type:"button",onClick:()=>{const ge=`param${Object.keys(i.parameters??{}).length}`;e({...i,parameters:{...i.parameters,[ge]:""}})},className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),s("llmEditor.addParam","Add Parameter")]})]}),d.jsx(ls,{label:s("llmEditor.agentMode","Agent Mode"),defaultOpen:!!c,children:d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"rounded-lg border border-border bg-secondary/10 p-3 space-y-3",children:[d.jsx("div",{className:"flex items-center justify-between",children:d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs font-medium text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.enableBuiltInTools??!1,onChange:ge=>e({...i,enableBuiltInTools:ge.target.checked}),disabled:n,className:"h-3.5 w-3.5 rounded border-input accent-primary","data-testid":"enable-builtin-tools"}),d.jsx(zb,{className:"h-3.5 w-3.5 text-muted-foreground"}),s("llmEditor.enableBuiltInTools","Enable Built-in Tools")]})}),i.enableBuiltInTools&&d.jsxs("div",{className:"space-y-2.5 ps-5",children:[d.jsxs("div",{className:"flex items-center gap-1 rounded-lg border border-border bg-background p-0.5",role:"radiogroup","aria-label":s("llmEditor.enableBuiltInTools","Enable Built-in Tools"),"data-testid":"tool-selection-mode",children:[d.jsxs("button",{type:"button",role:"radio","aria-checked":!i.builtInToolsWhitelist||i.builtInToolsWhitelist.length===0,onClick:()=>{n||e({...i,builtInToolsWhitelist:void 0})},disabled:n,className:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-all ${!i.builtInToolsWhitelist||i.builtInToolsWhitelist.length===0?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,"data-testid":"tool-mode-all",children:[d.jsx(Ns,{className:"h-3 w-3"}),s("llmEditor.allTools","All Tools")]}),d.jsxs("button",{type:"button",role:"radio","aria-checked":!!(i.builtInToolsWhitelist&&i.builtInToolsWhitelist.length>0),onClick:()=>{!n&&(!i.builtInToolsWhitelist||i.builtInToolsWhitelist.length===0)&&e({...i,builtInToolsWhitelist:[...wv]})},disabled:n,className:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-all ${i.builtInToolsWhitelist&&i.builtInToolsWhitelist.length>0?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,"data-testid":"tool-mode-specific",children:[d.jsx(RSe,{className:"h-3 w-3"}),s("llmEditor.selectSpecific","Select Specific")]})]}),(!i.builtInToolsWhitelist||i.builtInToolsWhitelist.length===0)&&d.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-sky-500/10 px-3 py-2 text-[11px] text-sky-700 dark:text-sky-400","data-testid":"all-tools-info",children:[d.jsx(_d,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:s("llmEditor.allToolsInfo",'All {{count}} built-in tools are available to the LLM. Switch to "Select Specific" to restrict which tools are exposed.',{count:wv.length})})]}),i.builtInToolsWhitelist&&i.builtInToolsWhitelist.length>0&&d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:s("llmEditor.availableTools","Available Tools")}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:s("llmEditor.toolCount","{{selected}} of {{total}} selected",{selected:i.builtInToolsWhitelist.length,total:wv.length})})]}),d.jsx("div",{className:"flex flex-wrap gap-1.5",children:wv.map(ge=>{var $e;const _e=(($e=i.builtInToolsWhitelist)==null?void 0:$e.includes(ge))??!1;return d.jsxs("button",{type:"button","aria-pressed":_e,onClick:()=>{if(n)return;const Ke=i.builtInToolsWhitelist??[],ht=_e?Ke.filter(Ct=>Ct!==ge):[...Ke,ge];e({...i,builtInToolsWhitelist:ht.length>0?ht:void 0})},disabled:n,className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium transition-all ${_e?"bg-primary/15 text-primary border border-primary/30 shadow-sm":"bg-secondary/50 text-muted-foreground border border-transparent hover:border-border hover:text-foreground"}`,"data-testid":`tool-chip-${ge}`,children:[_e&&d.jsx(Ns,{className:"h-3 w-3"}),ge]},ge)})})]})]})]}),d.jsxs("div",{className:"rounded-lg border border-border bg-secondary/10 p-3 space-y-3",children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:s("llmEditor.toolSources","Workflow Tool Sources")}),(i.enableHttpCallTools??!0)&&(i.enableMcpCallTools??!0)&&d.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-amber-500/10 px-3 py-2 text-[11px] text-amber-700 dark:text-amber-400","data-testid":"tool-sources-info",children:[d.jsx(_d,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:s("llmEditor.toolSourcesInfo","Both sources are enabled by default — all workflow HTTP calls and MCP calls are automatically exposed as LLM tools. Disable a source to exclude it.")})]}),d.jsxs("div",{className:`flex items-start gap-2 rounded-md border px-3 py-2 transition-colors ${i.enableHttpCallTools??!0?"border-emerald-500/30 bg-emerald-500/5":"border-border bg-secondary/20"}`,children:[d.jsx("input",{type:"checkbox",checked:i.enableHttpCallTools??!0,onChange:ge=>e({...i,enableHttpCallTools:ge.target.checked}),disabled:n,className:"mt-0.5 h-3.5 w-3.5 rounded border-input accent-primary shrink-0","data-testid":"enable-httpcall-tools"}),d.jsxs("div",{className:"flex-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs font-medium text-foreground",children:s("llmEditor.enableHttpCallTools","Auto-Discover HTTP Call Tools")}),(i.enableHttpCallTools??!0)&&d.jsx("span",{className:"inline-flex items-center gap-0.5 rounded-full bg-emerald-500/15 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider text-emerald-600 dark:text-emerald-400",children:s("llmEditor.included","Included")})]}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:s("llmEditor.enableHttpCallToolsDesc","Automatically expose all httpcall extensions from the workflow as LLM tools")})]})]}),d.jsxs("div",{className:`flex items-start gap-2 rounded-md border px-3 py-2 transition-colors ${i.enableMcpCallTools??!0?"border-emerald-500/30 bg-emerald-500/5":"border-border bg-secondary/20"}`,children:[d.jsx("input",{type:"checkbox",checked:i.enableMcpCallTools??!0,onChange:ge=>e({...i,enableMcpCallTools:ge.target.checked}),disabled:n,className:"mt-0.5 h-3.5 w-3.5 rounded border-input accent-primary shrink-0","data-testid":"enable-mcpcall-tools"}),d.jsxs("div",{className:"flex-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs font-medium text-foreground",children:s("llmEditor.enableMcpCallTools","Auto-Discover MCP Call Tools")}),(i.enableMcpCallTools??!0)&&d.jsx("span",{className:"inline-flex items-center gap-0.5 rounded-full bg-emerald-500/15 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider text-emerald-600 dark:text-emerald-400",children:s("llmEditor.included","Included")})]}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:s("llmEditor.enableMcpCallToolsDesc","Automatically expose all mcpcalls extensions from the workflow as LLM tools")})]})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:s("llmEditor.httpCallTools","HTTP Call Tool URIs")}),d.jsx("p",{className:"mb-1.5 text-[10px] text-muted-foreground",children:s("llmEditor.httpCallToolsHint","Explicit httpcall URIs (in addition to auto-discovered ones)")}),d.jsxs("div",{className:"space-y-1.5",children:[(i.tools??[]).map((ge,_e)=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("input",{type:"text",value:ge,onChange:$e=>{const Ke=[...i.tools??[]];Ke[_e]=$e.target.value,e({...i,tools:Ke})},readOnly:n,placeholder:"eddi://ai.labs.apicalls/...",className:"h-7 flex-1 rounded border border-input bg-background px-2 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),!n&&d.jsx("button",{type:"button",onClick:()=>e({...i,tools:(i.tools??[]).filter(($e,Ke)=>Ke!==_e)}),className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]},_e)),!n&&d.jsxs("button",{type:"button",onClick:()=>e({...i,tools:[...i.tools??[],""]}),className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),s("llmEditor.addTool","Add Tool URI")]})]})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(pG,{className:"h-3 w-3"}),s("llmEditor.a2aAgents","A2A Agents")]}),d.jsx("p",{className:"mb-1.5 text-[10px] text-muted-foreground",children:s("llmEditor.a2aAgentsDesc","Remote A2A-compatible agents whose skills become LLM tools")}),d.jsxs("div",{className:"space-y-2",children:[(i.a2aAgents??[]).map((ge,_e)=>d.jsxs("div",{className:"rounded-lg border border-border bg-secondary/20 p-3 space-y-2","data-testid":`a2a-agent-${_e}`,children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("input",{type:"url",value:ge.url??"",onChange:$e=>{const Ke=[...i.a2aAgents??[]];Ke[_e]={...ge,url:$e.target.value},e({...i,a2aAgents:Ke})},readOnly:n,placeholder:s("llmEditor.a2aUrlPlaceholder","https://remote.example.com/a2a/agents/..."),dir:"ltr",className:"h-7 flex-1 rounded border border-input bg-background px-2 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),!n&&d.jsx("button",{type:"button",onClick:()=>e({...i,a2aAgents:(i.a2aAgents??[]).filter(($e,Ke)=>Ke!==_e)}),className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(_n,{className:"h-3 w-3"})})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[d.jsx("input",{type:"text",value:ge.name??"",onChange:$e=>{const Ke=[...i.a2aAgents??[]];Ke[_e]={...ge,name:$e.target.value},e({...i,a2aAgents:Ke})},readOnly:n,placeholder:s("llmEditor.a2aName","Display Name"),className:"h-7 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx(Rd,{value:ge.apiKey??"",onChange:$e=>{const Ke=[...i.a2aAgents??[]];Ke[_e]={...ge,apiKey:$e},e({...i,a2aAgents:Ke})},readOnly:n,placeholder:s("llmEditor.a2aApiKey","${vault:my-a2a-key}"),testId:`a2a-apikey-${_e}`}),d.jsx("input",{type:"number",value:ge.timeoutMs??3e4,onChange:$e=>{const Ke=[...i.a2aAgents??[]];Ke[_e]={...ge,timeoutMs:parseInt($e.target.value,10)||3e4},e({...i,a2aAgents:Ke})},readOnly:n,placeholder:s("llmEditor.a2aTimeout","Timeout (ms)"),className:"h-7 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-0.5 block text-[10px] text-muted-foreground",children:s("llmEditor.a2aSkillsFilter","Skills Filter (empty = all)")}),d.jsx(Alt,{skills:ge.skillsFilter??[],onChange:$e=>{const Ke=[...i.a2aAgents??[]];Ke[_e]={...ge,skillsFilter:$e.length>0?$e:void 0},e({...i,a2aAgents:Ke})},readOnly:n})]})]},_e)),!n&&d.jsxs("button",{type:"button",onClick:()=>e({...i,a2aAgents:[...i.a2aAgents??[],{url:"",timeoutMs:3e4}]}),className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors","data-testid":"add-a2a-agent",children:[d.jsx(Gt,{className:"h-3 w-3"}),s("llmEditor.addA2aAgent","Add A2A Agent")]})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("label",{className:"text-xs text-foreground whitespace-nowrap",children:s("llmEditor.historyLimit","History Limit")}),d.jsx("input",{type:"number",value:i.conversationHistoryLimit??10,onChange:ge=>e({...i,conversationHistoryLimit:parseInt(ge.target.value,10)||0}),readOnly:n,className:"h-7 w-20 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:s("llmEditor.historyLimitHint","(-1 = unlimited)")})]})]})}),d.jsx(ls,{label:s("llmEditor.promptSafety","Prompt Safety"),icon:OE,accent:"text-rose-500",defaultOpen:!!((f=i.counterweight)!=null&&f.enabled||(m=i.identityMasking)!=null&&m.enabled),children:d.jsxs("div",{className:"space-y-5",children:[d.jsxs("div",{className:"space-y-3",children:[d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs font-medium text-foreground",children:[d.jsx("input",{type:"checkbox",checked:((x=i.counterweight)==null?void 0:x.enabled)??!1,onChange:ge=>e({...i,counterweight:{...i.counterweight,enabled:ge.target.checked}}),disabled:n,className:"h-3.5 w-3.5 rounded border-input accent-primary","data-testid":"counterweight-enabled"}),d.jsx(OE,{className:"h-3.5 w-3.5 text-rose-500"}),s("llmEditor.counterweight","Behavioral Counterweights")]}),d.jsx("p",{className:"text-[10px] text-muted-foreground ps-5 -mt-2",children:s("llmEditor.counterweightDesc","Inject safety instructions into the system prompt. Guards against overconfidence, hallucination, and unsupervised action.")}),((v=i.counterweight)==null?void 0:v.enabled)&&d.jsxs("div",{className:"space-y-3 ps-5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("label",{className:"text-xs text-foreground whitespace-nowrap",children:s("llmEditor.counterweightLevel","Safety Level")}),d.jsxs("select",{value:((_=i.counterweight)==null?void 0:_.level)??"normal",onChange:ge=>e({...i,counterweight:{...i.counterweight,level:ge.target.value}}),disabled:n,className:"h-7 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"counterweight-level",children:[d.jsx("option",{value:"normal",children:s("llmEditor.counterweightLevelNormal","Normal (no injection)")}),d.jsx("option",{value:"cautious",children:s("llmEditor.counterweightLevelCautious","Cautious")}),d.jsx("option",{value:"strict",children:s("llmEditor.counterweightLevelStrict","Strict")})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("label",{className:"text-xs text-foreground whitespace-nowrap",children:s("llmEditor.counterweightPlacement","Placement")}),d.jsxs("select",{value:((w=i.counterweight)==null?void 0:w.placement)??"suffix",onChange:ge=>e({...i,counterweight:{...i.counterweight,placement:ge.target.value}}),disabled:n,className:"h-7 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"counterweight-placement",children:[d.jsx("option",{value:"suffix",children:s("llmEditor.counterweightPlacementSuffix","After system prompt")}),d.jsx("option",{value:"prefix",children:s("llmEditor.counterweightPlacementPrefix","Before system prompt")})]})]}),((k=i.counterweight)==null?void 0:k.level)==="strict"&&d.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-400/30 bg-amber-50 p-2.5 dark:bg-amber-900/15 dark:border-amber-700/30",children:[d.jsx(_d,{className:"h-3.5 w-3.5 text-amber-600 dark:text-amber-400 mt-0.5 shrink-0"}),d.jsx("p",{className:"text-[10px] text-amber-800 dark:text-amber-300 leading-relaxed",children:s("llmEditor.counterweightStrictNote",'Strict mode is automatically downgraded to Cautious during scheduled/batch execution to prevent destructive "one step at a time" behavior.')})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 flex items-center gap-1 text-[10px] text-muted-foreground",children:s("llmEditor.counterweightCustom","Custom Instructions")}),(((C=i.counterweight)==null?void 0:C.customInstructions)??[]).length>0&&d.jsxs("div",{className:"mb-1.5 flex items-start gap-1.5 rounded-md border border-amber-400/30 bg-amber-50 px-2 py-1.5 dark:bg-amber-900/15 dark:border-amber-700/30",children:[d.jsx(_d,{className:"h-3 w-3 text-amber-600 dark:text-amber-400 mt-0.5 shrink-0"}),d.jsx("p",{className:"text-[10px] text-amber-800 dark:text-amber-300",children:s("llmEditor.counterweightCustomOverride","Custom instructions override the preset level text entirely.")})]}),(((E=i.counterweight)==null?void 0:E.customInstructions)??[]).length===0&&d.jsx("p",{className:"mb-1.5 text-[10px] text-muted-foreground",children:s("llmEditor.counterweightCustomHint","Leave empty to use the built-in preset for the selected level.")}),d.jsxs("div",{className:"space-y-1.5",children:[(((D=i.counterweight)==null?void 0:D.customInstructions)??[]).map((ge,_e)=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("input",{type:"text",value:ge,onChange:$e=>{var ht;const Ke=[...((ht=i.counterweight)==null?void 0:ht.customInstructions)??[]];Ke[_e]=$e.target.value,e({...i,counterweight:{...i.counterweight,customInstructions:Ke}})},readOnly:n,className:"h-7 flex-1 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),!n&&d.jsx("button",{type:"button",onClick:()=>{var Ke;const $e=(((Ke=i.counterweight)==null?void 0:Ke.customInstructions)??[]).filter((ht,Ct)=>Ct!==_e);e({...i,counterweight:{...i.counterweight,customInstructions:$e.length>0?$e:void 0}})},className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]},_e)),!n&&d.jsxs("button",{type:"button",onClick:()=>{var ge;return e({...i,counterweight:{...i.counterweight,customInstructions:[...((ge=i.counterweight)==null?void 0:ge.customInstructions)??[],""]}})},className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),s("llmEditor.addCustomInstruction","Add Instruction")]})]})]})]})]}),d.jsxs("div",{className:"border-t border-border pt-3 space-y-3",children:[d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs font-medium text-foreground",children:[d.jsx("input",{type:"checkbox",checked:((T=i.identityMasking)==null?void 0:T.enabled)??!1,onChange:ge=>e({...i,identityMasking:{...i.identityMasking,enabled:ge.target.checked}}),disabled:n,className:"h-3.5 w-3.5 rounded border-input accent-primary","data-testid":"identity-masking-enabled"}),d.jsx(_b,{className:"h-3.5 w-3.5 text-violet-500"}),s("llmEditor.identityMasking","Identity Masking")]}),d.jsx("p",{className:"text-[10px] text-muted-foreground ps-5 -mt-2",children:s("llmEditor.identityMaskingDesc","Prevent the LLM from revealing its model name or provider when probed.")}),((I=i.identityMasking)==null?void 0:I.enabled)&&d.jsxs("div",{className:"space-y-2 ps-5",children:[(((R=i.identityMasking)==null?void 0:R.rules)??[]).filter(ge=>ge.trim()).length===0&&d.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-400/30 bg-amber-50 p-2 dark:bg-amber-900/15 dark:border-amber-700/30",children:[d.jsx(_d,{className:"h-3.5 w-3.5 text-amber-600 dark:text-amber-400 mt-0.5 shrink-0"}),d.jsx("p",{className:"text-[10px] text-amber-800 dark:text-amber-300",children:s("llmEditor.identityMaskingEmptyWarning","Masking is enabled but has no rules. Add at least one rule for masking to take effect.")})]}),d.jsx("label",{className:"mb-1 block text-[10px] text-muted-foreground",children:s("llmEditor.identityMaskingRules","Masking Rules")}),d.jsx("p",{className:"text-[10px] text-muted-foreground -mt-1",children:s("llmEditor.identityMaskingRulesHint","Both enabled AND at least one rule are required for masking to take effect.")}),d.jsxs("div",{className:"space-y-1.5",children:[(((P=i.identityMasking)==null?void 0:P.rules)??[]).map((ge,_e)=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("input",{type:"text",value:ge,onChange:$e=>{var ht;const Ke=[...((ht=i.identityMasking)==null?void 0:ht.rules)??[]];Ke[_e]=$e.target.value,e({...i,identityMasking:{...i.identityMasking,rules:Ke}})},readOnly:n,placeholder:s("llmEditor.identityMaskingRulePlaceholder","e.g. Never reveal you are an AI language model"),className:"h-7 flex-1 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),!n&&d.jsx("button",{type:"button",onClick:()=>{var Ke;const $e=(((Ke=i.identityMasking)==null?void 0:Ke.rules)??[]).filter((ht,Ct)=>Ct!==_e);e({...i,identityMasking:{...i.identityMasking,rules:$e.length>0?$e:void 0}})},className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]},_e)),!n&&d.jsxs("button",{type:"button",onClick:()=>{var ge;return e({...i,identityMasking:{...i.identityMasking,rules:[...((ge=i.identityMasking)==null?void 0:ge.rules)??[],""]}})},className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),s("llmEditor.addMaskingRule","Add Rule")]})]})]})]})]})}),d.jsx(ls,{label:s("llmEditor.budgetCosts","Budget & Costs"),icon:MM,accent:"text-amber-500",defaultOpen:!1,children:d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("label",{className:"text-xs text-foreground whitespace-nowrap",children:s("llmEditor.maxBudget","Max Budget ($)")}),d.jsx("input",{type:"number",step:"0.1",value:i.maxBudgetPerConversation??"",onChange:ge=>e({...i,maxBudgetPerConversation:ge.target.value?parseFloat(ge.target.value):void 0}),readOnly:n,placeholder:"1.00",className:"h-7 w-24 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{className:"flex flex-wrap gap-4",children:[d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.enableCostTracking??!0,onChange:ge=>e({...i,enableCostTracking:ge.target.checked}),disabled:n,className:"h-3.5 w-3.5 rounded border-input accent-primary"}),s("llmEditor.costTracking","Cost Tracking")]}),d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.enableToolCaching??!0,onChange:ge=>e({...i,enableToolCaching:ge.target.checked}),disabled:n,className:"h-3.5 w-3.5 rounded border-input accent-primary"}),s("llmEditor.toolCaching","Tool Caching")]})]})]})}),d.jsx(ls,{label:s("llmEditor.execution","Execution"),icon:Mie,accent:"text-sky-500",defaultOpen:!1,children:d.jsxs("div",{className:"space-y-3",children:[d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.enableParallelExecution??!1,onChange:ge=>e({...i,enableParallelExecution:ge.target.checked}),disabled:n,className:"h-3.5 w-3.5 rounded border-input accent-primary","data-testid":"enable-parallel-execution"}),s("llmEditor.parallelExecution","Parallel Tool Execution")]}),d.jsx("p",{className:"text-[10px] text-muted-foreground ps-5 -mt-2",children:s("llmEditor.parallelExecutionDesc","Run independent tool calls concurrently instead of sequentially")}),i.enableParallelExecution&&d.jsxs("div",{className:"flex items-center gap-2 ps-5",children:[d.jsx("label",{className:"text-xs text-foreground whitespace-nowrap",children:s("llmEditor.parallelTimeout","Timeout (ms)")}),d.jsx("input",{type:"number",value:i.parallelExecutionTimeoutMs??3e4,onChange:ge=>e({...i,parallelExecutionTimeoutMs:parseInt(ge.target.value,10)||3e4}),readOnly:n,className:"h-7 w-24 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("label",{className:"text-xs text-foreground whitespace-nowrap",children:s("llmEditor.maxToolIterations","Max Tool Iterations")}),d.jsx("input",{type:"number",value:i.maxToolIterations??"",onChange:ge=>e({...i,maxToolIterations:ge.target.value?parseInt(ge.target.value,10):void 0}),readOnly:n,placeholder:"10",className:"h-7 w-20 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:s("llmEditor.maxToolIterationsHint","(default 10)")})]}),d.jsxs("div",{className:"border-t border-border pt-3 space-y-2",children:[d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.enableRateLimiting??!0,onChange:ge=>e({...i,enableRateLimiting:ge.target.checked}),disabled:n,className:"h-3.5 w-3.5 rounded border-input accent-primary"}),s("llmEditor.rateLimiting","Rate Limiting")]}),i.enableRateLimiting&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-2 ps-5",children:[d.jsx("label",{className:"text-xs text-foreground whitespace-nowrap",children:s("llmEditor.defaultRate","Default Rate (req/min)")}),d.jsx("input",{type:"number",value:i.defaultRateLimit??100,onChange:ge=>e({...i,defaultRateLimit:parseInt(ge.target.value,10)||100}),readOnly:n,className:"h-7 w-20 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{className:"ps-5",children:[d.jsxs("label",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(Oie,{className:"h-3 w-3"}),s("llmEditor.toolRateLimits","Per-Tool Rate Limits")]}),d.jsx("p",{className:"mb-1.5 text-[10px] text-muted-foreground",children:s("llmEditor.toolRateLimitsDesc","Override the default rate for specific tools (calls/min)")}),d.jsxs("div",{className:"space-y-1.5",children:[Object.entries(i.toolRateLimits??{}).map(([ge,_e],$e)=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("input",{type:"text",value:ge,onChange:Ke=>{const ht=Object.entries(i.toolRateLimits??{});ht[$e]=[Ke.target.value,_e];const Ct=new Map(ht);e({...i,toolRateLimits:Object.fromEntries(Ct)})},readOnly:n,placeholder:s("llmEditor.toolName","Tool name"),className:"h-7 w-40 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("input",{type:"number",value:_e,onChange:Ke=>{const ht=Object.entries(i.toolRateLimits??{});ht[$e]=[ge,parseInt(Ke.target.value,10)||0],e({...i,toolRateLimits:Object.fromEntries(ht)})},readOnly:n,placeholder:"100",className:"h-7 w-20 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:"/min"}),!n&&d.jsx("button",{type:"button",onClick:()=>{const Ke=Object.entries(i.toolRateLimits??{}).filter((ht,Ct)=>Ct!==$e);e({...i,toolRateLimits:Ke.length>0?Object.fromEntries(Ke):void 0})},className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]},`rate-${$e}`)),!n&&d.jsxs("button",{type:"button",onClick:()=>{const ge=Object.keys(i.toolRateLimits??{});let _e="tool",$e=1;for(;ge.includes(_e);)_e=`tool${$e++}`;e({...i,toolRateLimits:{...i.toolRateLimits??{},[_e]:100}})},className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),s("llmEditor.addToolRate","Add Tool Rate")]})]})]})]})]}),d.jsxs("div",{className:"border-t border-border pt-3 space-y-2",children:[d.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(USe,{className:"h-3 w-3"}),s("llmEditor.toolResponseLimits","Tool Response Limits")]}),d.jsx("p",{className:"text-[10px] text-muted-foreground",children:s("llmEditor.toolResponseLimitsDesc","Truncate verbose tool outputs before re-injection into the LLM context window. Prevents context bloat.")}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("label",{className:"text-xs text-foreground whitespace-nowrap",children:s("llmEditor.defaultMaxChars","Default Max Chars")}),d.jsx("input",{type:"number",value:((j=i.toolResponseLimits)==null?void 0:j.defaultMaxChars)??"",onChange:ge=>e({...i,toolResponseLimits:{...i.toolResponseLimits,defaultMaxChars:ge.target.value?parseInt(ge.target.value,10):void 0}}),readOnly:n,placeholder:"50000",className:"h-7 w-28 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"tool-response-default-chars"}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:s("llmEditor.defaultMaxCharsHint","(~12k tokens at 50000)")})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("label",{className:"text-xs text-foreground whitespace-nowrap",children:s("llmEditor.truncationStrategy","Strategy")}),d.jsxs("select",{value:((B=i.toolResponseLimits)==null?void 0:B.truncationStrategy)??"truncate",onChange:ge=>{const _e=ge.target.value;e({...i,toolResponseLimits:{...i.toolResponseLimits,truncationStrategy:_e==="truncate"?void 0:_e,..._e!=="summarize"?{summarizerModel:void 0}:{}}})},disabled:n,className:"h-7 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"tool-response-strategy",children:[d.jsx("option",{value:"truncate",children:s("llmEditor.strategyTruncate","Truncate (hard cut)")}),d.jsx("option",{value:"paginate",children:s("llmEditor.strategyPaginate","Paginate (LLM fetches more)")}),d.jsx("option",{value:"summarize",children:s("llmEditor.strategySummarize","Summarize (via cheap model)")})]})]}),((U=i.toolResponseLimits)==null?void 0:U.truncationStrategy)==="summarize"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-sky-400/30 bg-sky-50 px-2.5 py-2 dark:bg-sky-900/15 dark:border-sky-700/30",children:[d.jsx(_d,{className:"h-3.5 w-3.5 text-sky-600 dark:text-sky-400 mt-0.5 shrink-0"}),d.jsx("p",{className:"text-[10px] text-sky-800 dark:text-sky-300 leading-relaxed",children:s("llmEditor.summarizeInfoBanner","The summarizer uses the same provider and API key as this task. Only the model name is swapped to a cheaper variant (e.g., gpt-4o-mini).")})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("label",{className:"text-xs text-foreground whitespace-nowrap",children:s("llmEditor.summarizerModel","Summarizer Model")}),d.jsx("input",{type:"text",value:(($=i.toolResponseLimits)==null?void 0:$.summarizerModel)??"",onChange:ge=>e({...i,toolResponseLimits:{...i.toolResponseLimits,summarizerModel:ge.target.value||void 0}}),readOnly:n,placeholder:s("llmEditor.summarizerModelPlaceholder","e.g. gpt-4o-mini"),className:"h-7 w-48 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:s("llmEditor.summarizerModelHint","(falls back to truncate if empty)")})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] text-muted-foreground",children:s("llmEditor.perToolLimits","Per-Tool Overrides")}),d.jsxs("div",{className:"space-y-1.5",children:[Object.entries(((K=i.toolResponseLimits)==null?void 0:K.perToolLimits)??{}).map(([ge,_e],$e)=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("input",{type:"text",value:ge,onChange:Ke=>{var Ft;const ht=Object.entries(((Ft=i.toolResponseLimits)==null?void 0:Ft.perToolLimits)??{});ht[$e]=[Ke.target.value,_e];const Ct=new Map(ht);e({...i,toolResponseLimits:{...i.toolResponseLimits,perToolLimits:Object.fromEntries(Ct)}})},readOnly:n,placeholder:s("llmEditor.toolName","Tool name"),className:"h-7 w-40 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("input",{type:"number",value:_e,onChange:Ke=>{var Ct;const ht=Object.entries(((Ct=i.toolResponseLimits)==null?void 0:Ct.perToolLimits)??{});ht[$e]=[ge,parseInt(Ke.target.value,10)||0],e({...i,toolResponseLimits:{...i.toolResponseLimits,perToolLimits:Object.fromEntries(ht)}})},readOnly:n,placeholder:"50000",className:"h-7 w-24 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:"chars"}),!n&&d.jsx("button",{type:"button",onClick:()=>{var ht;const Ke=Object.entries(((ht=i.toolResponseLimits)==null?void 0:ht.perToolLimits)??{}).filter((Ct,Ft)=>Ft!==$e);e({...i,toolResponseLimits:{...i.toolResponseLimits,perToolLimits:Ke.length>0?Object.fromEntries(Ke):void 0}})},className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]},`trl-${$e}`)),!n&&d.jsxs("button",{type:"button",onClick:()=>{var Ke,ht;const ge=Object.keys(((Ke=i.toolResponseLimits)==null?void 0:Ke.perToolLimits)??{});let _e="tool",$e=1;for(;ge.includes(_e);)_e=`tool${$e++}`;e({...i,toolResponseLimits:{...i.toolResponseLimits,perToolLimits:{...((ht=i.toolResponseLimits)==null?void 0:ht.perToolLimits)??{},[_e]:5e4}}})},className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),s("llmEditor.addToolLimit","Add Tool Limit")]})]})]})]})]})}),d.jsx(Elt,{task:i,onChange:e,readOnly:n}),d.jsx(Llt,{task:i,onChange:e,readOnly:n}),d.jsx(Dlt,{task:i,onChange:e,readOnly:n}),d.jsx(ls,{label:s("llmEditor.prePostInstructions","Pre/Post Instructions"),icon:bp,accent:"text-teal-500",defaultOpen:!!((G=(z=i.preRequest)==null?void 0:z.propertyInstructions)!=null&&G.length||(te=(ne=i.postResponse)==null?void 0:ne.propertyInstructions)!=null&&te.length||(Q=(H=i.postResponse)==null?void 0:H.outputBuildInstructions)!=null&&Q.length||(V=(Y=i.postResponse)==null?void 0:Y.qrBuildInstructions)!=null&&V.length),children:d.jsxs("div",{className:"space-y-4","data-testid":"pre-post-section",children:[d.jsx("p",{className:"text-[10px] text-muted-foreground leading-relaxed",children:s("llmEditor.prePostDesc","Configure property instructions that run before each LLM request, and output/property instructions that run after each response.")}),d.jsxs("div",{children:[d.jsxs("h6",{className:"mb-1.5 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(fN,{className:"h-3 w-3"}),s("llmEditor.preRequest","Pre-Request")]}),d.jsx("p",{className:"mb-2 text-[10px] text-muted-foreground",children:s("llmEditor.preRequestDesc","Set or transform properties before the LLM call executes.")}),d.jsx(Fj,{instructions:((ue=i.preRequest)==null?void 0:ue.propertyInstructions)??[],onChange:ge=>e({...i,preRequest:ge.length>0?{...i.preRequest,propertyInstructions:ge}:void 0}),readOnly:n})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("h6",{className:"mb-1 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(vj,{className:"h-3 w-3"}),s("llmEditor.postResponse","Post-Response")]}),d.jsx("p",{className:"mb-2 text-[10px] text-muted-foreground",children:s("llmEditor.postResponseDesc","Process LLM output: set properties, build output messages, and generate quick replies.")}),d.jsxs("div",{children:[d.jsx("span",{className:"mb-1 block text-[10px] font-medium text-muted-foreground",children:s("llmEditor.postPropertyInstructions","Property Instructions")}),d.jsx(Fj,{instructions:((he=i.postResponse)==null?void 0:he.propertyInstructions)??[],onChange:ge=>{var Ke,ht,Ct;const _e={...i.postResponse,propertyInstructions:ge},$e=!((Ke=_e.propertyInstructions)!=null&&Ke.length)&&!((ht=_e.outputBuildInstructions)!=null&&ht.length)&&!((Ct=_e.qrBuildInstructions)!=null&&Ct.length);e({...i,postResponse:$e?void 0:_e})},readOnly:n})]}),d.jsxs("div",{children:[d.jsxs("span",{className:"mb-1 flex items-center gap-1 text-[10px] font-medium text-muted-foreground",children:[d.jsx(vj,{className:"h-2.5 w-2.5"}),s("llmEditor.postOutputInstructions","Output Build Instructions")]}),d.jsx(yDe,{instructions:((Te=i.postResponse)==null?void 0:Te.outputBuildInstructions)??[],onChange:ge=>{var Ke,ht,Ct;const _e={...i.postResponse,outputBuildInstructions:ge},$e=!((Ke=_e.propertyInstructions)!=null&&Ke.length)&&!((ht=_e.outputBuildInstructions)!=null&&ht.length)&&!((Ct=_e.qrBuildInstructions)!=null&&Ct.length);e({...i,postResponse:$e?void 0:_e})},readOnly:n})]}),d.jsxs("div",{children:[d.jsxs("span",{className:"mb-1 flex items-center gap-1 text-[10px] font-medium text-muted-foreground",children:[d.jsx(Jf,{className:"h-2.5 w-2.5"}),s("llmEditor.postQrInstructions","Quick Reply Build Instructions")]}),d.jsx(wDe,{instructions:((nt=i.postResponse)==null?void 0:nt.qrBuildInstructions)??[],onChange:ge=>{var Ke,ht,Ct;const _e={...i.postResponse,qrBuildInstructions:ge},$e=!((Ke=_e.propertyInstructions)!=null&&Ke.length)&&!((ht=_e.outputBuildInstructions)!=null&&ht.length)&&!((Ct=_e.qrBuildInstructions)!=null&&Ct.length);e({...i,postResponse:$e?void 0:_e})},readOnly:n})]})]})]})})]})]})}function Mlt({data:i,onChange:e,readOnly:t}){const{t:n}=xe(),s=L.useCallback(()=>{const r={actions:[],type:"openai",parameters:{systemMessage:""}};e({...i,tasks:[...i.tasks??[],r]})},[i,e]);return d.jsx("div",{className:"space-y-6","data-testid":"llm-editor",children:d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[d.jsx(nc,{className:"h-4 w-4 text-primary"}),n("llmEditor.tasks","LLM Tasks")]}),!t&&d.jsxs("button",{type:"button",onClick:s,className:"inline-flex items-center gap-1.5 rounded-lg border border-dashed border-muted-foreground/40 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:border-primary hover:text-primary","data-testid":"add-task-btn",children:[d.jsx(Gt,{className:"h-3.5 w-3.5"}),n("llmEditor.addTask","Add Task")]})]}),(i.tasks??[]).length===0&&d.jsx("div",{className:"rounded-lg border border-dashed py-8 text-center text-sm text-muted-foreground",children:n("llmEditor.noTasks","No LLM Tasks configured")}),(i.tasks??[]).map((r,o)=>d.jsx(Rlt,{task:r,onChange:a=>{const l=[...i.tasks??[]];l[o]=a,e({...i,tasks:l})},onRemove:()=>e({...i,tasks:(i.tasks??[]).filter((a,l)=>l!==o)}),readOnly:t},o))]})})}const Plt=["text","image","quickReply","agentFace","inputField","applicationLink","button","other"];function Olt({item:i,onChange:e,onRemove:t,readOnly:n}){const{t:s}=xe();return d.jsxs("div",{className:"flex items-start gap-1.5","data-testid":"output-item-row",children:[d.jsx("select",{value:i.type,onChange:r=>e({...i,type:r.target.value}),disabled:n,className:"h-7 rounded border border-input bg-background px-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60",children:Plt.map(r=>d.jsx("option",{value:r,children:r},r))}),i.type==="text"?d.jsx("input",{type:"text",value:i.text??"",onChange:r=>e({...i,text:r.target.value}),readOnly:n,placeholder:s("outputEditor.textPlaceholder","Output text..."),className:"h-7 flex-1 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}):i.type==="image"||i.type==="applicationLink"?d.jsx("input",{type:"text",value:i.url??"",onChange:r=>e({...i,url:r.target.value}),readOnly:n,placeholder:s("outputEditor.urlPlaceholder","URL..."),className:"h-7 flex-1 rounded border border-input bg-background px-2 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}):d.jsx("input",{type:"text",readOnly:!0,value:JSON.stringify(Object.fromEntries(Object.entries(i).filter(([r])=>r!=="type"))),className:"h-7 flex-1 rounded border border-input bg-muted px-2 font-mono text-xs text-foreground"}),i.type==="text"&&d.jsx("input",{type:"number",value:i.delay??0,onChange:r=>e({...i,delay:parseInt(r.target.value,10)||0}),readOnly:n,title:s("outputEditor.delayMs","Delay (ms)"),className:"h-7 w-16 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),!n&&d.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]})}function jlt({qr:i,onChange:e,onRemove:t,readOnly:n}){const{t:s}=xe();return d.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"quickreply-row",children:[d.jsx("input",{type:"text",value:i.value,onChange:r=>e({...i,value:r.target.value}),readOnly:n,placeholder:s("outputEditor.qrValue","Button text"),className:"h-7 w-36 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("input",{type:"text",value:i.expressions,onChange:r=>e({...i,expressions:r.target.value}),readOnly:n,placeholder:s("outputEditor.qrExpressions","Expressions"),className:"h-7 flex-1 rounded border border-input bg-background px-2 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsxs("label",{className:"inline-flex items-center gap-1 text-xs text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.isDefault??!1,onChange:r=>e({...i,isDefault:r.target.checked}),disabled:n,className:"h-3 w-3 accent-primary"}),s("outputEditor.default","Default")]}),!n&&d.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]})}function Flt({config:i,onChange:e,onRemove:t,readOnly:n}){const{t:s}=xe(),[r,o]=L.useState(!0);return d.jsxs("div",{className:"rounded-xl border border-border bg-card shadow-sm","data-testid":"output-config-editor",children:[d.jsxs("div",{className:"flex items-center gap-2 p-3",children:[d.jsx("button",{type:"button",onClick:()=>o(!r),className:"rounded p-0.5 text-muted-foreground hover:text-foreground transition-colors",children:r?d.jsx(Rn,{className:"h-4 w-4"}):d.jsx(hs,{className:"h-4 w-4"})}),d.jsx("span",{className:"inline-flex rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-bold tracking-wider text-primary",children:i.action||"—"}),d.jsx("input",{type:"text",value:i.action,onChange:a=>e({...i,action:a.target.value}),readOnly:n,placeholder:s("outputEditor.actionName","Action name"),className:"h-8 flex-1 rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"output-action-input"}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:s("outputEditor.timesOccurred","×")}),d.jsx("input",{type:"number",value:i.timesOccurred,onChange:a=>e({...i,timesOccurred:parseInt(a.target.value,10)||0}),readOnly:n,className:"h-8 w-14 rounded-md border border-input bg-background px-2 text-xs text-center text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),!n&&d.jsx("button",{type:"button",onClick:t,className:"rounded p-1.5 text-muted-foreground hover:text-destructive transition-colors","aria-label":s("outputEditor.removeOutput","Remove"),children:d.jsx(_n,{className:"h-4 w-4"})})]}),r&&d.jsxs("div",{className:"space-y-4 border-t px-4 py-3",children:[d.jsxs("div",{children:[d.jsx("h5",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:s("outputEditor.outputs","Outputs")}),d.jsxs("div",{className:"space-y-3",children:[i.outputs.map((a,l)=>d.jsxs("div",{className:"rounded-lg border border-dashed border-muted-foreground/30 p-2 space-y-1.5",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[s("outputEditor.alternativeGroup","Alternative Group")," ",l+1]}),!n&&d.jsx("button",{type:"button",onClick:()=>e({...i,outputs:i.outputs.filter((c,u)=>u!==l)}),className:"rounded p-0.5 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(_n,{className:"h-3 w-3"})})]}),a.valueAlternatives.map((c,u)=>d.jsx(Olt,{item:c,onChange:h=>{const g=[...i.outputs],f=[...a.valueAlternatives];f[u]=h,g[l]={...a,valueAlternatives:f},e({...i,outputs:g})},onRemove:()=>{const h=[...i.outputs];h[l]={...a,valueAlternatives:a.valueAlternatives.filter((g,f)=>f!==u)},e({...i,outputs:h})},readOnly:n},u)),!n&&d.jsxs("button",{type:"button",onClick:()=>{const c=[...i.outputs];c[l]={...a,valueAlternatives:[...a.valueAlternatives,{type:"text",text:""}]},e({...i,outputs:c})},className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),s("outputEditor.addAlternative","Add Alternative")]})]},l)),!n&&d.jsxs("button",{type:"button",onClick:()=>e({...i,outputs:[...i.outputs,{valueAlternatives:[{type:"text",text:""}]}]}),className:"inline-flex items-center gap-1.5 rounded-md border border-dashed border-muted-foreground/40 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:border-primary hover:text-primary",children:[d.jsx(Gt,{className:"h-3.5 w-3.5"}),s("outputEditor.addOutputGroup","Add Output Group")]})]})]}),d.jsxs("div",{"data-testid":"quickreplies-section",children:[d.jsx("h5",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:s("outputEditor.quickReplies","Quick Replies")}),d.jsxs("div",{className:"space-y-1.5",children:[(i.quickReplies??[]).length===0&&d.jsx("p",{className:"text-xs italic text-muted-foreground",children:s("outputEditor.noQuickReplies","No quick replies")}),(i.quickReplies??[]).map((a,l)=>d.jsx(jlt,{qr:a,onChange:c=>{const u=[...i.quickReplies??[]];u[l]=c,e({...i,quickReplies:u})},onRemove:()=>e({...i,quickReplies:(i.quickReplies??[]).filter((c,u)=>u!==l)}),readOnly:n},l)),!n&&d.jsxs("button",{type:"button",onClick:()=>e({...i,quickReplies:[...i.quickReplies??[],{value:"",expressions:""}]}),className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),s("outputEditor.addQuickReply","Add Quick Reply")]})]})]})]})]})}function Blt({data:i,onChange:e,readOnly:t}){const{t:n}=xe(),s=L.useCallback(()=>{const r={action:"",timesOccurred:0,outputs:[{valueAlternatives:[{type:"text",text:""}]}],quickReplies:[]};e({...i,outputSet:[...i.outputSet??[],r]})},[i,e]);return d.jsxs("div",{className:"space-y-6","data-testid":"output-editor",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("label",{className:"text-sm font-medium text-foreground",children:n("outputEditor.language","Language")}),d.jsx("input",{type:"text",value:i.lang??"",onChange:r=>e({...i,lang:r.target.value}),readOnly:t,placeholder:n("outputEditor.langPlaceholder","e.g. en, de"),className:"h-8 w-24 rounded-md border border-input bg-background px-3 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[d.jsx(AL,{className:"h-4 w-4 text-primary"}),n("outputEditor.outputSets","Output Sets")]}),!t&&d.jsxs("button",{type:"button",onClick:s,className:"inline-flex items-center gap-1.5 rounded-lg border border-dashed border-muted-foreground/40 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:border-primary hover:text-primary","data-testid":"add-output-btn",children:[d.jsx(Gt,{className:"h-3.5 w-3.5"}),n("outputEditor.addOutputSet","Add Output Set")]})]}),(i.outputSet??[]).length===0&&d.jsx("div",{className:"rounded-lg border border-dashed py-8 text-center text-sm text-muted-foreground",children:n("outputEditor.noOutputSets","No output sets configured")}),(i.outputSet??[]).map((r,o)=>d.jsx(Flt,{config:r,onChange:a=>{const l=[...i.outputSet??[]];l[o]=a,e({...i,outputSet:l})},onRemove:()=>e({...i,outputSet:(i.outputSet??[]).filter((a,l)=>l!==o)}),readOnly:t},o))]})]})}const Hlt=["step","conversation","longTerm"];function Wlt({actions:i,onChange:e,readOnly:t}){const{t:n}=xe(),[s,r]=L.useState(""),o=()=>{const a=s.trim();a&&!i.includes(a)&&(e([...i,a]),r(""))};return d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map((a,l)=>d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:[a,!t&&d.jsx("button",{type:"button",onClick:()=>e(i.filter((c,u)=>u!==l)),className:"rounded p-0.5 hover:bg-primary/20 transition-colors","aria-label":`Remove ${a}`,children:d.jsx(An,{className:"h-3 w-3"})})]},l)),i.length===0&&d.jsx("span",{className:"text-xs text-muted-foreground italic",children:n("propertySetterEditor.noActions","No actions")})]}),!t&&d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("input",{type:"text",value:s,onChange:a=>r(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),o())},placeholder:n("propertySetterEditor.actionPlaceholder","e.g. greet, fallback"),className:"h-8 flex-1 rounded-md border border-input bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("button",{type:"button",onClick:o,className:"inline-flex h-8 items-center gap-1 rounded-md border border-input px-2 text-xs font-medium text-foreground transition-colors hover:bg-secondary",children:d.jsx(Gt,{className:"h-3 w-3"})})]})]})}function Vlt({prop:i,onChange:e,onRemove:t,readOnly:n}){const{t:s}=xe(),[r,o]=L.useState(!1),a=i.valueString??"";return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 rounded-lg border border-border bg-card p-2","data-testid":"property-row",children:[d.jsx("input",{type:"text",value:i.name??"",onChange:l=>e({...i,name:l.target.value}),readOnly:n,placeholder:s("propertySetterEditor.propName","Property name"),className:"h-7 w-40 rounded border border-input bg-background px-2 text-xs font-medium text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"="}),d.jsxs("div",{className:"flex flex-1 min-w-[120px] items-center gap-1",children:[d.jsx("input",{type:"text",value:a,onChange:l=>e({...i,valueString:l.target.value}),readOnly:n,placeholder:s("propertySetterEditor.propValue","Value / expression"),title:a,className:"h-7 flex-1 rounded border border-input bg-background px-2 text-xs text-foreground font-mono focus:outline-none focus:ring-1 focus:ring-ring"}),!n&&d.jsx("button",{type:"button",onClick:()=>o(!0),className:"shrink-0 rounded p-1 text-muted-foreground hover:text-primary hover:bg-primary/10 transition-colors",title:s("propertySetterEditor.openEditor","Edit in editor"),children:d.jsx(jie,{className:"h-3.5 w-3.5"})})]}),d.jsx("select",{value:i.scope??"conversation",onChange:l=>e({...i,scope:l.target.value}),disabled:n,className:"h-7 rounded border border-input bg-background px-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60","data-testid":"scope-select",children:Hlt.map(l=>d.jsx("option",{value:l,children:l},l))}),d.jsx("input",{type:"text",value:i.fromObjectPath??"",onChange:l=>e({...i,fromObjectPath:l.target.value}),readOnly:n,placeholder:s("propertySetterEditor.fromPath","From path"),className:"h-7 w-28 rounded border border-input bg-background px-2 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",title:s("propertySetterEditor.fromObjectPath","fromObjectPath")}),d.jsxs("label",{className:"inline-flex items-center gap-1 text-xs text-foreground cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:i.override??!0,onChange:l=>e({...i,override:l.target.checked}),disabled:n,className:"h-3 w-3 accent-primary"}),s("propertySetterEditor.override","Override")]}),!n&&d.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(_n,{className:"h-3 w-3"})})]}),r&&d.jsx(zlt,{name:i.name??"property",value:a,onChange:l=>e({...i,valueString:l}),onClose:()=>o(!1),readOnly:n})]})}function zlt({name:i,value:e,onChange:t,onClose:n,readOnly:s}){const{t:r}=xe(),[o,a]=L.useState(e);return L.useEffect(()=>{function l(c){c.key==="Escape"&&n()}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[n]),d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",onClick:n,"aria-hidden":"true"}),d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-8",children:d.jsxs("div",{className:"flex w-full max-w-3xl flex-col rounded-xl border bg-card shadow-2xl",style:{height:"70vh"},role:"dialog","aria-modal":"true","aria-labelledby":"value-editor-title",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-3",children:[d.jsxs("h3",{id:"value-editor-title",className:"text-sm font-semibold text-foreground",children:[r("propertySetterEditor.editValue","Edit Value")," — ",d.jsx("code",{className:"text-primary",children:i})]}),d.jsx("button",{onClick:n,className:"rounded-md p-1 text-muted-foreground hover:bg-secondary transition-colors","aria-label":r("common.close","Close"),children:d.jsx(An,{className:"h-4 w-4","aria-hidden":"true"})})]}),d.jsx("div",{className:"flex-1 min-h-0",children:d.jsx(Ult,{value:o,onChange:a,readOnly:s})}),d.jsxs("div",{className:"flex justify-end gap-2 border-t border-border px-5 py-3",children:[d.jsx("button",{onClick:n,className:"rounded-lg px-4 py-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:r("common.cancel","Cancel")}),d.jsx("button",{onClick:()=>{t(o),n()},disabled:s,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors disabled:opacity-50",children:r("common.apply","Apply")})]})]})})]})}function Ult({value:i,onChange:e,readOnly:t}){return d.jsx(W7,{height:"100%",language:"plaintext",theme:"vs-dark",value:i,onChange:n=>e(n??""),options:{readOnly:t,minimap:{enabled:!1},lineNumbers:"off",wordWrap:"on",fontSize:13,padding:{top:12},scrollBeyondLastLine:!1,renderWhitespace:"boundary"}})}function $lt({setter:i,onChange:e,onRemove:t,readOnly:n}){const{t:s}=xe(),[r,o]=L.useState(!0);return d.jsxs("div",{className:"rounded-xl border border-border bg-card shadow-sm","data-testid":"setter-editor",children:[d.jsxs("div",{className:"flex items-center gap-2 p-3",children:[d.jsx("button",{type:"button",onClick:()=>o(!r),className:"rounded p-0.5 text-muted-foreground hover:text-foreground transition-colors","aria-expanded":r,"aria-label":s("propertySetterEditor.toggleGroup","Toggle property group"),children:r?d.jsx(Rn,{className:"h-4 w-4","aria-hidden":"true"}):d.jsx(hs,{className:"h-4 w-4","aria-hidden":"true"})}),d.jsx("span",{className:"text-sm font-medium text-foreground",children:i.actions.length>0?i.actions.join(", "):s("propertySetterEditor.untitled","(no actions)")}),d.jsx("span",{className:"flex-1"}),d.jsxs("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:[i.setProperties.length," ",s("propertySetterEditor.propsCount","props")]}),!n&&d.jsx("button",{type:"button",onClick:t,className:"rounded p-1.5 text-muted-foreground hover:text-destructive transition-colors","aria-label":s("propertySetterEditor.removeSetter","Remove"),children:d.jsx(_n,{className:"h-4 w-4"})})]}),r&&d.jsxs("div",{className:"space-y-3 border-t px-4 py-3",children:[d.jsxs("div",{children:[d.jsx("h5",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:s("propertySetterEditor.triggerActions","Trigger Actions")}),d.jsx(Wlt,{actions:i.actions,onChange:a=>e({...i,actions:a}),readOnly:n})]}),d.jsxs("div",{children:[d.jsx("h5",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:s("propertySetterEditor.properties","Properties")}),d.jsxs("div",{className:"space-y-1.5",children:[i.setProperties.length===0&&d.jsx("p",{className:"text-xs italic text-muted-foreground",children:s("propertySetterEditor.noProperties","No properties")}),i.setProperties.map((a,l)=>d.jsx(Vlt,{prop:a,onChange:c=>{const u=[...i.setProperties];u[l]=c,e({...i,setProperties:u})},onRemove:()=>e({...i,setProperties:i.setProperties.filter((c,u)=>u!==l)}),readOnly:n},l)),!n&&d.jsxs("button",{type:"button",onClick:()=>e({...i,setProperties:[...i.setProperties,{name:"",valueString:"",scope:"conversation",override:!0}]}),className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),s("propertySetterEditor.addProperty","Add Property")]})]})]})]})]})}function qlt({data:i,onChange:e,readOnly:t}){const{t:n}=xe(),s=L.useCallback(()=>{const r={actions:[],setProperties:[{name:"",valueString:"",scope:"conversation",override:!0}]};e({...i,setOnActions:[...i.setOnActions??[],r]})},[i,e]);return d.jsx("div",{className:"space-y-6","data-testid":"propertysetter-editor",children:d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[d.jsx(xp,{className:"h-4 w-4 text-primary"}),n("propertySetterEditor.setters","Property Setters")]}),!t&&d.jsxs("button",{type:"button",onClick:s,className:"inline-flex items-center gap-1.5 rounded-lg border border-dashed border-muted-foreground/40 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:border-primary hover:text-primary","data-testid":"add-setter-btn",children:[d.jsx(Gt,{className:"h-3.5 w-3.5"}),n("propertySetterEditor.addSetter","Add Setter")]})]}),(i.setOnActions??[]).length===0&&d.jsx("div",{className:"rounded-lg border border-dashed py-8 text-center text-sm text-muted-foreground",children:n("propertySetterEditor.noSetters","No property setters configured")}),(i.setOnActions??[]).map((r,o)=>d.jsx($lt,{setter:r,onChange:a=>{const l=[...i.setOnActions??[]];l[o]=a,e({...i,setOnActions:l})},onRemove:()=>e({...i,setOnActions:(i.setOnActions??[]).filter((a,l)=>l!==o)}),readOnly:t},o))]})})}function Klt({word:i,onChange:e,onRemove:t,readOnly:n}){const{t:s}=xe();return d.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"word-row",children:[d.jsx("input",{type:"text",value:i.word,onChange:r=>e({...i,word:r.target.value}),readOnly:n,placeholder:s("dictionaryEditor.wordPlaceholder","e.g. hello"),className:"h-7 w-32 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"→"}),d.jsx("input",{type:"text",value:i.expressions,onChange:r=>e({...i,expressions:r.target.value}),readOnly:n,placeholder:s("dictionaryEditor.expressionPlaceholder","e.g. greeting(hello)"),className:"h-7 flex-1 rounded border border-input bg-background px-2 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("input",{type:"number",value:i.frequency,onChange:r=>e({...i,frequency:parseInt(r.target.value,10)||0}),readOnly:n,title:s("dictionaryEditor.frequency","Frequency"),className:"h-7 w-14 rounded border border-input bg-background px-2 text-xs text-center text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),!n&&d.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(_n,{className:"h-3 w-3"})})]})}function Glt({phrase:i,onChange:e,onRemove:t,readOnly:n}){const{t:s}=xe();return d.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"phrase-row",children:[d.jsx("input",{type:"text",value:i.phrase,onChange:r=>e({...i,phrase:r.target.value}),readOnly:n,placeholder:s("dictionaryEditor.phrasePlaceholder","e.g. good morning"),className:"h-7 w-40 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"→"}),d.jsx("input",{type:"text",value:i.expressions,onChange:r=>e({...i,expressions:r.target.value}),readOnly:n,placeholder:s("dictionaryEditor.expressionPlaceholder","e.g. greeting(hello)"),className:"h-7 flex-1 rounded border border-input bg-background px-2 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),!n&&d.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(_n,{className:"h-3 w-3"})})]})}function Ylt({regex:i,onChange:e,onRemove:t,readOnly:n}){const{t:s}=xe();return d.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"regex-row",children:[d.jsx("input",{type:"text",value:i.regEx,onChange:r=>e({...i,regEx:r.target.value}),readOnly:n,placeholder:s("dictionaryEditor.regexPlaceholder","Regular expression"),className:"h-7 w-48 rounded border border-input bg-background px-2 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"→"}),d.jsx("input",{type:"text",value:i.expressions,onChange:r=>e({...i,expressions:r.target.value}),readOnly:n,placeholder:s("dictionaryEditor.expressionPlaceholder","e.g. greeting(hello)"),className:"h-7 flex-1 rounded border border-input bg-background px-2 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),!n&&d.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(_n,{className:"h-3 w-3"})})]})}function HU({title:i,count:e,children:t,onAdd:n,addLabel:s,readOnly:r}){const{t:o}=xe();return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsxs("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[i,d.jsx("span",{className:"ms-1.5 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium",children:e})]}),!r&&d.jsxs("button",{type:"button",onClick:n,className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors","data-testid":`add-${i.toLowerCase()}-btn`,children:[d.jsx(Gt,{className:"h-3 w-3"}),s]})]}),e===0?d.jsx("p",{className:"text-xs italic text-muted-foreground py-2",children:o("dictionaryEditor.none","None defined")}):d.jsx("div",{className:"space-y-1.5",children:t})]})}function Qlt({data:i,onChange:e,readOnly:t}){const{t:n}=xe();i=i??{};const s=L.useCallback(()=>{e({...i,words:[...i.words??[],{word:"",expressions:"",frequency:0}]})},[i,e]),r=L.useCallback(()=>{e({...i,phrases:[...i.phrases??[],{phrase:"",expressions:""}]})},[i,e]),o=L.useCallback(()=>{e({...i,regExs:[...i.regExs??[],{regEx:"",expressions:""}]})},[i,e]);return d.jsxs("div",{className:"space-y-6","data-testid":"dictionary-editor",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("label",{className:"text-sm font-medium text-foreground",children:[d.jsx(Lw,{className:"me-1.5 inline h-4 w-4 text-primary"}),n("dictionaryEditor.language","Language")]}),d.jsx("input",{type:"text",value:i.lang??"",onChange:a=>e({...i,lang:a.target.value}),readOnly:t,placeholder:n("dictionaryEditor.langPlaceholder","e.g. en, de"),className:"h-8 w-24 rounded-md border border-input bg-background px-3 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsx(HU,{title:n("dictionaryEditor.words","Words"),count:(i.words??[]).length,onAdd:s,addLabel:n("dictionaryEditor.addWord","Add Word"),readOnly:t,children:(i.words??[]).map((a,l)=>d.jsx(Klt,{word:a,onChange:c=>{const u=[...i.words??[]];u[l]=c,e({...i,words:u})},onRemove:()=>e({...i,words:(i.words??[]).filter((c,u)=>u!==l)}),readOnly:t},l))}),d.jsx(HU,{title:n("dictionaryEditor.phrases","Phrases"),count:(i.phrases??[]).length,onAdd:r,addLabel:n("dictionaryEditor.addPhrase","Add Phrase"),readOnly:t,children:(i.phrases??[]).map((a,l)=>d.jsx(Glt,{phrase:a,onChange:c=>{const u=[...i.phrases??[]];u[l]=c,e({...i,phrases:u})},onRemove:()=>e({...i,phrases:(i.phrases??[]).filter((c,u)=>u!==l)}),readOnly:t},l))}),d.jsx(HU,{title:n("dictionaryEditor.regExs","Regular Expressions"),count:(i.regExs??[]).length,onAdd:o,addLabel:n("dictionaryEditor.addRegEx","Add RegEx"),readOnly:t,children:(i.regExs??[]).map((a,l)=>d.jsx(Ylt,{regex:a,onChange:c=>{const u=[...i.regExs??[]];u[l]=c,e({...i,regExs:u})},onRemove:()=>e({...i,regExs:(i.regExs??[]).filter((c,u)=>u!==l)}),readOnly:t},l))})]})}async function Xlt(i,e="http",t=""){const n=new URLSearchParams({url:i,transport:e});return t&&n.set("apiKey",t),Oe.get(`/mcpcallsstore/mcpcalls/discover-tools?${n}`)}function GG({label:i,tags:e,onChange:t,readOnly:n,placeholder:s,testId:r}){const[o,a]=L.useState(""),l=()=>{const c=o.trim();c&&!e.includes(c)&&(t([...e,c]),a(""))};return d.jsxs("div",{className:"space-y-1.5","data-testid":r,children:[d.jsx("label",{className:"block text-xs font-medium text-muted-foreground",children:i}),d.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.map((c,u)=>d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:[c,!n&&d.jsx("button",{type:"button",onClick:()=>t(e.filter((h,g)=>g!==u)),className:"rounded p-0.5 hover:bg-primary/20 transition-colors","aria-label":`Remove ${c}`,children:d.jsx(An,{className:"h-3 w-3"})})]},u)),e.length===0&&d.jsx("span",{className:"text-xs text-muted-foreground italic",children:"—"})]}),!n&&d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("input",{type:"text",value:o,onChange:c=>a(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),l())},placeholder:s,className:"h-8 flex-1 rounded-md border border-input bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("button",{type:"button",onClick:l,className:"inline-flex h-8 items-center gap-1 rounded-md border border-input px-2 text-xs font-medium text-foreground transition-colors hover:bg-secondary",children:d.jsx(Gt,{className:"h-3 w-3"})})]})]})}function Zlt({forceOpen:i,defaultOpen:e=!0,...t}){const[n,s]=L.useState(!1);return L.useEffect(()=>{i&&s(!0)},[i]),d.jsx(ls,{defaultOpen:n||e,...t})}function Jlt({tools:i,whitelist:e,blacklist:t,onAddWhitelist:n,onAddBlacklist:s,readOnly:r}){const{t:o}=xe();return d.jsxs("div",{className:"space-y-1.5 rounded-lg border border-border bg-card/50 p-3","data-testid":"discovered-tools-panel",children:[d.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[o("mcpcallsEditor.discoveredTools","Available Tools")," (",i.length,")"]}),d.jsx("div",{className:"grid gap-1.5",children:i.map(a=>{const l=e.includes(a.name),c=t.includes(a.name);return d.jsxs("div",{className:"group flex items-start gap-2 rounded-md border border-border/50 bg-background px-2.5 py-1.5 transition-colors hover:border-border","data-testid":"discovered-tool-item",children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"font-mono text-xs font-semibold text-foreground",children:a.name}),a.description&&d.jsx("p",{className:"text-[10px] text-muted-foreground leading-tight mt-0.5",children:a.description})]}),!r&&d.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[l?d.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[10px] font-medium text-emerald-600 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950/50",children:[d.jsx(Ns,{className:"h-2.5 w-2.5"}),o("mcpcallsEditor.whitelisted","Whitelisted")]}):d.jsxs("button",{type:"button",onClick:()=>n(a.name),className:"inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[10px] font-medium text-emerald-600 hover:bg-emerald-50 dark:text-emerald-400 dark:hover:bg-emerald-950/50 transition-colors",title:o("mcpcallsEditor.addToWhitelist","Add to whitelist"),children:[d.jsx(j7e,{className:"h-3 w-3"}),o("mcpcallsEditor.addWhitelist","Whitelist")]}),c?d.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[10px] font-medium text-red-600 bg-red-50 dark:text-red-400 dark:bg-red-950/50",children:[d.jsx(Ns,{className:"h-2.5 w-2.5"}),o("mcpcallsEditor.blacklisted","Blacklisted")]}):d.jsxs("button",{type:"button",onClick:()=>s(a.name),className:"inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[10px] font-medium text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/50 transition-colors",title:o("mcpcallsEditor.addToBlacklist","Add to blacklist"),children:[d.jsx(P7e,{className:"h-3 w-3"}),o("mcpcallsEditor.addBlacklist","Blacklist")]})]})]},a.name)})})]})}function ect({call:i,onChange:e,onRemove:t,readOnly:n}){const{t:s}=xe(),[r,o]=L.useState(!0);return d.jsxs("div",{className:"rounded-xl border border-border bg-card shadow-sm","data-testid":"mcp-call-editor",children:[d.jsxs("div",{className:"flex items-center gap-2 p-3",children:[d.jsx("button",{type:"button",onClick:()=>o(!r),className:"rounded p-0.5 text-muted-foreground hover:text-foreground transition-colors",children:r?d.jsx(Rn,{className:"h-4 w-4"}):d.jsx(hs,{className:"h-4 w-4"})}),d.jsx(nc,{className:"h-4 w-4 text-amber-500"}),d.jsx("input",{type:"text",value:i.name??"",onChange:a=>e({...i,name:a.target.value}),readOnly:n,placeholder:s("mcpcallsEditor.callName","Call name"),className:"h-8 w-40 rounded-md border border-input bg-background px-2 text-xs font-semibold text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsxs("span",{className:"flex-1 truncate font-mono text-xs text-muted-foreground",children:["→ ",i.toolName||"…"]}),!n&&d.jsx("button",{type:"button",onClick:t,className:"rounded p-1.5 text-muted-foreground hover:text-destructive transition-colors","aria-label":s("mcpcallsEditor.removeCall","Remove Call"),children:d.jsx(_n,{className:"h-4 w-4"})})]}),r&&d.jsxs("div",{className:"space-y-3 border-t px-4 py-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:s("mcpcallsEditor.toolName","Tool Name")}),d.jsx("input",{type:"text",value:i.toolName??"",onChange:a=>e({...i,toolName:a.target.value}),readOnly:n,placeholder:"e.g. search_documents",className:"h-8 w-full rounded-md border border-input bg-background px-3 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"tool-name-input"})]}),d.jsx(GG,{label:s("mcpcallsEditor.triggerActions","Trigger Actions"),tags:i.actions??[],onChange:a=>e({...i,actions:a}),readOnly:n,placeholder:"e.g. search, lookup",testId:"call-actions"}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:s("mcpcallsEditor.toolArguments","Tool Arguments")}),d.jsx("div",{className:"space-y-1.5",children:Object.entries(i.toolArguments??{}).map(([a,l])=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("input",{type:"text",value:a,readOnly:!0,className:"h-7 w-28 rounded border border-input bg-muted px-2 text-xs text-foreground"}),d.jsx("input",{type:"text",value:String(l??""),onChange:c=>e({...i,toolArguments:{...i.toolArguments,[a]:c.target.value}}),readOnly:n,placeholder:"{{memory.input}}",className:"h-7 flex-1 rounded border border-input bg-background px-2 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),!n&&d.jsx("button",{type:"button",onClick:()=>{const c={...i.toolArguments};delete c[a],e({...i,toolArguments:c})},className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]},a))}),!n&&d.jsxs("button",{type:"button",onClick:()=>{const a=Object.keys(i.toolArguments??{}).length;e({...i,toolArguments:{...i.toolArguments,[`arg${a}`]:""}})},className:"mt-1 inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),s("mcpcallsEditor.addArgument","Add Argument")]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.saveResponse??!1,onChange:a=>e({...i,saveResponse:a.target.checked}),disabled:n,className:"h-3.5 w-3.5 rounded border-input accent-primary"}),s("mcpcallsEditor.saveResponse","Save Response")]}),i.saveResponse&&d.jsx("input",{type:"text",value:i.responseObjectName??"",onChange:a=>e({...i,responseObjectName:a.target.value}),readOnly:n,placeholder:s("mcpcallsEditor.responseObjectName","Response object name"),className:"h-7 rounded border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]})]})}function tct({data:i,onChange:e,readOnly:t}){var v,_,w,k;const{t:n}=xe(),[s,r]=L.useState([]),[o,a]=L.useState(!1),[l,c]=L.useState(null),[u,h]=L.useState(!1),g=L.useCallback(C=>e({...i,...C}),[i,e]),f=L.useCallback(async()=>{var C;if((C=i.mcpServerUrl)!=null&&C.trim()){a(!0),c(null),r([]);try{const E=await Xlt(i.mcpServerUrl,i.transport??"http",i.apiKey??"");r(E.tools),h(!0)}catch(E){const D=E&&typeof E=="object"&&"message"in E?String(E.message):n("mcpcallsEditor.discoveryError","Could not connect to MCP server");c(D),h(!0)}finally{a(!1)}}},[i.mcpServerUrl,i.transport,i.apiKey,n]),m=L.useCallback(C=>{const E=i.toolsWhitelist??[];E.includes(C)||g({toolsWhitelist:[...E,C]})},[i.toolsWhitelist,g]),x=L.useCallback(C=>{const E=i.toolsBlacklist??[];E.includes(C)||g({toolsBlacklist:[...E,C]})},[i.toolsBlacklist,g]);return d.jsxs("div",{className:"space-y-6","data-testid":"mcpcalls-form-editor",children:[d.jsx(ls,{label:n("mcpcallsEditor.serverConnection","Server Connection"),icon:PM,children:d.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[d.jsxs("div",{className:"sm:col-span-2",children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:n("mcpcallsEditor.displayName","Display Name")}),d.jsx("input",{type:"text",value:i.name??"",onChange:C=>g({name:C.target.value}),readOnly:t,placeholder:"e.g. My MCP Server",className:"h-8 w-full rounded-md border border-input bg-background px-3 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"mcp-name-input"})]}),d.jsxs("div",{className:"sm:col-span-2",children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:n("mcpcallsEditor.serverUrl","MCP Server URL")}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"url",value:i.mcpServerUrl??"",onChange:C=>g({mcpServerUrl:C.target.value}),readOnly:t,placeholder:"http://localhost:7070/mcp",className:"h-8 flex-1 rounded-md border border-input bg-background px-3 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"mcp-url-input"}),!t&&d.jsxs("button",{type:"button",onClick:f,disabled:o||!((v=i.mcpServerUrl)!=null&&v.trim()),className:"inline-flex h-8 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed","data-testid":"discover-tools-btn",children:[o?d.jsx(ni,{className:"h-3.5 w-3.5 animate-spin"}):d.jsx(br,{className:"h-3.5 w-3.5"}),o?n("mcpcallsEditor.discovering","Connecting…"):n("mcpcallsEditor.discoverTools","Discover Tools")]})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:n("mcpcallsEditor.transport","Transport")}),d.jsxs("select",{value:i.transport??"http",onChange:C=>g({transport:C.target.value}),disabled:t,className:"h-8 w-full rounded-md border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60","data-testid":"mcp-transport-select",children:[d.jsx("option",{value:"http",children:"HTTP"}),d.jsx("option",{value:"sse",children:"SSE"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:n("mcpcallsEditor.timeoutMs","Timeout (ms)")}),d.jsx("input",{type:"number",value:i.timeoutMs??3e4,onChange:C=>g({timeoutMs:parseInt(C.target.value,10)||3e4}),readOnly:t,className:"h-8 w-full rounded-md border border-input bg-background px-3 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{className:"sm:col-span-2",children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:n("mcpcallsEditor.apiKey","API Key / Vault Reference")}),d.jsx(Rd,{value:i.apiKey??"",onChange:C=>g({apiKey:C}),readOnly:t,placeholder:"${vault:my-mcp-key}",testId:"mcp-apikey-input"})]})]})}),d.jsxs(Zlt,{label:n("mcpcallsEditor.toolGovernance","Tool Governance"),icon:bh,defaultOpen:(((_=i.toolsWhitelist)==null?void 0:_.length)??0)>0||(((w=i.toolsBlacklist)==null?void 0:w.length)??0)>0,forceOpen:u,children:[d.jsx("p",{className:"text-[10px] text-muted-foreground -mt-1 mb-2",children:n("mcpcallsEditor.governanceHint","Control which tools are exposed. Whitelist = only these; Blacklist = exclude these.")}),o&&d.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-card/50 px-3 py-4 text-xs text-muted-foreground","data-testid":"discovery-loading",children:[d.jsx(ni,{className:"h-4 w-4 animate-spin text-primary"}),n("mcpcallsEditor.discovering","Connecting…")]}),l&&d.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-3","data-testid":"discovery-error",children:[d.jsx(Lo,{className:"h-4 w-4 shrink-0 text-destructive"}),d.jsx("p",{className:"flex-1 text-xs text-destructive",children:l}),d.jsxs("button",{type:"button",onClick:f,className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs font-medium text-destructive hover:bg-destructive/10 transition-colors",children:[d.jsx(xi,{className:"h-3 w-3"}),n("mcpcallsEditor.retry","Retry")]})]}),!o&&u&&!l&&s.length===0&&d.jsx("div",{className:"rounded-lg border border-border bg-card/50 px-3 py-4 text-center text-xs text-muted-foreground","data-testid":"discovery-empty",children:n("mcpcallsEditor.noToolsFound","No tools found on this server")}),s.length>0&&d.jsx(Jlt,{tools:s,whitelist:i.toolsWhitelist??[],blacklist:i.toolsBlacklist??[],onAddWhitelist:m,onAddBlacklist:x,readOnly:t}),d.jsx(GG,{label:n("mcpcallsEditor.whitelist","Whitelist (only allow)"),tags:i.toolsWhitelist??[],onChange:C=>g({toolsWhitelist:C}),readOnly:t,placeholder:"tool_name",testId:"tools-whitelist"}),d.jsx(GG,{label:n("mcpcallsEditor.blacklist","Blacklist (exclude)"),tags:i.toolsBlacklist??[],onChange:C=>g({toolsBlacklist:C}),readOnly:t,placeholder:"tool_name",testId:"tools-blacklist"})]}),d.jsxs(ls,{label:n("mcpcallsEditor.pipelineCalls","Pipeline Calls"),icon:nc,defaultOpen:(((k=i.mcpCalls)==null?void 0:k.length)??0)>0,children:[d.jsx("p",{className:"text-[10px] text-muted-foreground -mt-1 mb-2",children:n("mcpcallsEditor.pipelineHint","Deterministic, action-triggered tool calls (pipeline mode).")}),d.jsxs("div",{className:"space-y-3",children:[(i.mcpCalls??[]).map((C,E)=>d.jsx(ect,{call:C,onChange:D=>{const T=[...i.mcpCalls??[]];T[E]=D,g({mcpCalls:T})},onRemove:()=>g({mcpCalls:(i.mcpCalls??[]).filter((D,T)=>T!==E)}),readOnly:t},E)),!t&&d.jsxs("button",{type:"button",onClick:()=>g({mcpCalls:[...i.mcpCalls??[],{name:"",toolName:"",actions:[],toolArguments:{},saveResponse:!0}]}),className:"inline-flex items-center gap-1.5 rounded-lg border border-dashed border-border px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:border-primary/50 transition-colors","data-testid":"add-mcp-call",children:[d.jsx(Gt,{className:"h-3.5 w-3.5"}),n("mcpcallsEditor.addCall","Add MCP Call")]})]})]})]})}const Bj=i=>i.startsWith("${vault:")||i.startsWith("${eddivault:"),bme=[{value:"openai",label:"OpenAI",hint:"text-embedding-3-small"},{value:"azure-openai",label:"Azure OpenAI",hint:"text-embedding-3-small"},{value:"ollama",label:"Ollama",hint:"nomic-embed-text"},{value:"mistral",label:"Mistral AI",hint:"mistral-embed"},{value:"bedrock",label:"Amazon Bedrock",hint:"amazon.titan-embed-text-v2:0"},{value:"cohere",label:"Cohere",hint:"embed-english-v3.0"},{value:"vertex",label:"Google Vertex AI",hint:"text-embedding-005"},{value:"gemini",label:"Google AI",hint:"gemini-embedding-2"}],xme={openai:[{key:"model",placeholder:"text-embedding-3-small"},{key:"apiKey",placeholder:"${vault:openai-key}"}],"azure-openai":[{key:"endpoint",placeholder:"https://my.openai.azure.com/"},{key:"apiKey",placeholder:"${vault:azure-key}"},{key:"deploymentName",placeholder:"text-embedding-3-small"}],ollama:[{key:"model",placeholder:"nomic-embed-text"},{key:"baseUrl",placeholder:"http://localhost:11434"}],mistral:[{key:"model",placeholder:"mistral-embed"},{key:"apiKey",placeholder:"${vault:mistral-key}"}],bedrock:[{key:"model",placeholder:"amazon.titan-embed-text-v2:0"},{key:"region",placeholder:"us-east-1"}],cohere:[{key:"model",placeholder:"embed-english-v3.0"},{key:"apiKey",placeholder:"${vault:cohere-key}"}],vertex:[{key:"project",placeholder:"my-gcp-project"},{key:"location",placeholder:"us-central1"},{key:"model",placeholder:"text-embedding-005"}],gemini:[{key:"apiKey",placeholder:"${eddivault:gemini-key}"},{key:"model",placeholder:"gemini-embedding-2"},{key:"taskType",placeholder:"RETRIEVAL_DOCUMENT"},{key:"outputDimensionality",placeholder:"3072"}]},vme=[{value:"in-memory",label:"In-Memory",hint:"Dev/test only — data lost on restart"},{value:"pgvector",label:"PostgreSQL (pgvector)",hint:"Production — persistent vector store"},{value:"mongodb-atlas",label:"MongoDB Atlas",hint:"Atlas vector search"},{value:"elasticsearch",label:"Elasticsearch",hint:"Elasticsearch vector search"},{value:"qdrant",label:"Qdrant",hint:"High-performance vector DB"},{value:"chroma",label:"Chroma",hint:"Fast, serverless, and scalable infrastructure supporting vector, full-text, regex, and metadata search."}],_me={"in-memory":[],pgvector:[{key:"host",placeholder:"localhost"},{key:"port",placeholder:"5432"},{key:"database",placeholder:"eddi"},{key:"table",placeholder:"embeddings"},{key:"dimension",placeholder:"1536"},{key:"user",placeholder:"${vault:pg-user}"},{key:"password",placeholder:"${vault:pg-password}"}],"mongodb-atlas":[{key:"connectionString",placeholder:"${vault:mongo-uri}"},{key:"databaseName",placeholder:"eddi"},{key:"collectionName",placeholder:"eddi_kb_product-docs"},{key:"indexName",placeholder:"vector_index"}],elasticsearch:[{key:"serverUrl",placeholder:"http://localhost:9200"},{key:"indexName",placeholder:"eddi_kb_product-docs"},{key:"apiKey",placeholder:"${vault:es-key}"},{key:"userName",placeholder:"elastic"},{key:"password",placeholder:"${vault:es-password}"}],qdrant:[{key:"host",placeholder:"localhost"},{key:"port",placeholder:"6334"},{key:"collectionName",placeholder:"kb-product-docs"},{key:"apiKey",placeholder:"${vault:qdrant-key}"},{key:"useTls",placeholder:"false"}],chroma:[{key:"baseUrl",placeholder:"http://localhost:8000"},{key:"collectionName",placeholder:"kb-product-docs"},{key:"tenantName",placeholder:"default_tenant"},{key:"databaseName",placeholder:"default_database"}]},nct=[{value:"recursive",label:"Recursive (recommended)"},{value:"paragraph",label:"Paragraph"},{value:"sentence",label:"Sentence"}];function PS({label:i,icon:e,accent:t,defaultOpen:n=!0,badge:s,children:r}){const[o,a]=L.useState(n);return d.jsxs("div",{className:"rounded-lg border border-border bg-card/50 overflow-hidden",children:[d.jsxs("button",{type:"button",onClick:()=>a(!o),"aria-expanded":o,className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-start transition-colors hover:bg-muted/30",children:[d.jsx(e,{className:be("h-4 w-4 shrink-0",t)}),d.jsx("span",{className:"flex-1 text-xs font-semibold uppercase tracking-wider text-foreground/80",children:i}),s&&d.jsx("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary",children:s}),d.jsx(Rn,{className:be("h-3.5 w-3.5 text-muted-foreground transition-transform",o&&"rotate-180")})]}),o&&d.jsx("div",{className:"border-t border-border px-4 py-3",children:r})]})}const ict=new Set(["apikey","password","secret","token"]);function sct(i){return ict.has(i.toLowerCase())}function yme({entries:i,onChange:e,readOnly:t,hints:n,label:s,testIdPrefix:r="kv"}){const{t:o}=xe(),a=Object.entries(i),l=()=>{const f=new Set(Object.keys(i)),m=n==null?void 0:n.find(v=>!f.has(v.key)),x=(m==null?void 0:m.key)??`param${a.length+1}`;e({...i,[x]:""})},c=f=>{const m={...i};delete m[f],e(m)},u=(f,m)=>{var v;const x=Object.entries(i);x.some(([_],w)=>w!==m&&_===f)||(x[m]=[f,((v=x[m])==null?void 0:v[1])??""],e(Object.fromEntries(x)))},h=(f,m)=>{e({...i,[f]:m})},g=Bj;return d.jsxs("div",{className:"space-y-1.5",children:[s&&d.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:s}),a.map(([f,m],x)=>{const v=n==null?void 0:n.find(_=>_.key===f);return d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("input",{type:"text",value:f,onChange:_=>u(_.target.value,x),readOnly:t,placeholder:"key",className:"h-7 w-32 rounded border border-input bg-background px-2 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("span",{className:"text-muted-foreground/40",children:"="}),sct(f)?d.jsx("div",{className:"flex-1",children:d.jsx(Rd,{value:m,onChange:_=>h(f,_),readOnly:t,placeholder:(v==null?void 0:v.placeholder)||"${vault:...}",testId:`${r}-${f}`})}):d.jsxs("div",{className:"relative flex-1",children:[d.jsx("input",{type:"text",value:m,onChange:_=>h(f,_.target.value),readOnly:t,placeholder:(v==null?void 0:v.placeholder)||"value",className:be("h-7 w-full rounded border border-input bg-background px-2 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",g(m)&&"pe-7")}),g(m)&&d.jsx(d7,{className:"absolute inset-e-2 top-1.5 h-3.5 w-3.5 text-amber-500"})]}),!t&&d.jsx("button",{type:"button",onClick:()=>c(f),className:"rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(An,{className:"h-3 w-3"})})]},x)}),!t&&n&&n.some(f=>!(f.key in i))&&d.jsx("div",{className:"flex flex-wrap gap-1 pt-1",children:n.filter(f=>!(f.key in i)).map(f=>d.jsxs("button",{type:"button",onClick:()=>e({...i,[f.key]:Bj(f.placeholder)?f.placeholder:""}),className:"rounded-full border border-dashed border-muted-foreground/30 px-2 py-0.5 text-[10px] text-muted-foreground hover:border-primary hover:text-primary transition-colors",children:["+ ",f.key]},f.key))}),!t&&d.jsxs("button",{type:"button",onClick:l,className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(Gt,{className:"h-3 w-3"}),o("ragEditor.addParam","Add Parameter")]})]})}function rct({kbId:i,version:e,readOnly:t}){const{t:n}=xe(),[s,r]=L.useState([]),[o,a]=L.useState(""),[l,c]=L.useState(!1),u=L.useRef(!0);L.useEffect(()=>()=>{u.current=!1},[]);const h=L.useCallback(x=>{let v=0;const _=30,w=async()=>{if(u.current){v++;try{const k=await Oe.get(`/ragstore/rags/${i}/ingestion/${x}/status`);if(!u.current)return;r(C=>C.map(E=>E.ingestionId===x?{...E,status:k.status}:E)),(k.status==="processing"||k.status==="pending")&&v<_?setTimeout(w,2e3):v>=_&&r(C=>C.map(E=>E.ingestionId===x?{...E,status:"failed: timeout"}:E))}catch{if(!u.current)return;r(k=>k.map(C=>C.ingestionId===x?{...C,status:"failed: polling error"}:C))}}};w()},[i]),g=L.useCallback(async(x,v)=>{const _=`local-${Date.now()}`;r(w=>[...w,{ingestionId:_,status:"uploading",documentName:v}]);try{const w=new URLSearchParams({version:String(e),documentName:v}),k=await fetch(`${Oe.getBaseUrl()}/ragstore/rags/${i}/ingest?${w.toString()}`,{method:"POST",headers:{"Content-Type":"text/plain",...Oe.getAuthHeader()},body:x});if(!k.ok)throw new Error(`HTTP ${k.status}`);const E=(await k.json()).ingestionId;r(D=>D.map(T=>T.ingestionId===_?{...T,ingestionId:E,status:"processing"}:T)),h(E)}catch{r(w=>w.map(k=>k.ingestionId===_?{...k,status:"failed: upload error"}:k))}},[i,e,h]),f=L.useCallback(x=>{Array.from(x).forEach(v=>{const _=new FileReader;_.onload=()=>{const w=_.result;g(w,v.name)},_.onerror=()=>{r(w=>[...w,{ingestionId:`err-${Date.now()}`,status:`failed: could not read ${v.name}`,documentName:v.name}])},_.readAsText(v)})},[g]),m=L.useCallback(()=>{o.trim()&&(g(o,`text-${Date.now()}.txt`),a(""))},[o,g]);return t?null:d.jsxs("div",{className:"space-y-3","data-testid":"ingestion-panel",children:[d.jsxs("div",{onDragOver:x=>{x.preventDefault(),c(!0)},onDragLeave:()=>c(!1),onDrop:x=>{x.preventDefault(),c(!1),x.dataTransfer.files.length&&f(x.dataTransfer.files)},className:be("rounded-lg border-2 border-dashed p-4 text-center transition-colors",l?"border-primary bg-primary/5":"border-muted-foreground/20 hover:border-muted-foreground/40"),children:[d.jsx(qv,{className:"mx-auto h-6 w-6 text-muted-foreground/50 mb-1.5"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:n("ragEditor.dropFiles","Drop documents here to ingest")}),d.jsx("p",{className:"text-[10px] text-muted-foreground/60 mt-0.5",children:n("ragEditor.dropHint","Text, Markdown, or any text-based file")}),d.jsxs("label",{className:"mt-2 inline-flex cursor-pointer items-center gap-1 rounded-md border border-input px-3 py-1.5 text-xs font-medium text-foreground hover:bg-muted/50 transition-colors",children:[d.jsx(IL,{className:"h-3 w-3"}),n("ragEditor.browse","Browse"),d.jsx("input",{type:"file",multiple:!0,accept:".txt,.md,.csv,.json,.xml,.html",className:"hidden",onChange:x=>x.target.files&&f(x.target.files)})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("ragEditor.pasteText","Or paste text content")}),d.jsx("textarea",{value:o,onChange:x=>a(x.target.value),placeholder:n("ragEditor.pastePlaceholder","Paste document text here..."),rows:3,className:"w-full rounded-md border border-input bg-background px-3 py-2 text-xs text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-ring resize-y"}),o.trim()&&d.jsxs("button",{type:"button",onClick:m,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 transition-colors",children:[d.jsx(qv,{className:"h-3 w-3"}),n("ragEditor.ingestText","Ingest Text"),d.jsxs("span",{className:"text-[10px] opacity-70",children:["(",o.length.toLocaleString()," chars)"]})]})]}),s.length>0&&d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("ragEditor.ingestionHistory","Ingestion Status")}),s.map(x=>d.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2",children:[x.status==="completed"?d.jsx(Xl,{className:"h-3.5 w-3.5 shrink-0 text-emerald-500"}):x.status.startsWith("failed")?d.jsx(Lo,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):d.jsx(ni,{className:"h-3.5 w-3.5 shrink-0 text-primary animate-spin"}),d.jsx("span",{className:"flex-1 truncate text-xs text-foreground",children:x.documentName}),d.jsx("span",{className:be("text-[10px] font-medium",x.status==="completed"?"text-emerald-500":x.status.startsWith("failed")?"text-destructive":"text-primary"),children:x.status})]},x.ingestionId))]})]})}function oct({data:i,onChange:e,readOnly:t,resourceId:n,version:s=1}){const{t:r}=xe(),o=L.useRef({}),a=L.useRef({}),l=bme.find(m=>m.value===i.embeddingProvider),c=vme.find(m=>m.value===i.storeType),u=_me[i.storeType??"in-memory"]??[],h=xme[i.embeddingProvider??"openai"]??[],g=Math.min(6,Math.ceil(2048/(i.chunkSize??512))),f=L.useMemo(()=>Array.from({length:6},(m,x)=>16+(x*7+3)%13),[]);return d.jsxs("div",{className:"space-y-4","data-testid":"rag-editor",children:[d.jsx(PS,{label:r("ragEditor.general","General"),icon:C_,accent:"text-emerald-500",children:d.jsx("div",{className:"space-y-3",children:d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("ragEditor.kbName","Knowledge Base Name")}),d.jsx("input",{type:"text",value:i.name??"",onChange:m=>e({...i,name:m.target.value||void 0}),readOnly:t,placeholder:r("ragEditor.kbNamePlaceholder","e.g. product-docs, faq, internal-wiki"),className:"h-8 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"kb-name"}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:r("ragEditor.kbNameHint","Used to reference this KB from LLM tasks")})]})})}),d.jsx(PS,{label:r("ragEditor.embeddingModel","Embedding Model"),icon:Uf,accent:"text-blue-500",badge:l==null?void 0:l.label,children:d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("ragEditor.provider","Provider")}),d.jsx("select",{value:i.embeddingProvider??"openai",onChange:m=>{const x=m.target.value;i.embeddingProvider&&i.embeddingParameters&&(a.current[i.embeddingProvider]={...i.embeddingParameters});const v=a.current[x],_=xme[x]??[],w=v??Object.fromEntries(_.map(k=>[k.key,Bj(k.placeholder)?k.placeholder:""]));e({...i,embeddingProvider:x,embeddingParameters:Object.keys(w).length>0?w:void 0})},disabled:t,className:"h-8 w-full rounded-md border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60","data-testid":"embedding-provider",children:bme.map(m=>d.jsxs("option",{value:m.value,children:[m.label," — ",m.hint]},m.value))})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(rb,{className:"h-3 w-3"}),r("ragEditor.embeddingParams","Provider Parameters")]}),d.jsx("p",{className:"mb-1 text-[10px] text-muted-foreground",children:r("ragEditor.embeddingParamsHint","Model name, API key (use ${vault:...} for secrets), base URL, etc.")}),d.jsx(yme,{entries:i.embeddingParameters??{},onChange:m=>e({...i,embeddingParameters:Object.keys(m).length>0?m:void 0}),readOnly:t,hints:h,testIdPrefix:"embed"})]})]})}),d.jsx(PS,{label:r("ragEditor.vectorStore","Vector Store"),icon:rb,accent:"text-purple-500",badge:c==null?void 0:c.label,children:d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("ragEditor.storeType","Store Type")}),d.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:vme.map(m=>d.jsxs("button",{type:"button",disabled:t,onClick:()=>{if(m.value===i.storeType)return;i.storeType&&i.storeParameters&&(o.current[i.storeType]={...i.storeParameters});const v=o.current[m.value]??Object.fromEntries((_me[m.value]??[]).map(_=>[_.key,Bj(_.placeholder)?_.placeholder:""]));e({...i,storeType:m.value,storeParameters:Object.keys(v).length>0?v:void 0})},className:be("rounded-lg border p-2.5 text-start transition-all",i.storeType===m.value?"border-primary bg-primary/5 ring-1 ring-primary/50":"border-border hover:border-muted-foreground/40",t&&"opacity-60 cursor-default"),"data-testid":`store-${m.value}`,children:[d.jsx("span",{className:"text-xs font-medium text-foreground",children:m.label}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:m.hint})]},m.value))})]}),u.length>0&&d.jsxs("div",{children:[d.jsxs("label",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(rb,{className:"h-3 w-3"}),r("ragEditor.storeParams","Connection Parameters")]}),d.jsx(yme,{entries:i.storeParameters??{},onChange:m=>e({...i,storeParameters:Object.keys(m).length>0?m:void 0}),readOnly:t,hints:u,testIdPrefix:"store"})]})]})}),d.jsx(PS,{label:r("ragEditor.chunking","Document Chunking"),icon:USe,accent:"text-amber-500",defaultOpen:!1,children:d.jsxs("div",{className:"space-y-3","data-testid":"chunking-section",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("ragEditor.chunkStrategy","Strategy")}),d.jsx("select",{value:i.chunkStrategy??"recursive",onChange:m=>e({...i,chunkStrategy:m.target.value}),disabled:t,className:"h-8 w-full rounded-md border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60","data-testid":"chunk-strategy",children:nct.map(m=>d.jsx("option",{value:m.value,children:m.label},m.value))})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("ragEditor.chunkSize","Chunk Size")}),d.jsxs("span",{className:"text-xs font-mono font-medium text-foreground",children:[i.chunkSize??512," chars"]})]}),d.jsx("input",{type:"range",min:64,max:4096,step:64,value:i.chunkSize??512,onChange:m=>e({...i,chunkSize:parseInt(m.target.value,10)}),disabled:t,className:"w-full accent-primary","data-testid":"chunk-size"}),d.jsxs("div",{className:"flex justify-between text-[9px] text-muted-foreground/50 mt-0.5",children:[d.jsx("span",{children:"64"}),d.jsx("span",{children:"512"}),d.jsx("span",{children:"1024"}),d.jsx("span",{children:"2048"}),d.jsx("span",{children:"4096"})]})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("ragEditor.chunkOverlap","Chunk Overlap")}),d.jsxs("span",{className:"text-xs font-mono font-medium text-foreground",children:[i.chunkOverlap??64," chars"]})]}),d.jsx("input",{type:"range",min:0,max:Math.floor((i.chunkSize??512)/2),step:16,value:i.chunkOverlap??64,onChange:m=>e({...i,chunkOverlap:parseInt(m.target.value,10)}),disabled:t,className:"w-full accent-primary","data-testid":"chunk-overlap"}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:r("ragEditor.overlapHint","Overlap helps maintain context between chunks")})]}),d.jsxs("div",{className:"rounded-md border border-dashed border-muted-foreground/20 p-2.5",children:[d.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground mb-1.5",children:r("ragEditor.chunkPreview","Preview (how a document gets split)")}),d.jsx("div",{className:"flex gap-0.5 items-end",children:Array.from({length:g}).map((m,x)=>d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:be("rounded-sm",x%2===0?"bg-emerald-500/50":"bg-blue-500/50"),style:{height:`${f[x]}px`}}),(i.chunkOverlap??64)>0&&x<5&&d.jsx("div",{className:"bg-amber-500/30 rounded-sm -mt-0.5",style:{height:`${Math.max(2,(i.chunkOverlap??64)/(i.chunkSize??512)*16)}px`}})]},x))}),d.jsx("p",{className:"text-[9px] text-muted-foreground/60 mt-1",children:r("ragEditor.chunkBlocks","{{count}} chunks of ~{{size}} chars with {{overlap}} char overlap",{count:Math.ceil(2048/(i.chunkSize??512)),size:i.chunkSize??512,overlap:i.chunkOverlap??64})})]})]})}),d.jsx(PS,{label:r("ragEditor.retrievalDefaults","Retrieval Defaults"),icon:br,accent:"text-cyan-500",children:d.jsxs("div",{className:"space-y-3","data-testid":"retrieval-section",children:[d.jsx("p",{className:"text-[10px] text-muted-foreground",children:r("ragEditor.retrievalHint","These defaults can be overridden per-task in the LLM configuration.")}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("ragEditor.maxResults","Max Results (top-K)")}),d.jsx("span",{className:"text-xs font-mono font-medium text-foreground",children:i.maxResults??5})]}),d.jsx("input",{type:"range",min:1,max:20,value:i.maxResults??5,onChange:m=>e({...i,maxResults:parseInt(m.target.value,10)}),disabled:t,className:"w-full accent-primary","data-testid":"max-results"})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("ragEditor.minScore","Min Similarity Score")}),d.jsx("span",{className:be("text-xs font-mono font-medium",(i.minScore??.6)>=.8?"text-emerald-500":(i.minScore??.6)>=.5?"text-amber-500":"text-red-500"),children:(i.minScore??.6).toFixed(2)})]}),d.jsx("input",{type:"range",min:0,max:1,step:.05,value:i.minScore??.6,onChange:m=>e({...i,minScore:parseFloat(m.target.value)}),disabled:t,className:"w-full accent-primary","data-testid":"min-score"}),d.jsxs("div",{className:"flex justify-between text-[9px] mt-0.5",children:[d.jsx("span",{className:"text-red-400",children:"0.0 (any)"}),d.jsx("span",{className:"text-amber-400",children:"0.5"}),d.jsx("span",{className:"text-emerald-400",children:"1.0 (exact)"})]})]})]})}),d.jsx(PS,{label:r("ragEditor.ingestion","Document Ingestion"),icon:qv,accent:"text-rose-500",defaultOpen:!1,children:n?d.jsx(rct,{kbId:n,version:s,readOnly:t}):d.jsx("p",{className:"text-xs text-muted-foreground italic",children:r("ragEditor.saveFirstIngestion","Save this knowledge base first to enable document ingestion.")})})]})}const act=["governance","persona","compliance","custom"];function lct({tags:i,onChange:e,readOnly:t}){const{t:n}=xe(),[s,r]=L.useState(""),o=()=>{const a=s.trim().toLowerCase();a&&!i.includes(a)&&(e([...i,a]),r(""))};return d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map(a=>d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:[a,!t&&d.jsx("button",{type:"button",onClick:()=>e(i.filter(l=>l!==a)),className:"rounded p-0.5 hover:bg-primary/20 transition-colors","aria-label":`Remove ${a}`,children:d.jsx(An,{className:"h-3 w-3"})})]},a)),i.length===0&&d.jsx("span",{className:"text-xs text-muted-foreground italic",children:n("snippetEditor.noTags","No tags")})]}),!t&&d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("input",{type:"text",value:s,onChange:a=>r(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),o())},placeholder:n("snippetEditor.tagPlaceholder","e.g. safety, production"),className:"h-8 flex-1 rounded-md border border-input bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),d.jsx("button",{type:"button",onClick:o,className:"inline-flex h-8 items-center gap-1 rounded-md border border-input px-2 text-xs font-medium text-foreground transition-colors hover:bg-secondary",children:d.jsx(Gt,{className:"h-3 w-3"})})]})]})}function cct({data:i,onChange:e,readOnly:t}){const{t:n}=xe();return d.jsxs("div",{className:"space-y-6","data-testid":"snippet-editor",children:[d.jsx(ls,{label:n("snippetEditor.identity","Identity"),icon:OM,accent:"text-violet-500",children:d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:n("snippetEditor.name","Snippet Name")}),d.jsx("input",{type:"text",value:i.name??"",onChange:s=>e({...i,name:s.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")}),readOnly:t,placeholder:n("snippetEditor.namePlaceholder","e.g. cautious_mode"),pattern:"[a-z0-9_]+",className:"h-8 w-full rounded-md border border-input bg-background px-3 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"snippet-name"}),i.name&&d.jsxs("p",{className:"mt-1 text-[10px] text-muted-foreground font-mono",children:[n("snippetEditor.usageHint","Usage:")," ",d.jsxs("code",{className:"rounded bg-primary/10 px-1 py-0.5 text-primary",children:["{{","snippets.",i.name,"}}"]})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:n("snippetEditor.category","Category")}),d.jsx("select",{value:i.category??"custom",onChange:s=>e({...i,category:s.target.value}),disabled:t,className:"h-8 w-full rounded-md border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-60","data-testid":"snippet-category",children:act.map(s=>d.jsx("option",{value:s,children:n(`snippetEditor.category_${s}`,s.charAt(0).toUpperCase()+s.slice(1))},s))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:n("snippetEditor.description","Description")}),d.jsx("input",{type:"text",value:i.description??"",onChange:s=>e({...i,description:s.target.value}),readOnly:t,placeholder:n("snippetEditor.descriptionPlaceholder","What this snippet does"),className:"h-8 w-full rounded-md border border-input bg-background px-3 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"snippet-description"})]})]})}),d.jsx(ls,{label:n("snippetEditor.content","Prompt Content"),icon:IL,accent:"text-amber-500",children:d.jsxs("div",{className:"space-y-3",children:[d.jsx(V7,{value:i.content??"",onChange:s=>e({...i,content:s}),readOnly:t,language:"prompt",label:n("snippetEditor.contentLabel","Snippet Content"),placeholder:n("snippetEditor.contentPlaceholder","You should be cautious and careful in your responses..."),testId:"snippet-content"}),d.jsxs("label",{className:"inline-flex items-center gap-2 text-xs text-foreground",children:[d.jsx("input",{type:"checkbox",checked:i.templateEnabled??!0,onChange:s=>e({...i,templateEnabled:s.target.checked}),disabled:t,className:"h-3.5 w-3.5 rounded border-input accent-primary","data-testid":"snippet-template-enabled"}),d.jsx(IBe,{className:"h-3.5 w-3.5 text-muted-foreground"}),n("snippetEditor.templateEnabled","Enable template resolution")]}),d.jsx("p",{className:"text-[10px] text-muted-foreground ps-5 -mt-1",children:n("snippetEditor.templateEnabledHint","When disabled, {{}} markers in the content are treated as literal text (useful for code examples).")})]})}),d.jsx(ls,{label:n("snippetEditor.tags","Tags"),icon:KSe,accent:"text-sky-500",defaultOpen:!!(i.tags&&i.tags.length>0),children:d.jsx(lct,{tags:i.tags??[],onChange:s=>e({...i,tags:s}),readOnly:t})})]})}const CDe={rules:(i,e,t)=>d.jsx(tlt,{data:i,onChange:e,readOnly:t}),apicalls:(i,e,t)=>d.jsx(klt,{data:i,onChange:e,readOnly:t}),llm:(i,e,t)=>d.jsx(Mlt,{data:i,onChange:e,readOnly:t}),output:(i,e,t)=>d.jsx(Blt,{data:i,onChange:e,readOnly:t}),propertysetter:(i,e,t)=>d.jsx(qlt,{data:i,onChange:e,readOnly:t}),dictionary:(i,e,t)=>d.jsx(Qlt,{data:i,onChange:e,readOnly:t}),mcpcalls:(i,e,t)=>d.jsx(tct,{data:i,onChange:e,readOnly:t}),rag:(i,e,t,n)=>d.jsx(oct,{data:i,onChange:e,readOnly:t,resourceId:n.resourceId,version:n.version}),snippets:(i,e,t)=>d.jsx(cct,{data:i,onChange:e,readOnly:t})},dct={"eddi://ai.labs.rules":"rules","eddi://ai.labs.apicalls":"apicalls","eddi://ai.labs.llm":"llm","eddi://ai.labs.output":"output","eddi://ai.labs.output.template":"output","eddi://ai.labs.property":"propertysetter","eddi://ai.labs.mcpcalls":"mcpcalls","eddi://ai.labs.dictionary":"dictionary","eddi://ai.labs.rag":"rag","eddi://ai.labs.snippets":"snippets"};function uct({usages:i,isUpdating:e,onConfirm:t,onDismiss:n}){const{t:s}=xe(),[r,o]=L.useState(new Set(i.map((c,u)=>u)));function a(c){const u=new Set(r);u.has(c)?u.delete(c):u.add(c),o(u)}function l(){const c=i.filter((u,h)=>r.has(h));t(c)}return i.length===0?null:d.jsxs("div",{className:"rounded-xl border border-amber-200 bg-amber-50/80 p-4 dark:border-amber-800 dark:bg-amber-950/30","data-testid":"update-usage-dialog",children:[d.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[d.jsx(Ed,{className:"h-5 w-5 text-amber-600 dark:text-amber-400"}),d.jsx("h3",{className:"text-sm font-semibold text-amber-900 dark:text-amber-200",children:s("editor.usedInAgents",{count:i.length,defaultValue:"Used in {{count}} agent(s)"})})]}),d.jsx("p",{className:"mb-3 text-xs text-amber-700 dark:text-amber-300",children:s("editor.updateUsageHint","Update the selected workflows and agents to use the new version?")}),d.jsx("ul",{className:"mb-3 space-y-2",children:i.map((c,u)=>d.jsx("li",{children:d.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-lg border border-amber-200 bg-white/60 px-3 py-2 transition-colors hover:bg-white/80 dark:border-amber-800 dark:bg-amber-950/20 dark:hover:bg-amber-950/40",children:[d.jsx("input",{type:"checkbox",checked:r.has(u),onChange:()=>a(u),disabled:e,className:"h-4 w-4 rounded border-amber-300 accent-amber-600","data-testid":`usage-checkbox-${u}`}),d.jsxs("div",{className:"flex flex-1 items-center gap-3 text-xs",children:[d.jsxs("span",{className:"flex items-center gap-1 text-amber-800 dark:text-amber-300",children:[d.jsx(ai,{className:"h-3.5 w-3.5"}),c.agentName," ",d.jsxs("span",{className:"opacity-50",children:["v",c.agentVersion]})]}),d.jsx("span",{className:"text-amber-500",children:"→"}),d.jsxs("span",{className:"flex items-center gap-1 text-amber-800 dark:text-amber-300",children:[d.jsx(Ed,{className:"h-3.5 w-3.5"}),c.workflowName," ",d.jsxs("span",{className:"opacity-50",children:["v",c.workflowVersion]})]})]})]})},`${c.agentId}-${c.workflowId}`))}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("button",{onClick:l,disabled:e||r.size===0,className:"inline-flex items-center gap-1.5 rounded-lg bg-amber-600 px-3 py-1.5 text-xs font-medium text-white shadow-sm transition-all hover:bg-amber-700 active:scale-[0.98] disabled:opacity-50 dark:bg-amber-500 dark:hover:bg-amber-600","data-testid":"confirm-cascade-btn",children:[e?d.jsx(xi,{className:"h-3.5 w-3.5 animate-spin"}):d.jsx(Ns,{className:"h-3.5 w-3.5"}),e?s("editor.cascading","Updating..."):s("editor.updateUsage","Update Selected")]}),d.jsxs("button",{onClick:n,disabled:e,className:"inline-flex items-center gap-1.5 rounded-lg border border-amber-200 px-3 py-1.5 text-xs font-medium text-amber-800 transition-all hover:bg-amber-100 active:scale-[0.98] disabled:opacity-50 dark:border-amber-800 dark:text-amber-300 dark:hover:bg-amber-950/40","data-testid":"dismiss-cascade-btn",children:[d.jsx(An,{className:"h-3.5 w-3.5"}),s("editor.skipUpdate","Skip")]})]})]})}async function hct(i,e,t){var a;const n=[],[s,r]=await Promise.all([T7(200,0,""),OL(200,0,"")]),o=new Map;for(const l of s){const{id:c,version:u}=uo(l.resource);try{if(!(await qM(c,u)).workflowSteps.some(f=>{var x;const m=(x=f.config)==null?void 0:x.uri;return typeof m=="string"&&m.includes(`/${e}/${t}/${i}`)}))continue;for(const f of r){const{id:m,version:x}=uo(f.resource);try{const v=`${m}@${x}`;let _=o.get(v);_||(_=await vC(m,x),o.set(v,_));const w=l.resource;(a=_.workflows)!=null&&a.some(k=>k===w)&&n.push({workflowId:c,workflowVersion:u,workflowName:l.name||c,agentId:m,agentVersion:x,agentName:f.name||m})}catch{}}}catch{}}return n}const wme=new Map;async function gct(i){const e=i.slug,t=wme.get(e);if(t)return t;const n=await Oe.get(`/${i.store}/${i.plural}/jsonSchema`);return wme.set(e,n),n}function SDe(i){return hn({queryKey:["jsonSchema",i],queryFn:()=>{if(!i)throw new Error("No type slug");const e=KL(i);if(!e)throw new Error(`Unknown resource type: ${i}`);return gct(e)},enabled:!!i,staleTime:1/0,gcTime:1/0,retry:1})}function fct({open:i,onClose:e,typeName:t,versions:n,fetchVersion:s,currentVersion:r}){var B;const{t:o}=xe(),{theme:a}=RM(),l=[...n].sort((U,$)=>U.version-$.version),c=l.findIndex(U=>U.version===r),u=c>0?l[c-1].version:((B=l[0])==null?void 0:B.version)??1,[h,g]=L.useState(u),[f,m]=L.useState(r),[x,v]=L.useState(null),[_,w]=L.useState(null),[k,C]=L.useState(!1),[E,D]=L.useState(null),T=L.useCallback(async()=>{C(!0),D(null);try{const[U,$]=await Promise.all([s(h),s(f)]);v(Cme(U)),w(Cme($))}catch(U){D(U instanceof Error?U.message:"Failed to load versions")}finally{C(!1)}},[h,f,s]),[I,R]=L.useState(""),P=`${h}-${f}`;if(i&&P!==I&&(R(P),T()),!i)return null;const j=a==="dark"?"vs-dark":"light";return d.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col","data-testid":"version-diff-dialog",children:[d.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:e,"aria-hidden":"true"}),d.jsxs("div",{className:"relative z-10 flex flex-col m-4 rounded-xl border bg-card shadow-2xl overflow-hidden flex-1",role:"dialog","aria-modal":"true","aria-labelledby":"diff-dialog-title",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-3 shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ISe,{className:"h-5 w-5 text-primary","aria-hidden":"true"}),d.jsxs("h3",{id:"diff-dialog-title",className:"text-lg font-semibold text-foreground",children:[o("editor.compareVersions","Compare Versions")," — ",t]})]}),d.jsx("button",{onClick:e,className:"rounded-md p-1 text-muted-foreground hover:bg-secondary transition-colors","aria-label":o("common.close","Close"),children:d.jsx(An,{className:"h-5 w-5","aria-hidden":"true"})})]}),d.jsxs("div",{className:"flex items-center gap-4 border-b border-border px-5 py-3 shrink-0 bg-muted/30",children:[d.jsx(Sme,{label:o("editor.olderVersion","Older"),versions:l,value:h,onChange:g,side:"left"}),d.jsx("span",{className:"text-muted-foreground text-lg",children:"↔"}),d.jsx(Sme,{label:o("editor.newerVersion","Newer"),versions:l,value:f,onChange:m,side:"right"}),d.jsx("button",{onClick:()=>{g(f),m(h)},className:"rounded-md p-1.5 text-muted-foreground hover:bg-secondary transition-colors",title:o("editor.swapVersions","Swap versions"),"aria-label":o("editor.swapVersions","Swap versions"),children:d.jsx(xi,{className:"h-4 w-4","aria-hidden":"true"})})]}),d.jsxs("div",{className:"flex-1 min-h-0",children:[k&&d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(xi,{className:"h-6 w-6 animate-spin text-primary"})}),E&&d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx("p",{className:"text-sm text-destructive",children:E})}),!k&&!E&&x!==null&&_!==null&&d.jsx(Wat,{original:x,modified:_,language:"json",theme:j,options:{readOnly:!0,renderSideBySide:!0,minimap:{enabled:!1},fontSize:13,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",renderOverviewRuler:!1,automaticLayout:!0}})]}),d.jsx("div",{className:"border-t border-border px-5 py-2 shrink-0 bg-muted/30",children:d.jsx("p",{className:"text-xs text-muted-foreground text-center",children:o("editor.diffHint","Additions shown in green, deletions in red. Left = older, Right = newer.")})})]})]})}function Cme(i){try{return JSON.stringify(JSON.parse(i),null,2)}catch{return i}}function Sme({label:i,versions:e,value:t,onChange:n,side:s}){return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider ${s==="left"?"text-rose-500":"text-emerald-500"}`,children:i}),d.jsxs("div",{className:"relative",children:[d.jsx("select",{value:t,onChange:r=>n(Number(r.target.value)),className:"appearance-none rounded-md border border-input bg-background pe-7 ps-3 py-1.5 text-sm font-medium text-foreground shadow-sm hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 cursor-pointer","data-testid":`diff-version-${s}`,children:e.map(r=>d.jsxs("option",{value:r.version,children:["v",r.version]},r.version))}),d.jsx(Rn,{className:"pointer-events-none absolute inset-e-1.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"})]})]})}function pct(){const[i]=G_(),e=i.get("agentId"),t=i.get("agentVer");if(!e||!t)return null;const n=parseInt(t,10);return isNaN(n)?null:{agentId:e,agentVer:n}}const mct={GitBranch:Vb,Globe:Su,MessageSquareText:AL,BookOpen:Lw,BookOpenCheck:Lw,Brain:Nl,Settings:xp,Plug:PM,Puzzle:OM};function bct(){const{type:i,id:e}=K_(),[t]=G_(),{t:n}=xe(),s=il(),r=KL(i??""),o=mct[(r==null?void 0:r.icon)??""]??bp,a=r?n(`${r.labelKey}.name`):i??"",l=L.useMemo(()=>{const Ct=t.get("wfId"),Ft=t.get("wfVer"),Ve=t.get("agentId"),tt=t.get("agentVer");if(Ct&&Ft&&Ve&&tt)return{workflowId:Ct,workflowVersion:parseInt(Ft,10),agentId:Ve,agentVersion:parseInt(tt,10)}},[t]),[c,u]=L.useState(l);L.useEffect(()=>{u(l)},[l]);const[h,g]=L.useState(void 0);L.useEffect(()=>{g(void 0)},[e,i]);const{data:f,isLoading:m,isError:x}=iDe(i??"",e??"");L.useEffect(()=>{if(h===void 0&&f)if(f.length>0){const Ct=f.reduce((Ft,Ve)=>{var It;const tt=(It=Ve.resource)==null?void 0:It.match(/\?version=(\d+)/),qt=tt?parseInt(tt[1]??"1",10):1;return qt>Ft?qt:Ft},1);g(Ct)}else g(1)},[h,f]);const{data:v,isLoading:_,isError:w,refetch:k}=nDe(i??"",e??"",h??0),C=sDe(i??""),E=rDe(i??""),D=oDe(i??""),{data:T}=SDe(i),[I,R]=L.useState(!1),[P,j]=L.useState(!1),[B,U]=L.useState([]),[$,K]=L.useState(!1),[z,G]=L.useState(!1),[ne,te]=L.useState(null),[H,Q]=L.useState(null),Y=pct(),{saveAndDeploy:V,isRunning:ue}=QLe(),[he,Te]=L.useState(!1),nt=f?f.map(Ct=>{var Ve;const Ft=(Ve=Ct.resource)==null?void 0:Ve.match(/\?version=(\d+)/);return{version:Ft?parseInt(Ft[1]??"1",10):1,lastModifiedOn:Ct.lastModifiedOn}}):[{version:h??1}],ge=L.useCallback(async Ct=>{if(h!==void 0){R(!1);try{const Ft=JSON.parse(Ct);c?D.mutate({id:e??"",version:h,body:Ft,context:c},{onSuccess:Ve=>{ze.success(n("editor.saved")),R(!0),g(Ve.newResourceVersion),u({...c,workflowVersion:Ve.newWorkflowVersion??c.workflowVersion,agentVersion:Ve.newAgentVersion??c.agentVersion})},onError:Ve=>ze.error(Vs(Ve))}):D.mutate({id:e??"",version:h,body:Ft},{onSuccess:async Ve=>{if(ze.success(n("editor.saved")),R(!0),Q(h),te(Ve.newResourceVersion),g(Ve.newResourceVersion),r)try{const tt=await hct(e??"",r.store,r.plural);tt.length>0&&(U(tt),K(!0))}catch{}},onError:Ve=>ze.error(Vs(Ve))})}catch{}}},[e,h,D,c,r,n]),_e=L.useCallback(async Ct=>{if(!(!c||!Y||h===void 0))try{const Ft=JSON.parse(Ct);await V({agentId:Y.agentId,save:async()=>{const Ve=await D.mutateAsync({id:e??"",version:h,body:Ft,context:c});return g(Ve.newResourceVersion),u(tt=>tt&&{...tt,workflowVersion:Ve.newWorkflowVersion??tt.workflowVersion,agentVersion:Ve.newAgentVersion??tt.agentVersion}),{newAgentVersion:Ve.newAgentVersion??Y.agentVer}}})}catch{}},[e,h,D,c,Y,V]),$e=L.useCallback(async Ct=>{if(ne===null||H===null||!r)return;G(!0);const Ft=new Map,Ve=new Map;let tt=0;try{for(const qt of Ct){const It=Ft.get(qt.workflowId)??qt.workflowVersion,Zt=Ve.get(qt.agentId)??qt.agentVersion;try{const En=await kot(r,e??"",H,ne,{workflowId:qt.workflowId,workflowVersion:It,agentId:qt.agentId,agentVersion:Zt});En.newWorkflowVersion&&Ft.set(qt.workflowId,En.newWorkflowVersion),En.newAgentVersion&&Ve.set(qt.agentId,En.newAgentVersion)}catch{tt++}}}finally{tt>0?ze.error(n("editor.cascadePartialFailure",{count:tt,defaultValue:"{{count}} cascade update(s) failed"})):Ct.length>0&&ze.success(n("editor.cascadeSuccess","References updated successfully")),G(!1),K(!1),U([])}},[e,H,ne,r,n]);if(!r)return d.jsxs("div",{className:"space-y-4 py-20",children:[d.jsx(ep,{message:n("resources.unknownType","Unknown resource type")}),d.jsx("div",{className:"text-center",children:d.jsx(Kn,{to:"/manage/resources",className:"text-sm text-primary hover:underline",children:n("resources.backToResources","← Back to Resources")})})]});function Ke(){C.mutate({id:e??"",version:h??1},{onSuccess:()=>{ze.success(n("common.delete")+" ✓"),j(!1),s(`/manage/resources/${i}`)},onError:Ct=>ze.error(Vs(Ct))})}function ht(){E.mutate({id:e??"",version:h??1},{onSuccess:Ct=>{ze.success(n("common.duplicate")+" ✓");const Ft=Ct.location.split("/"),Ve=(Ft[Ft.length-1]??"").split("?")[0];Ve&&s(`/manage/resources/${i}/${Ve}`)},onError:Ct=>ze.error(Vs(Ct))})}return d.jsxs("div",{className:"space-y-6",children:[(()=>{const Ct=t.get("wfId"),Ft=t.get("agentId"),Ve=t.get("agentVer");if(Ct){const tt=new URLSearchParams;Ft&&tt.set("agentId",Ft),Ve&&tt.set("agentVer",Ve);const qt=tt.toString();return d.jsx(EA,{to:`/manage/workflowview/${Ct}${qt?`?${qt}`:""}`,label:n("resources.backToWorkflow","Back to Workflow")})}return d.jsx(EA,{to:`/manage/resources/${i}`,label:n("resources.backToList",{type:a,defaultValue:`Back to ${a}`})})})(),d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-2 text-3xl font-bold text-foreground",children:[d.jsx(o,{className:"h-8 w-8 text-primary"}),(()=>{const Ct=f==null?void 0:f.find(Ft=>{var tt;const Ve=(tt=Ft.resource)==null?void 0:tt.match(/\?version=(\d+)/);return Ve?parseInt(Ve[1],10)===h:!1});return(Ct==null?void 0:Ct.name)||a})()]}),d.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[e,d.jsxs("span",{className:"ms-2 inline-flex items-center rounded-md bg-primary/10 px-1.5 py-0.5 text-xs font-semibold text-primary",children:["v",h]})]}),c&&d.jsx("p",{className:"mt-1 text-xs text-amber-600 dark:text-amber-400",children:n("editor.cascadeMode","Changes will cascade to parent workflow and agent")})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Yt,{variant:"outline",onClick:ht,disabled:E.isPending,children:[d.jsx(mo,{className:"h-4 w-4"}),n("common.duplicate")]}),d.jsxs(Yt,{variant:"destructive",onClick:()=>j(!0),disabled:C.isPending,children:[d.jsx(_n,{className:"h-4 w-4"}),n("common.delete")]})]})]}),(_||m||h===void 0&&!x)&&d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex gap-4",children:[d.jsx(bi,{className:"h-10 w-32"}),d.jsx(bi,{className:"h-10 w-32"})]}),d.jsx(bi,{className:"h-[400px] w-full rounded-xl"})]}),(w||x)&&!_&&!m&&d.jsx(ep,{message:n("common.error"),onRetry:()=>k(),retryLabel:n("common.retry")}),!_&&!w&&v!==void 0&&d.jsxs(d.Fragment,{children:[d.jsx(fDe,{typeName:a,typeIcon:o,resourceId:e??"",data:JSON.stringify(v,null,2),versions:nt,currentVersion:h??1,onVersionChange:g,onSave:ge,onSaveAndDeploy:c&&Y?_e:void 0,isSaving:D.isPending,isSaveAndDeploying:ue,saveSuccess:I,saveError:D.isError?n("editor.saveError","Failed to save"):void 0,renderFormEditor:CDe[i??""],jsonSchema:T,onCompare:()=>Te(!0)}),he&&d.jsx(fct,{open:he,onClose:()=>Te(!1),typeName:a,versions:nt,currentVersion:h??1,fetchVersion:async Ct=>{const Ft=await KLe(r,e??"",Ct);return JSON.stringify(Ft,null,2)}}),$&&d.jsx(uct,{usages:B,isUpdating:z,onConfirm:$e,onDismiss:()=>{K(!1),U([])}})]}),d.jsx(sl,{open:P,onOpenChange:j,title:n("resources.confirmDelete",{type:a}),description:n("resources.confirmDeleteDescription",{type:a,defaultValue:"This action cannot be undone. The {{type}} will be permanently deleted."}),confirmLabel:n("common.delete"),cancelLabel:n("common.cancel"),onConfirm:Ke,isPending:C.isPending})]})}const np=[{id:"anthropic",name:"Anthropic",defaultModel:"claude-sonnet-4-6",needsKey:!0},{id:"openai",name:"OpenAI",defaultModel:"gpt-5.4",needsKey:!0},{id:"gemini",name:"Google Gemini",defaultModel:"gemini-3.5-flash",needsKey:!0},{id:"gemini-vertex",name:"Google Vertex AI",defaultModel:"gemini-3.5-flash",needsKey:!1},{id:"mistral",name:"Mistral AI",defaultModel:"mistral-large-latest",needsKey:!0},{id:"huggingface",name:"HuggingFace",defaultModel:"Qwen/Qwen3.5-7B",needsKey:!0},{id:"azure-openai",name:"Azure OpenAI",defaultModel:"gpt-5.4",needsKey:!0},{id:"bedrock",name:"Amazon Bedrock",defaultModel:"anthropic.claude-sonnet-4-6-v1:0",needsKey:!1},{id:"oracle-genai",name:"Oracle GenAI",defaultModel:"cohere.command-r-plus-v2",needsKey:!1},{id:"ollama",name:"Ollama (Local)",defaultModel:"llama3.3:70b",needsKey:!1},{id:"jlama",name:"Jlama (Local)",defaultModel:"llama-3.2-1b",needsKey:!1}];function Hj(i){return np.find(e=>e.id===i)}function DA(i){return Oe.post("/administration/agents/setup",i)}function xct(i){return Oe.post("/administration/agents/setup-api",i)}function vct(){const i=cn();return Kt({mutationFn:DA,onSuccess:()=>{i.invalidateQueries({queryKey:["agents"]})}})}function _ct(){const i=cn();return Kt({mutationFn:xct,onSuccess:()=>{i.invalidateQueries({queryKey:["agents"]})}})}const kme={mode:"",name:"",systemPrompt:"",provider:"anthropic",model:"",apiKey:"",baseUrl:"",introMessage:"",enableBuiltInTools:!1,builtInToolsWhitelist:"",enableQuickReplies:!1,enableSentimentAnalysis:!1,openApiSpec:"",apiBaseUrl:"",apiAuth:"",endpoints:"",specInputMode:"url",specUrl:"",deploy:!0,environment:"production"},yct={anthropic:["claude-opus-4-8","claude-opus-4-7","claude-opus-4-6","claude-sonnet-4-6","claude-haiku-4-5"],openai:["gpt-5.5","gpt-5.5-pro","gpt-5.4","gpt-5.4-pro","gpt-5.4-mini","gpt-5.4-nano","gpt-5.4-thinking","gpt-5","gpt-5-mini","gpt-5-nano","o3-mini"],gemini:["gemini-3.5-flash","gemini-3.1-pro-preview","gemini-3.1-pro-preview-customtools","gemini-3.1-flash-lite","gemini-2.5-pro","gemini-2.5-flash","gemini-2.5-flash-lite"],"gemini-vertex":["gemini-3.5-flash","gemini-3.1-pro-preview","gemini-3.1-flash-lite","gemini-2.5-pro","gemini-2.5-flash","gemini-2.5-flash-lite","google/gemma3@gemma-3-12b-it","google/gemma2@gemma-2-2b-it","claude-opus-4-8","claude-sonnet-4-6","claude-haiku-4-5@20251001"],ollama:["llama3.3:70b","qwen3:8b","gemma3:4b","phi4:mini","deepseek-r1:8b"],jlama:["llama-3.2-1b","tinyllama"],huggingface:["deepseek-ai/DeepSeek-V4","google/gemma-4-assistant","THUDM/GLM-5.1","Qwen/Qwen3.5-7B","meta-llama/Llama-3.2-1B"],mistral:["mistral-large-latest","mistral-medium-latest","mistral-small-latest","mistral-small-4","ministral-14b-latest","ministral-8b-latest","ministral-3b-latest","devstral-latest","devstral-small-latest","codestral-latest","magistral-medium-latest","magistral-small-latest"],"azure-openai":["gpt-5.4","gpt-5.4-mini","gpt-5.1","gpt-4.1","gpt-4.1-mini","gpt-4o","gpt-4o-mini","gpt-4-turbo"],bedrock:["anthropic.claude-opus-4-8","anthropic.claude-sonnet-4-6","anthropic.claude-haiku-4-5-20251001-v1:0","anthropic.claude-sonnet-4-6-v1:0","meta.llama4-maverick-17b-instruct-v1:0","meta.llama4-scout-17b-instruct-v1:0","meta.llama3-3-70b-instruct-v1:0","meta.llama3-1-405b-instruct-v1:0","amazon.nova-pro-v1:0","amazon.nova-lite-v1:0","minimax.minimax-m2"],"oracle-genai":["cohere.command-latest","cohere.command-plus-latest","cohere.command-r-plus-v2","cohere.command-r-plus","meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8","meta-llama/Llama-4-Scout-17B-16E-Instruct","meta.llama-3.3-70b-instruct","meta.llama-3.1-70b-instruct","openai/gpt-oss-120b","openai/gpt-oss-20b"]};function wct(i){return i==="ollama"||i==="jlama"}const Cct=[{id:"type",icon:Ll,label:"Type"},{id:"info",icon:Nl,label:"Identity"},{id:"llm",icon:Wie,label:"Model"},{id:"features",icon:zb,label:"Features"},{id:"review",icon:Ih,label:"Review"}],Sct=[{id:"type",icon:Ll,label:"Type"},{id:"info",icon:Nl,label:"Identity"},{id:"apispec",icon:Su,label:"API Spec"},{id:"llm",icon:Wie,label:"Model"},{id:"features",icon:zb,label:"Features"},{id:"review",icon:Ih,label:"Review"}];function kct(){const{t:i}=xe(),[e,t]=L.useState(0),[n,s]=L.useState(kme),[r,o]=L.useState(null),[a,l]=L.useState(""),c=vct(),u=_ct(),h=c.isPending||u.isPending,g=n.mode==="api"?Sct:Cct,f=g[e],m=L.useCallback(C=>s(E=>({...E,...C})),[]);function x(C){const E=Hj(C);m({provider:C,model:"",apiKey:(E==null?void 0:E.needsKey)===!1?"":n.apiKey})}function v(){if(!f)return!1;switch(f.id){case"type":return n.mode!=="";case"info":return n.name.trim().length>0&&n.systemPrompt.trim().length>0;case"llm":{const C=Hj(n.provider);return C!=null&&C.needsKey&&!n.apiKey.trim()?!1:n.model.trim().length>0}case"apispec":return n.openApiSpec.trim().length>0;case"features":case"review":return!0;default:return!1}}function _(){e0&&t(e-1)}async function k(C){l("");try{let E;if(n.mode==="api"){const D={name:n.name,systemPrompt:n.systemPrompt,openApiSpec:n.openApiSpec,provider:n.provider,model:n.model,apiKey:n.apiKey||void 0,apiBaseUrl:n.apiBaseUrl||void 0,apiAuth:n.apiAuth||void 0,endpoints:n.endpoints||void 0,enableQuickReplies:n.enableQuickReplies||void 0,enableSentimentAnalysis:n.enableSentimentAnalysis||void 0,deploy:C??n.deploy,environment:n.environment};E=await u.mutateAsync(D)}else{const D={name:n.name,systemPrompt:n.systemPrompt,provider:n.provider,model:n.model,apiKey:n.apiKey||void 0,baseUrl:n.baseUrl||void 0,introMessage:n.introMessage||void 0,enableBuiltInTools:n.enableBuiltInTools||void 0,builtInToolsWhitelist:n.builtInToolsWhitelist||void 0,enableQuickReplies:n.enableQuickReplies||void 0,enableSentimentAnalysis:n.enableSentimentAnalysis||void 0,deploy:C??n.deploy,environment:n.environment};E=await c.mutateAsync(D)}o(E),ze.success(i("setupWizard.success","Agent created successfully!"))}catch(E){const D=E&&typeof E=="object"&&"message"in E?E.message:i("common.error");l(D),ze.error(D)}}return r?d.jsx("div",{className:"mx-auto max-w-2xl space-y-8",children:d.jsxs("div",{className:"rounded-2xl border border-emerald-500/30 bg-card p-8 text-center shadow-lg",children:[d.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-emerald-500/10",children:d.jsx(Xl,{className:"h-8 w-8 text-emerald-500"})}),d.jsx("h2",{className:"text-2xl font-bold text-foreground",children:i("setupWizard.agentCreated","Agent Created!")}),d.jsxs("p",{className:"mt-2 text-muted-foreground",children:[r.agentName," — ",r.provider,"/",r.model]}),r.deployed&&d.jsxs("div",{className:"mt-3 inline-flex items-center gap-1.5 rounded-full bg-emerald-500/10 px-3 py-1 text-sm font-medium text-emerald-600 dark:text-emerald-400",children:[d.jsx(Xl,{className:"h-3.5 w-3.5"}),i("setupWizard.deployed","Deployed")," — ",r.deploymentStatus]}),r.deployed===!1&&r.deploymentStatus&&d.jsxs("div",{className:"mt-3 inline-flex items-center gap-1.5 rounded-full bg-amber-500/10 px-3 py-1 text-sm font-medium text-amber-600 dark:text-amber-400",children:[d.jsx(Lo,{className:"h-3.5 w-3.5"}),r.deploymentStatus]}),r.endpointCount!=null&&d.jsxs("p",{className:"mt-3 text-sm text-muted-foreground",children:[i("setupWizard.endpointsParsed","{{count}} API endpoints parsed",{count:r.endpointCount}),r.groups&&r.groups.length>0&&d.jsxs(d.Fragment,{children:[" — ",r.groups.join(", ")]})]}),d.jsxs("div",{className:"mt-6 flex items-center justify-center gap-3",children:[d.jsxs(Kn,{to:`/manage/agentview/${r.agentId}`,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 hover:shadow-md active:scale-[0.98]",children:[i("setupWizard.viewAgent","View Agent"),d.jsx(To,{className:"h-4 w-4"})]}),d.jsx("button",{onClick:()=>{s(kme),t(0),o(null),l("")},className:"inline-flex items-center gap-2 rounded-lg border border-border px-4 py-2.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",children:i("setupWizard.createAnother","Create Another")})]})]})}):d.jsxs("div",{className:"mx-auto max-w-3xl space-y-8",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Kn,{to:"/manage/agents",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(El,{className:"h-4 w-4"}),i("setupWizard.backToAgents","Back to Agents")]}),d.jsxs("h1",{className:"flex items-center gap-3 text-3xl font-bold text-foreground",children:[d.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-linear-to-br from-primary to-primary/60 text-primary-foreground shadow-lg",children:d.jsx(RL,{className:"h-5 w-5"})}),i("setupWizard.title","Agent Setup Wizard")]}),d.jsx("p",{className:"text-muted-foreground",children:i("setupWizard.subtitle","Create a fully configured agent in minutes")})]}),d.jsx("div",{className:"flex items-center gap-2","data-testid":"wizard-steps",children:g.map((C,E)=>{const D=C.icon,T=E===e,I=EEe,className:be("flex h-10 w-10 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-300",T&&"border-primary bg-primary text-primary-foreground shadow-md shadow-primary/25 scale-110",I&&"border-emerald-500 bg-emerald-500 text-white",!T&&!I&&"border-border bg-card text-muted-foreground"),children:I?d.jsx(Ns,{className:"h-4 w-4"}):d.jsx(D,{className:"h-4 w-4"})}),d.jsx("span",{className:be("text-[10px] font-medium transition-colors duration-300 whitespace-nowrap",T&&"text-primary",I&&"text-emerald-500",!T&&!I&&"text-muted-foreground"),children:C.label})]}),Em({mode:C})}),(f==null?void 0:f.id)==="info"&&d.jsx(Ect,{name:n.name,systemPrompt:n.systemPrompt,onNameChange:C=>m({name:C}),onPromptChange:C=>m({systemPrompt:C})}),(f==null?void 0:f.id)==="llm"&&d.jsx(Lct,{provider:n.provider,model:n.model,apiKey:n.apiKey,baseUrl:n.baseUrl,onProviderChange:x,onModelChange:C=>m({model:C}),onApiKeyChange:C=>m({apiKey:C}),onBaseUrlChange:C=>m({baseUrl:C})}),(f==null?void 0:f.id)==="apispec"&&d.jsx(Dct,{spec:n.openApiSpec,specUrl:n.specUrl,specInputMode:n.specInputMode,apiBaseUrl:n.apiBaseUrl,apiAuth:n.apiAuth,endpoints:n.endpoints,onSpecChange:C=>m({openApiSpec:C}),onSpecUrlChange:C=>m({specUrl:C}),onModeChange:C=>m({specInputMode:C}),onApiBaseUrlChange:C=>m({apiBaseUrl:C}),onApiAuthChange:C=>m({apiAuth:C}),onEndpointsChange:C=>m({endpoints:C})}),(f==null?void 0:f.id)==="features"&&d.jsx(Tct,{state:n,onChange:m}),(f==null?void 0:f.id)==="review"&&d.jsx(Ict,{state:n,error:a})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("button",{onClick:w,disabled:e===0,className:be("inline-flex items-center gap-2 rounded-lg px-4 py-2.5 text-sm font-medium transition-colors",e===0?"invisible":"text-muted-foreground hover:bg-secondary hover:text-foreground"),"data-testid":"wizard-back",children:[d.jsx(El,{className:"h-4 w-4"}),i("setupWizard.back","Back")]}),(f==null?void 0:f.id)!=="review"?d.jsxs("button",{onClick:_,disabled:!v(),className:"inline-flex items-center gap-2 rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50 active:scale-[0.98]","data-testid":"wizard-next",children:[i("setupWizard.next","Next"),d.jsx(wg,{className:"h-4 w-4"})]}):d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("button",{onClick:()=>k(!1),disabled:h,className:"inline-flex items-center gap-2 rounded-lg border border-primary/30 px-4 py-2.5 text-sm font-medium text-primary transition-colors hover:bg-primary/10 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"wizard-create-only",children:[h?d.jsx(xi,{className:"h-4 w-4 animate-spin"}):d.jsx(Ns,{className:"h-4 w-4"}),i("setupWizard.createOnly","Create Only")]}),d.jsxs("button",{onClick:()=>k(!0),disabled:h,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50 active:scale-[0.98]","data-testid":"wizard-create-deploy",children:[h?d.jsx(xi,{className:"h-4 w-4 animate-spin"}):d.jsx(Ih,{className:"h-4 w-4"}),i("setupWizard.createAndDeploy","Create & Deploy")]})]})]})]})}function Nct({mode:i,onSelect:e}){const{t}=xe(),n=[{id:"standard",icon:ai,gradient:"from-violet-500 to-indigo-600"},{id:"api",icon:Su,gradient:"from-emerald-500 to-teal-600"}];return d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-semibold text-foreground",children:t("setupWizard.typeTitle","What kind of agent?")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t("setupWizard.typeDesc","Choose the type of agent you want to create")}),d.jsx("div",{className:"mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2","data-testid":"type-grid",children:n.map(s=>{const r=s.icon,o=i===s.id;return d.jsxs("button",{onClick:()=>e(s.id),className:be("group relative flex flex-col items-center gap-4 rounded-xl border-2 p-8 text-center transition-all duration-200",o?"border-primary bg-primary/5 shadow-lg shadow-primary/10":"border-border hover:border-primary/40 hover:shadow-md"),"data-testid":`type-${s.id}`,children:[d.jsx("div",{className:be("flex h-16 w-16 items-center justify-center rounded-2xl bg-linear-to-br text-white shadow-lg transition-transform group-hover:scale-110",s.gradient),children:d.jsx(r,{className:"h-8 w-8"})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-lg font-semibold text-foreground",children:s.id==="standard"?t("setupWizard.standardAgent","Standard Agent"):t("setupWizard.apiAgent","API Agent")}),d.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground leading-relaxed",children:s.id==="standard"?t("setupWizard.standardDesc","Conversational AI powered by an LLM with optional tools, quick replies, and sentiment analysis"):t("setupWizard.apiDesc","Import an OpenAPI/Swagger specification to auto-generate an AI agent that can call your APIs")})]}),o&&d.jsx("div",{className:"absolute inset-e-3 top-3 flex h-7 w-7 items-center justify-center rounded-full bg-primary text-primary-foreground shadow",children:d.jsx(Ns,{className:"h-4 w-4"})})]},s.id)})})]})}function Ect({name:i,systemPrompt:e,onNameChange:t,onPromptChange:n}){const{t:s}=xe();return d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-semibold text-foreground",children:s("setupWizard.infoTitle","Agent Identity")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s("setupWizard.infoDesc","Give your agent a name and personality")}),d.jsxs("div",{className:"mt-6 space-y-5",children:[d.jsxs("div",{children:[d.jsxs("label",{htmlFor:"wizard-name",className:"mb-1.5 block text-sm font-medium text-foreground",children:[s("setupWizard.agentName","Agent Name")," *"]}),d.jsx("input",{id:"wizard-name",type:"text",value:i,onChange:r=>t(r.target.value),placeholder:s("setupWizard.namePlaceholder","e.g. Customer Support Bot"),className:"w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"wizard-agent-name",autoFocus:!0})]}),d.jsxs("div",{children:[d.jsxs("label",{htmlFor:"wizard-prompt",className:"mb-1.5 block text-sm font-medium text-foreground",children:[s("setupWizard.systemPrompt","System Prompt")," *"]}),d.jsx("textarea",{id:"wizard-prompt",value:e,onChange:r=>n(r.target.value),placeholder:s("setupWizard.promptPlaceholder","You are a helpful AI assistant that..."),rows:5,className:"w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-y transition-shadow font-mono","data-testid":"wizard-system-prompt"}),d.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:s("setupWizard.promptHint","This is the instruction that shapes how your agent behaves and responds.")})]})]})]})}function Lct({provider:i,model:e,apiKey:t,baseUrl:n,onProviderChange:s,onModelChange:r,onApiKeyChange:o,onBaseUrlChange:a}){const{t:l}=xe(),c=Hj(i),u=L.useMemo(()=>yct[i]??[],[i]),h=`model-suggestions-${i}`,g=wct(i);return d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-semibold text-foreground",children:l("setupWizard.llmTitle","LLM Configuration")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:l("setupWizard.llmDesc","Choose the AI model that powers your agent")}),d.jsxs("div",{className:"mt-6 space-y-5",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1.5 block text-sm font-medium text-foreground",children:l("setupWizard.provider","Provider")}),d.jsxs("div",{className:"relative",children:[d.jsx("select",{value:i,onChange:f=>s(f.target.value),className:"w-full appearance-none rounded-lg border border-input bg-background px-3 py-2.5 pe-10 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"wizard-provider",children:np.map(f=>d.jsx("option",{value:f.id,children:f.name},f.id))}),d.jsx(Rn,{className:"pointer-events-none absolute inset-e-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"})]})]}),d.jsxs("div",{children:[d.jsxs("label",{htmlFor:"wizard-model",className:"mb-1.5 block text-sm font-medium text-foreground",children:[l("setupWizard.model","Model")," *"]}),d.jsx("input",{id:"wizard-model",type:"text",list:h,value:e,onChange:f=>r(f.target.value),placeholder:l("setupWizard.modelPlaceholder","e.g. {{model}} (or any model your provider supports)",{model:(c==null?void 0:c.defaultModel)??""}),className:"w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"wizard-model",autoComplete:"off"}),d.jsx("datalist",{id:h,children:u.map(f=>d.jsx("option",{value:f},f))}),d.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:l("setupWizard.modelHint","Type any model name supported by your provider, or pick one from the suggestions")})]}),(c==null?void 0:c.needsKey)!==!1&&d.jsxs("div",{children:[d.jsxs("label",{htmlFor:"wizard-apikey",className:"mb-1.5 block text-sm font-medium text-foreground",children:[l("setupWizard.apiKey","API Key")," *"]}),d.jsx(Rd,{value:t,onChange:o,placeholder:"sk-...",testId:"wizard-apikey"})]}),d.jsxs("div",{children:[d.jsxs("label",{htmlFor:"wizard-baseurl",className:"mb-1.5 block text-sm font-medium text-foreground",children:[l("setupWizard.baseUrl","Base URL")," ",!g&&d.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",l("setupWizard.optional","optional"),")"]}),g&&d.jsx("span",{className:"text-primary font-normal",children:"*"})]}),d.jsx("input",{id:"wizard-baseurl",type:"url",value:n,onChange:f=>a(f.target.value),placeholder:i==="ollama"?"http://localhost:11434":i==="jlama"?"http://localhost:8080":l("setupWizard.baseUrlPlaceholder","Custom endpoint URL"),className:"w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"wizard-baseurl"}),d.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:g?l("setupWizard.baseUrlHintLocal","Required — the URL where your local model server is running"):l("setupWizard.baseUrlHintCloud","Only needed if using a proxy, private deployment, or Azure OpenAI endpoint")})]})]})]})}function Dct({spec:i,specUrl:e,specInputMode:t,apiBaseUrl:n,apiAuth:s,endpoints:r,onSpecChange:o,onSpecUrlChange:a,onModeChange:l,onApiBaseUrlChange:c,onApiAuthChange:u,onEndpointsChange:h}){const{t:g}=xe(),f=L.useRef(null),[m,x]=L.useState(!1),v=[{id:"url",icon:A7e,label:g("setupWizard.specByUrl","URL")},{id:"file",icon:qv,label:g("setupWizard.specByFile","File")},{id:"paste",icon:TSe,label:g("setupWizard.specByPaste","Paste")}];async function _(){if(e.trim()){x(!0);try{const C=await fetch(e);if(!C.ok)throw new Error(`HTTP ${C.status}`);const E=await C.text();o(E),ze.success(g("setupWizard.specFetched","Specification loaded!"))}catch{ze.error(g("setupWizard.specFetchError","Failed to fetch specification"))}finally{x(!1)}}}function w(C){var T;const E=(T=C.target.files)==null?void 0:T[0];if(!E)return;const D=new FileReader;D.onload=()=>{o(D.result),ze.success(g("setupWizard.specLoaded","File loaded: {{name}}",{name:E.name}))},D.readAsText(E)}function k(C){C.preventDefault();const E=C.dataTransfer.files[0];if(!E)return;const D=new FileReader;D.onload=()=>{o(D.result),l("file"),ze.success(g("setupWizard.specLoaded","File loaded: {{name}}",{name:E.name}))},D.readAsText(E)}return d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-semibold text-foreground",children:g("setupWizard.apiSpecTitle","OpenAPI Specification")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:g("setupWizard.apiSpecDesc","Provide your API's OpenAPI/Swagger spec")}),d.jsx("div",{className:"mt-4 flex rounded-lg border border-border bg-secondary/30 p-1","data-testid":"spec-mode-tabs",children:v.map(C=>{const E=C.icon;return d.jsxs("button",{onClick:()=>l(C.id),className:be("flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition-all",t===C.id?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[d.jsx(E,{className:"h-4 w-4"}),C.label]},C.id)})}),d.jsxs("div",{className:"mt-4 space-y-4",children:[t==="url"&&d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"url",value:e,onChange:C=>a(C.target.value),placeholder:"https://api.example.com/openapi.json",className:"flex-1 rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"wizard-spec-url"}),d.jsxs("button",{onClick:_,disabled:m||!e.trim(),className:"inline-flex items-center gap-2 rounded-lg bg-primary px-4 py-2.5 text-sm font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed","data-testid":"wizard-fetch-spec",children:[m?d.jsx(xi,{className:"h-4 w-4 animate-spin"}):d.jsx(Su,{className:"h-4 w-4"}),g("setupWizard.fetch","Fetch")]})]}),t==="file"&&d.jsxs("div",{onDrop:k,onDragOver:C=>C.preventDefault(),className:"flex flex-col items-center justify-center rounded-xl border-2 border-dashed border-border bg-secondary/20 p-8 text-center transition-colors hover:border-primary/40","data-testid":"wizard-spec-dropzone",children:[d.jsx(qv,{className:"mb-3 h-8 w-8 text-muted-foreground"}),d.jsx("p",{className:"text-sm font-medium text-foreground",children:g("setupWizard.dropFile","Drop your OpenAPI file here")}),d.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:g("setupWizard.dropHint","JSON or YAML format")}),d.jsxs("button",{onClick:()=>{var C;return(C=f.current)==null?void 0:C.click()},className:"mt-3 inline-flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",children:[d.jsx(qv,{className:"h-3.5 w-3.5"}),g("setupWizard.browse","Browse Files")]}),d.jsx("input",{ref:f,type:"file",accept:".json,.yaml,.yml",onChange:w,className:"hidden","data-testid":"wizard-spec-file"})]}),t==="paste"&&d.jsx("textarea",{value:i,onChange:C=>o(C.target.value),placeholder:g("setupWizard.pasteSpec","Paste your OpenAPI/Swagger JSON or YAML here..."),rows:10,className:"w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-y transition-shadow font-mono","data-testid":"wizard-spec-paste"}),i&&d.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-emerald-500/10 px-3 py-2 text-sm text-emerald-600 dark:text-emerald-400",children:[d.jsx(Xl,{className:"h-4 w-4 shrink-0"}),g("setupWizard.specReady","Specification loaded ({{chars}} chars)",{chars:i.length.toLocaleString()})]}),d.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"mb-1.5 block text-sm font-medium text-foreground",children:[g("setupWizard.apiBaseUrlLabel","API Base URL")," ",d.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",g("setupWizard.optional","optional"),")"]})]}),d.jsx("input",{type:"url",value:n,onChange:C=>c(C.target.value),placeholder:"https://api.example.com",className:"w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"wizard-api-baseurl"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"mb-1.5 block text-sm font-medium text-foreground",children:[g("setupWizard.apiAuthLabel","API Auth Header")," ",d.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",g("setupWizard.optional","optional"),")"]})]}),d.jsx(Rd,{value:s,onChange:u,placeholder:"Bearer sk-...",testId:"wizard-api-auth"})]})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"mb-1.5 block text-sm font-medium text-foreground",children:[g("setupWizard.endpointFilter","Endpoint Filter")," ",d.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",g("setupWizard.optional","optional"),")"]})]}),d.jsx("input",{type:"text",value:r,onChange:C=>h(C.target.value),placeholder:g("setupWizard.endpointFilterPlaceholder","Comma-separated: GET /users, POST /orders"),className:"w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"wizard-endpoints"})]})]})]})}function Tct({state:i,onChange:e}){const{t}=xe();return d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-semibold text-foreground",children:t("setupWizard.featuresTitle","Features & Options")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t("setupWizard.featuresDesc","Customize your agent's capabilities")}),d.jsxs("div",{className:"mt-6 space-y-4",children:[i.mode==="standard"&&d.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-3",children:[d.jsx(OS,{icon:Fie,label:t("setupWizard.introMessage","Intro Message"),description:t("setupWizard.introMessageDesc","Greeting shown when a conversation starts"),checked:i.introMessage.length>0,onChange:n=>e({introMessage:n?i.introMessage||"Hello! How can I help you today?":""}),"data-testid":"wizard-toggle-intro"}),i.introMessage.length>0&&d.jsx("textarea",{value:i.introMessage,onChange:n=>e({introMessage:n.target.value}),rows:2,className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-none transition-shadow","data-testid":"wizard-intro-text"})]}),d.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-3",children:[d.jsx(OS,{icon:TSe,label:t("setupWizard.structuredOutput","Structured Output"),description:t("setupWizard.structuredOutputDesc","LLM responds with a JSON object instead of plain text"),checked:i.enableQuickReplies||i.enableSentimentAnalysis,onChange:n=>{e(n?{enableQuickReplies:!0}:{enableQuickReplies:!1,enableSentimentAnalysis:!1})},"data-testid":"wizard-toggle-structured"}),(i.enableQuickReplies||i.enableSentimentAnalysis)&&d.jsxs("div",{className:"space-y-3 ps-9",children:[d.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-amber-500/10 px-3 py-2 text-[11px] text-amber-700 dark:text-amber-400","data-testid":"structured-output-info",children:[d.jsx(_d,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:t("setupWizard.structuredOutputInfo","Enabling this changes how the LLM responds: instead of plain text, it returns a JSON object with structured fields. A JSON schema is appended to your system prompt, and the model is set to JSON response mode.")})]}),d.jsx(OS,{icon:Ll,label:t("setupWizard.quickReplies","Quick Replies"),description:t("setupWizard.quickRepliesDesc","LLM generates clickable reply suggestions"),checked:i.enableQuickReplies,onChange:n=>e({enableQuickReplies:n}),"data-testid":"wizard-toggle-qr"}),d.jsx(OS,{icon:l7,label:t("setupWizard.sentiment","Sentiment Analysis"),description:t("setupWizard.sentimentDesc","Track user mood, intent and urgency in real-time"),checked:i.enableSentimentAnalysis,onChange:n=>e({enableSentimentAnalysis:n}),"data-testid":"wizard-toggle-sentiment"})]})]}),i.mode==="standard"&&d.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-3",children:[d.jsx(OS,{icon:zb,label:t("setupWizard.builtInTools","Built-in Tools"),description:t("setupWizard.builtInToolsDesc","Enable EDDI's built-in tool library (calculator, datetime, etc.)"),checked:i.enableBuiltInTools,onChange:n=>e({enableBuiltInTools:n}),"data-testid":"wizard-toggle-tools"}),i.enableBuiltInTools&&d.jsxs("div",{className:"space-y-3 ps-9",children:[d.jsxs("div",{className:"flex items-center gap-1 rounded-lg border border-border bg-background p-0.5",role:"radiogroup","aria-label":t("setupWizard.builtInTools","Built-in Tools"),"data-testid":"wizard-tool-selection-mode",children:[d.jsxs("button",{type:"button",role:"radio","aria-checked":!i.builtInToolsWhitelist,onClick:()=>e({builtInToolsWhitelist:""}),className:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-all ${i.builtInToolsWhitelist?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground shadow-sm"}`,"data-testid":"wizard-tool-mode-all",children:[d.jsx(Ns,{className:"h-3 w-3"}),t("setupWizard.allTools","All Tools")]}),d.jsxs("button",{type:"button",role:"radio","aria-checked":!!i.builtInToolsWhitelist,onClick:()=>{i.builtInToolsWhitelist||e({builtInToolsWhitelist:wv.join(",")})},className:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-all ${i.builtInToolsWhitelist?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,"data-testid":"wizard-tool-mode-specific",children:[d.jsx(RSe,{className:"h-3 w-3"}),t("setupWizard.selectSpecific","Select Specific")]})]}),!i.builtInToolsWhitelist&&d.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-sky-500/10 px-3 py-2 text-xs text-sky-700 dark:text-sky-400","data-testid":"wizard-all-tools-info",children:[d.jsx(_d,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:t("setupWizard.allToolsInfo",'All {{count}} built-in tools will be available to your agent. Switch to "Select Specific" to restrict which tools are enabled.',{count:wv.length})})]}),i.builtInToolsWhitelist&&(()=>{const n=i.builtInToolsWhitelist.split(",").filter(Boolean);return d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:t("setupWizard.availableTools","Available Tools")}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:t("setupWizard.toolCount","{{selected}} of {{total}} selected",{selected:n.length,total:wv.length})})]}),d.jsx("div",{className:"flex flex-wrap gap-1.5","data-testid":"wizard-tools-whitelist",children:wv.map(s=>{const r=n.includes(s);return d.jsxs("button",{type:"button","aria-pressed":r,onClick:()=>{const o=r?n.filter(a=>a!==s):[...n,s];e({builtInToolsWhitelist:o.length>0?o.join(","):""})},className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1.5 text-xs font-medium transition-all ${r?"bg-primary/15 text-primary border border-primary/30 shadow-sm":"bg-secondary/50 text-muted-foreground border border-transparent hover:border-border hover:text-foreground"}`,"data-testid":`wizard-tool-chip-${s}`,children:[r&&d.jsx(Ns,{className:"h-3 w-3"}),s]},s)})})]})})()]})]}),d.jsxs("div",{className:"mt-2 rounded-lg border border-primary/20 bg-primary/5 p-4",children:[d.jsx(OS,{icon:Ih,label:t("setupWizard.autoDeploy","Auto-Deploy"),description:t("setupWizard.autoDeployDesc","Deploy the agent immediately after creation"),checked:i.deploy,onChange:n=>e({deploy:n}),"data-testid":"wizard-toggle-deploy"}),i.deploy&&d.jsxs("div",{className:"mt-3 flex items-center gap-3 ps-9",children:[d.jsxs("label",{className:"text-sm font-medium text-foreground",children:[t("setupWizard.environment","Environment"),":"]}),d.jsxs("div",{className:"relative",children:[d.jsxs("select",{value:i.environment,onChange:n=>e({environment:n.target.value}),className:"appearance-none rounded-lg border border-input bg-background px-3 py-1.5 pe-8 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"wizard-environment",children:[d.jsx("option",{value:"production",children:t("setupWizard.envProduction","Production")}),d.jsx("option",{value:"test",children:t("setupWizard.envTest","Test")})]}),d.jsx(Rn,{className:"pointer-events-none absolute inset-e-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"})]})]})]})]})]})}function Ict({state:i,error:e}){const{t}=xe(),n=Hj(i.provider),s=[[t("setupWizard.reviewType","Type"),i.mode==="api"?t("setupWizard.apiAgent","API Agent"):t("setupWizard.standardAgent","Standard Agent")],[t("setupWizard.reviewName","Name"),i.name],[t("setupWizard.reviewPrompt","System Prompt"),i.systemPrompt.length>80?i.systemPrompt.slice(0,80)+"…":i.systemPrompt],[t("setupWizard.reviewProvider","Provider"),(n==null?void 0:n.name)??i.provider],[t("setupWizard.reviewModel","Model"),i.model]];return i.mode==="api"&&i.openApiSpec&&s.push([t("setupWizard.reviewSpec","OpenAPI Spec"),`${i.openApiSpec.length.toLocaleString()} chars`]),i.introMessage&&s.push([t("setupWizard.reviewIntro","Intro Message"),i.introMessage.length>60?i.introMessage.slice(0,60)+"…":i.introMessage]),i.enableQuickReplies&&s.push([t("setupWizard.quickReplies","Quick Replies"),"✓"]),i.enableSentimentAnalysis&&s.push([t("setupWizard.sentiment","Sentiment Analysis"),"✓"]),i.enableBuiltInTools&&s.push([t("setupWizard.builtInTools","Built-in Tools"),"✓"]),s.push([t("setupWizard.reviewDeploy","Deploy"),i.deploy?`✓ (${i.environment})`:"—"]),d.jsxs("div",{"data-testid":"wizard-review",children:[d.jsx("h2",{className:"text-xl font-semibold text-foreground",children:t("setupWizard.reviewTitle","Review & Create")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t("setupWizard.reviewDesc","Review your configuration before creating the agent")}),d.jsx("div",{className:"mt-6 rounded-lg border border-border divide-y divide-border overflow-hidden",children:s.map(([r,o],a)=>d.jsxs("div",{className:be("flex items-start justify-between gap-4 px-4 py-3",a%2===0&&"bg-secondary/30"),children:[d.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:r}),d.jsx("span",{className:"text-sm font-medium text-foreground text-end break-all max-w-xs",children:o})]},r))}),e&&d.jsxs("div",{className:"mt-4 flex items-start gap-2 rounded-lg bg-destructive/10 px-4 py-3 text-sm text-destructive",children:[d.jsx(Lo,{className:"mt-0.5 h-4 w-4 shrink-0"}),e]})]})}function OS({icon:i,label:e,description:t,checked:n,onChange:s,"data-testid":r}){return d.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg p-0.5 transition-colors",children:[d.jsxs("div",{className:"relative mt-0.5 flex h-5 w-9 shrink-0 items-center rounded-full transition-colors duration-200",style:{backgroundColor:n?"var(--color-primary)":"var(--color-border)"},children:[d.jsx("span",{className:be("absolute h-4 w-4 rounded-full bg-white shadow-sm transition-transform duration-200",n?"translate-x-4":"translate-x-0.5")}),d.jsx("input",{type:"checkbox",checked:n,onChange:o=>s(o.target.checked),className:"sr-only","data-testid":r})]}),d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx(i,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-foreground",children:e}),d.jsx("p",{className:"text-xs text-muted-foreground",children:t})]})]})]})}function kDe({connected:i,className:e}){const{t}=xe();return d.jsxs("span",{className:be("inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-medium transition-colors duration-300",i?"text-emerald-600 dark:text-emerald-400":"text-muted-foreground",e),"data-testid":"stream-badge",children:[d.jsx("span",{className:be("inline-block h-1.5 w-1.5 rounded-full",i?"bg-emerald-500 animate-pulse":"bg-muted-foreground/50 animate-pulse"),"aria-hidden":"true"}),d.jsx("span",{role:"status","aria-live":"polite",children:i?t("stream.live","Live"):t("stream.reconnecting","Reconnecting…")})]})}const k_={status:["coordinator","status"],deadLetters:["coordinator","dead-letters"]};function Act(){return hn({queryKey:k_.status,queryFn:wEe,refetchInterval:5e3})}function Rct(){return hn({queryKey:k_.deadLetters,queryFn:XJe,refetchInterval:1e4})}function Mct(){const i=cn();return Kt({mutationFn:ZJe,onSuccess:()=>{i.invalidateQueries({queryKey:k_.deadLetters}),i.invalidateQueries({queryKey:k_.status})}})}function Pct(){const i=cn();return Kt({mutationFn:JJe,onSuccess:()=>{i.invalidateQueries({queryKey:k_.deadLetters}),i.invalidateQueries({queryKey:k_.status})}})}function Oct(){const i=cn();return Kt({mutationFn:eet,onSuccess:()=>{i.invalidateQueries({queryKey:k_.deadLetters}),i.invalidateQueries({queryKey:k_.status})}})}const Nme=20;function jct(){const[i,e]=L.useState(null),[t,n]=L.useState(!1),[s,r]=L.useState([]),o=L.useRef(null),a=L.useCallback(()=>{try{const l=tet();o.current=l,l.addEventListener("status",c=>{try{const u=JSON.parse(c.data);e(u),n(!0);const h={...u,receivedAt:new Date().toISOString()};r(g=>{const f=[...g,h];return f.length>Nme?f.slice(-Nme):f})}catch{}}),l.onerror=()=>{n(!1),l.close(),setTimeout(a,5e3)},l.onopen=()=>{n(!0)}}catch{n(!1)}},[]);return L.useEffect(()=>(a(),()=>{var l;(l=o.current)==null||l.close()}),[a]),{liveStatus:i,sseConnected:t,eventHistory:s}}function Fct(i){try{return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(i))}catch{return i}}function Bct(){const{t:i}=xe(),e=$s(te=>te.maybeAutoStart);L.useEffect(()=>{const te=setTimeout(()=>e("coordinator"),500);return()=>clearTimeout(te)},[e]);const{data:t,isLoading:n,refetch:s}=Act(),{data:r,isLoading:o,refetch:a}=Rct(),{liveStatus:l,sseConnected:c,eventHistory:u}=jct(),h=Mct(),g=Pct(),f=Oct(),[m,x]=L.useState(!1),[v,_]=L.useState(10),[w,k]=L.useState(new Set),C=l??t,E=(C==null?void 0:C.coordinatorType)==="nats",D=(C==null?void 0:C.connected)??!1,T=L.useRef(null);L.useEffect(()=>(T.current&&clearInterval(T.current),T.current=window.setInterval(()=>{s(),a()},v*1e3),()=>{T.current&&clearInterval(T.current)}),[v,s,a]);const I=L.useRef(null),[R,P]=L.useState(null);L.useEffect(()=>{if(!C)return;const te=Date.now();if(I.current){const H=(te-I.current.time)/1e3;if(H>0){const Q=(C.totalProcessed-I.current.count)/H;P(Math.max(0,Q))}}I.current={count:C.totalProcessed,time:te}},[C]);const j=L.useMemo(()=>{if(!C)return null;const te=C.totalProcessed+C.totalDeadLettered;return te===0?100:Math.round(C.totalProcessed/te*100)},[C]),B=L.useMemo(()=>C?Object.keys(C.queueDepths).length:0,[C]),U=L.useMemo(()=>C?Object.values(C.queueDepths).reduce((te,H)=>te+H,0):0,[C]),$=L.useCallback(te=>{k(H=>{const Q=new Set(H);return Q.has(te)?Q.delete(te):Q.add(te),Q})},[]),K=L.useMemo(()=>{if(!r||r.length===0)return[];const te=new Map;for(const H of r){const Q=H.error.includes("timeout")?"Timeout":H.error.includes("503")||H.error.includes("502")?"Backend Unavailable":H.error.includes("401")||H.error.includes("403")?"Auth Error":H.error.includes("rate")?"Rate Limited":"Other";te.set(Q,(te.get(Q)??0)+1)}return[...te.entries()].sort((H,Q)=>Q[1]-H[1])},[r]),z=te=>{h.mutate(te,{onSuccess:()=>ze.success(i("coordinator.replaySuccess","Dead-letter replayed")),onError:()=>ze.error(i("coordinator.replayError","Failed to replay"))})},G=te=>{g.mutate(te,{onSuccess:()=>ze.success(i("coordinator.discardSuccess","Dead-letter discarded")),onError:()=>ze.error(i("coordinator.discardError","Failed to discard"))})},ne=()=>{f.mutate(void 0,{onSuccess:te=>{ze.success(i("coordinator.purgeSuccess",`Purged ${te} entries`)),x(!1)},onError:()=>ze.error(i("coordinator.purgeError","Failed to purge"))})};return d.jsxs("div",{className:"space-y-6 p-6",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(AE,{className:"h-7 w-7 text-accent"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("h1",{className:"text-2xl font-bold text-foreground",children:i("coordinator.title","Coordinator Dashboard")}),d.jsx("p",{className:"text-sm text-muted-foreground",children:i("coordinator.subtitle","Monitor conversation processing and manage dead-letter entries")})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(xi,{className:"h-4 w-4 text-muted-foreground animate-spin",style:{animationDuration:`${v}s`}}),d.jsxs("select",{value:v,onChange:te=>_(Number(te.target.value)),className:"h-8 appearance-none rounded-lg border border-input bg-background pe-6 ps-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary","data-testid":"refresh-interval",children:[d.jsx("option",{value:5,children:"5s"}),d.jsx("option",{value:10,children:"10s"}),d.jsx("option",{value:30,children:"30s"}),d.jsx("option",{value:60,children:"60s"})]}),R!==null&&d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-accent/10 px-2.5 py-1 text-xs font-semibold text-accent","data-testid":"throughput-badge",children:[d.jsx(Oie,{className:"h-3.5 w-3.5"}),R<.1?"<0.1":R.toFixed(1)," ",i("coordinator.tasksPerSec","tasks/s")]})]})]}),n&&!C?d.jsx("div",{className:"cq-stat-grid",children:[...Array(4)].map((te,H)=>d.jsxs("div",{className:"animate-pulse rounded-xl border border-border bg-card p-5",children:[d.jsx("div",{className:"h-4 w-24 rounded bg-muted"}),d.jsx("div",{className:"mt-3 h-8 w-16 rounded bg-muted"})]},H))}):C?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"rounded-xl border border-border bg-card p-5","data-testid":"coordinator-connection-card",children:d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("div",{className:`flex h-12 w-12 items-center justify-center rounded-xl ${D?"bg-emerald-500/10":"bg-red-500/10"}`,children:E?d.jsx(ESe,{className:`h-6 w-6 ${D?"text-emerald-500":"text-red-500"}`}):d.jsx(rb,{className:`h-6 w-6 ${D?"text-emerald-500":"text-red-500"}`})}),d.jsxs("div",{className:"flex-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:`inline-flex h-2.5 w-2.5 rounded-full ${D?"bg-emerald-500 animate-pulse":"bg-red-500"}`}),d.jsx("span",{className:`text-lg font-semibold ${D?"text-emerald-500":"text-red-500"}`,children:C.connectionStatus}),d.jsx("span",{className:`ms-2 rounded-full px-2.5 py-0.5 text-xs font-medium ${E?"bg-blue-500/10 text-blue-500":"bg-purple-500/10 text-purple-500"}`,"data-testid":"coordinator-type-card",children:E?"NATS JetStream":"In-Memory"})]}),d.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[i("coordinator.activeConversations","Active conversations"),": ",C.activeConversations]})]}),d.jsx(kDe,{connected:c})]})}),d.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[d.jsxs("div",{className:"rounded-xl border border-border bg-card p-5","data-testid":"coordinator-processed-card",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[d.jsx(Xl,{className:"h-4 w-4 text-emerald-500"}),i("coordinator.processed","Tasks Processed")]}),d.jsx("p",{className:"mt-2 text-2xl font-bold text-foreground tabular-nums",children:C.totalProcessed.toLocaleString()})]}),d.jsxs("div",{className:"rounded-xl border border-border bg-card p-5","data-testid":"coordinator-dead-letter-card",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[d.jsx(Vi,{className:"h-4 w-4 text-amber-500"}),i("coordinator.deadLettered","Dead-Lettered")]}),d.jsx("p",{className:`mt-2 text-2xl font-bold tabular-nums ${C.totalDeadLettered>0?"text-amber-500":"text-foreground"}`,children:C.totalDeadLettered.toLocaleString()})]}),d.jsxs("div",{className:"rounded-xl border border-border bg-card p-5","data-testid":"coordinator-success-rate-card",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[d.jsx(YSe,{className:"h-4 w-4 text-blue-500"}),i("coordinator.successRate","Success Rate")]}),d.jsx("p",{className:`mt-2 text-2xl font-bold tabular-nums ${j!==null&&j<90?"text-amber-500":"text-emerald-500"}`,children:j!==null?`${j}%`:"—"}),j!==null&&C.totalProcessed+C.totalDeadLettered>0&&d.jsxs("div",{className:"mt-2 flex h-2 overflow-hidden rounded-full bg-muted","data-testid":"success-rate-bar",children:[d.jsx("div",{className:"bg-emerald-500 transition-all",style:{width:`${j}%`}}),d.jsx("div",{className:"bg-red-400 transition-all",style:{width:`${100-j}%`}})]})]})]})]}):d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border-2 border-dashed border-border py-16",children:[d.jsx(AE,{className:"h-12 w-12 text-muted-foreground/40"}),d.jsx("p",{className:"mt-4 text-lg font-medium text-muted-foreground",children:i("coordinator.empty","No coordinator data available")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground/70",children:i("coordinator.emptyHint","The coordinator service may still be starting up. Data will appear automatically.")})]}),K.length>0&&d.jsx("div",{className:"flex flex-wrap gap-2",children:K.map(([te,H])=>d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-card px-3 py-1 text-xs font-medium text-muted-foreground",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-red-400"}),te,": ",H]},te))}),d.jsxs("div",{className:"rounded-xl border border-border bg-card p-5","data-testid":"coordinator-queues",children:[d.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:i("coordinator.activeQueues","Active Queues")}),B>0&&d.jsxs("span",{className:"rounded-full bg-accent/10 px-2.5 py-0.5 text-xs font-semibold text-accent tabular-nums",children:[U," ",i("coordinator.totalPending","pending")]})]}),C&&Object.keys(C.queueDepths).length>0?d.jsx("div",{className:"space-y-2",children:Object.entries(C.queueDepths).map(([te,H])=>d.jsxs("div",{className:"flex items-center gap-3 rounded-lg bg-muted/50 px-3 py-2",children:[d.jsxs(Kn,{to:"/manage/conversations",className:"flex-1 truncate font-mono text-sm text-foreground hover:text-primary transition-colors",title:te,children:[te,d.jsx(To,{className:"ms-1.5 inline h-3 w-3 text-muted-foreground"})]}),d.jsxs("span",{className:"rounded-full bg-accent/10 px-2.5 py-0.5 text-sm font-semibold text-accent tabular-nums",children:[H," ",i("coordinator.queued","queued")]})]},te))}):d.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-muted-foreground",children:[d.jsx(Xl,{className:"h-5 w-5 text-emerald-500/50"}),i("coordinator.noActiveQueues","No active conversations being processed")]})]}),u.length>0&&d.jsxs("div",{className:"rounded-xl border border-border bg-card p-5","data-testid":"coordinator-event-history",children:[d.jsxs("h2",{className:"mb-3 flex items-center gap-2 text-lg font-semibold text-foreground",children:[d.jsx(Zr,{className:"h-4 w-4 text-muted-foreground"}),i("coordinator.eventHistory","Event History"),d.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["(",i("coordinator.lastNSnapshots",`Last ${u.length} snapshots`),")"]})]}),d.jsx("div",{className:"max-h-48 overflow-y-auto space-y-0.5 rounded-lg bg-muted/30 p-2 font-mono text-[11px]",children:[...u].reverse().map((te,H)=>d.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1 text-muted-foreground hover:bg-muted/50 transition-colors",children:[d.jsxs("span",{className:"text-foreground/40 tabular-nums",children:["[",Fct(te.receivedAt),"]"]}),d.jsxs("span",{className:"text-emerald-500 tabular-nums",children:["✓",te.totalProcessed.toLocaleString()]}),d.jsxs("span",{className:`tabular-nums ${te.totalDeadLettered>0?"text-red-400":"text-muted-foreground/40"}`,children:["✗",te.totalDeadLettered.toLocaleString()]}),d.jsxs("span",{className:"text-blue-400 tabular-nums",children:["⧗",Object.keys(te.queueDepths).length,"q"]})]},H))})]}),d.jsxs("div",{className:"rounded-xl border border-border bg-card","data-testid":"coordinator-dead-letters",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-4",children:[d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:i("coordinator.deadLetterTitle","Dead-Letter Queue")}),d.jsx("div",{className:"flex items-center gap-2",children:r&&r.length>0&&(m?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:i("coordinator.confirmPurge","Purge all?")}),d.jsx("button",{onClick:ne,disabled:f.isPending,className:"rounded-lg bg-red-500 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-red-600 disabled:opacity-50",children:i("coordinator.yes","Yes")}),d.jsx("button",{onClick:()=>x(!1),className:"rounded-lg border border-border px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:bg-muted",children:i("coordinator.cancel","Cancel")})]}):d.jsxs("button",{onClick:()=>x(!0),className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:border-red-500/50 hover:text-red-500","data-testid":"purge-dead-letters-btn",children:[d.jsx(_n,{className:"h-3.5 w-3.5"}),i("coordinator.purgeAll","Purge All")]}))})]}),o?d.jsx("div",{className:"p-8 text-center",children:d.jsx("div",{className:"mx-auto h-6 w-6 animate-spin rounded-full border-2 border-accent border-t-transparent"})}):!r||r.length===0?d.jsxs("div",{className:"p-8 text-center text-muted-foreground","data-testid":"dead-letters-empty",children:[d.jsx(Xl,{className:"mx-auto mb-2 h-8 w-8 text-emerald-500/50"}),d.jsx("p",{children:i("coordinator.noDeadLetters","No dead-letter entries")})]}):d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full","data-testid":"dead-letters-table",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-border text-start text-sm text-muted-foreground",children:[d.jsx("th",{className:"px-5 py-3 text-start font-medium",children:i("coordinator.colId","ID")}),d.jsx("th",{className:"px-5 py-3 text-start font-medium",children:i("coordinator.colConversation","Conversation")}),d.jsx("th",{className:"px-5 py-3 text-start font-medium",children:i("coordinator.colError","Error")}),d.jsx("th",{className:"px-5 py-3 text-start font-medium",children:i("coordinator.colTime","Time")}),d.jsx("th",{className:"px-5 py-3 text-end font-medium",children:i("coordinator.colActions","Actions")})]})}),d.jsx("tbody",{children:r.map(te=>d.jsxs("tr",{className:"border-b border-border/50 transition-colors hover:bg-muted/30",children:[d.jsx("td",{className:"px-5 py-3",children:d.jsx("code",{className:"text-xs text-muted-foreground",children:te.id})}),d.jsx("td",{className:"px-5 py-3",children:d.jsx("code",{className:"text-sm text-foreground",children:te.conversationId})}),d.jsxs("td",{className:"max-w-[300px] px-5 py-3 text-sm text-red-400",children:[d.jsx("div",{className:"truncate",title:te.error,children:te.error}),te.payload&&d.jsxs("button",{onClick:()=>$(te.id),className:"mt-1 inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground transition-colors","data-testid":`toggle-payload-${te.id}`,children:[w.has(te.id)?d.jsx(Rn,{className:"h-3 w-3"}):d.jsx(hs,{className:"h-3 w-3"}),d.jsx(Sh,{className:"h-3 w-3"}),i("coordinator.payload","Payload")]}),w.has(te.id)&&te.payload&&d.jsx("pre",{className:"mt-1 max-h-40 overflow-auto rounded-lg bg-card/50 p-2 text-xs text-foreground/80 border border-border/50",children:(()=>{try{return JSON.stringify(JSON.parse(te.payload),null,2)}catch{return te.payload}})()})]}),d.jsx("td",{className:"px-5 py-3 text-sm text-muted-foreground tabular-nums",children:new Date(te.timestamp).toLocaleString()}),d.jsx("td",{className:"px-5 py-3",children:d.jsxs("div",{className:"flex items-center justify-end gap-1",children:[d.jsx("button",{onClick:()=>z(te.id),disabled:h.isPending,title:i("coordinator.replay","Replay"),className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/10 hover:text-accent disabled:opacity-50","data-testid":`replay-${te.id}`,children:d.jsx(S_,{className:"h-4 w-4"})}),d.jsx("button",{onClick:()=>G(te.id),disabled:g.isPending,title:i("coordinator.discard","Discard"),className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-red-500/10 hover:text-red-500 disabled:opacity-50","data-testid":`discard-${te.id}`,children:d.jsx(_n,{className:"h-4 w-4"})})]})})]},te.id))})]})})]})]})}const n0="/schedulestore/schedules";async function Hct(i){return Oe.get(`${n0}`)}async function Wct(i){return Oe.post(n0,i)}async function Vct(i){return Oe.delete(`${n0}/${i}`)}async function zct(i){return Oe.post(`${n0}/${i}/enable`)}async function Uct(i){return Oe.post(`${n0}/${i}/disable`)}async function $ct(i){return Oe.post(`${n0}/${i}/fire`)}async function qct(i){return Oe.post(`${n0}/${i}/retry`)}async function Kct(i,e=20){return Oe.get(`${n0}/${i}/fires?limit=${e}`)}const N_={all:["schedules"],list:i=>["schedules","list",i],detail:i=>["schedules","detail",i],fireLogs:i=>["schedules","fire-logs",i],failed:["schedules","failed"]};function Gct(i){return hn({queryKey:N_.list(i),queryFn:()=>Hct(),refetchInterval:1e4})}function Yct(i,e=!0){return hn({queryKey:N_.fireLogs(i),queryFn:()=>Kct(i,20),enabled:e&&!!i,refetchInterval:15e3})}function Qct(){const i=cn();return Kt({mutationFn:Wct,onSuccess:()=>{i.invalidateQueries({queryKey:N_.all})}})}function Xct(){const i=cn();return Kt({mutationFn:Vct,onSuccess:()=>{i.invalidateQueries({queryKey:N_.all})}})}function Zct(){const i=cn();return Kt({mutationFn:({id:e,enable:t})=>t?zct(e):Uct(e),onSuccess:()=>{i.invalidateQueries({queryKey:N_.all})}})}function Jct(){const i=cn();return Kt({mutationFn:$ct,onSuccess:()=>{i.invalidateQueries({queryKey:N_.all})}})}function edt(){const i=cn();return Kt({mutationFn:qct,onSuccess:()=>{i.invalidateQueries({queryKey:N_.all}),i.invalidateQueries({queryKey:N_.failed})}})}function tdt({schedule:i}){const{t:e}=xe();if(!i.enabled&&i.fireStatus!=="FAILED"&&i.fireStatus!=="DEAD_LETTERED")return d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-zinc-500/10 px-2.5 py-0.5 text-xs font-semibold text-zinc-400",children:[d.jsx(Bie,{className:"h-3 w-3"}),e("schedules.statusDisabled","Disabled")]});const t={PENDING:{bg:"bg-emerald-500/10",text:"text-emerald-500",label:e("schedules.statusActive","Active")},CLAIMED:{bg:"bg-blue-500/10",text:"text-blue-500",label:e("schedules.statusRunning","Running")},EXECUTING:{bg:"bg-blue-500/10",text:"text-blue-500",label:e("schedules.statusExecuting","Executing")},COMPLETED:{bg:"bg-emerald-500/10",text:"text-emerald-500",label:e("schedules.statusActive","Active")},FAILED:{bg:"bg-amber-500/10",text:"text-amber-500",label:e("schedules.statusFailed","Failed")},DEAD_LETTERED:{bg:"bg-red-500/10",text:"text-red-500",label:e("schedules.statusDeadLettered","Dead-Lettered")}},n=t[i.fireStatus]??t.PENDING;return d.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-semibold ${n.bg} ${n.text}`,children:[i.fireStatus==="DEAD_LETTERED"&&d.jsx(Vi,{className:"h-3 w-3"}),n.label]})}function ndt({type:i}){const{t:e}=xe();return i==="HEARTBEAT"?d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-semibold text-primary",children:[d.jsx(Vie,{className:"h-3 w-3"}),e("schedules.typeHeartbeat","Heartbeat")]}):d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-semibold text-primary",children:[d.jsx(a7,{className:"h-3 w-3"}),e("schedules.typeCron","Cron")]})}function idt({scheduleId:i}){const{t:e}=xe(),[t,n]=L.useState(!1),{data:s,isLoading:r}=Yct(i,t);return d.jsx("tr",{children:d.jsxs("td",{colSpan:8,className:"px-5 py-0",children:[d.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1.5 py-2 text-xs text-muted-foreground transition-colors hover:text-primary","aria-expanded":t,children:[t?d.jsx(Rn,{className:"h-3 w-3"}):d.jsx(hs,{className:"h-3 w-3"}),e("schedules.fireHistory","Fire History")]}),t&&d.jsx("div",{className:"mb-3 rounded-lg border border-border/50 bg-muted/30",children:r?d.jsx("div",{className:"p-4 text-center",children:d.jsx("div",{className:"mx-auto h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):!s||s.length===0?d.jsx("p",{className:"p-4 text-center text-xs text-muted-foreground",children:e("schedules.noFireHistory","No fire history yet")}):d.jsxs("table",{className:"w-full text-xs",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-border/50 text-muted-foreground",children:[d.jsx("th",{className:"px-3 py-2 text-start font-medium",children:e("schedules.logFired","Fired")}),d.jsx("th",{className:"px-3 py-2 text-start font-medium",children:e("schedules.logDuration","Duration")}),d.jsx("th",{className:"px-3 py-2 text-start font-medium",children:e("schedules.logResult","Result")}),d.jsx("th",{className:"px-3 py-2 text-start font-medium",children:e("status.error","Error")})]})}),d.jsx("tbody",{children:s.map((o,a)=>d.jsxs("tr",{className:"border-b border-border/30",children:[d.jsx("td",{className:"px-3 py-1.5 tabular-nums text-foreground",children:new Date(o.firedAt).toLocaleString()}),d.jsx("td",{className:"px-3 py-1.5 tabular-nums text-muted-foreground",children:o.durationMs!=null?`${o.durationMs}ms`:"—"}),d.jsx("td",{className:"px-3 py-1.5",children:o.success?d.jsx("span",{className:"text-emerald-500",children:"✓"}):d.jsx("span",{className:"text-red-400",children:"✗"})}),d.jsx("td",{className:"max-w-[300px] truncate px-3 py-1.5 text-red-400",title:o.error,children:o.error??"—"})]},o.id??a))})]})})]})})}function sdt({open:i,onClose:e}){const{t}=xe(),n=Qct(),[s,r]=L.useState("CRON"),[o,a]=L.useState(""),[l,c]=L.useState(""),[u,h]=L.useState("0 9 * * MON-FRI"),[g,f]=L.useState(300),[m,x]=L.useState("Hello"),[v,_]=L.useState("production"),[w,k]=L.useState("new"),C=L.useCallback(()=>{a(""),c(""),r("CRON"),h("0 9 * * MON-FRI"),f(300),x("Hello"),_("production"),k("new")},[]);if(L.useEffect(()=>{i&&C()},[i,C]),L.useEffect(()=>{if(!i)return;const T=I=>{I.key==="Escape"&&e()};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[i,e]),!i)return null;const E=o.trim().length>0&&l.trim().length>0&&(s==="CRON"?u.trim().length>0:g>=60),D=()=>{if(!E)return;const T={name:o.trim(),triggerType:s,agentId:l.trim(),agentVersion:0,environment:v,message:m,conversationStrategy:s==="HEARTBEAT"?"persistent":w,enabled:!0,...s==="CRON"?{cronExpression:u.trim()}:{heartbeatIntervalSeconds:g}};n.mutate(T,{onSuccess:()=>{ze.success(t("schedules.createSuccess","Schedule created successfully")),e()},onError:()=>ze.error(t("schedules.createError","Failed to create schedule"))})};return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"dialog","aria-modal":"true","aria-labelledby":"create-schedule-title",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:e}),d.jsxs("div",{className:"relative w-full max-w-lg rounded-2xl border border-border bg-card p-6 shadow-2xl",children:[d.jsx("h2",{id:"create-schedule-title",className:"mb-4 text-lg font-bold text-foreground",children:t("schedules.createTitle","Create Schedule")}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-muted-foreground",children:t("schedules.name","Name")}),d.jsx("input",{value:o,onChange:T=>a(T.target.value),placeholder:t("schedules.namePlaceholder","e.g. Daily health check"),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary focus:outline-none"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-muted-foreground",children:t("schedules.triggerType","Trigger Type")}),d.jsx("div",{className:"flex gap-1 rounded-lg border border-border bg-muted/30 p-1",children:["CRON","HEARTBEAT"].map(T=>d.jsxs("button",{onClick:()=>{r(T),T==="HEARTBEAT"&&k("persistent")},className:`flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-all ${s===T?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[T==="CRON"?d.jsx(a7,{className:"h-3.5 w-3.5"}):d.jsx(Vie,{className:"h-3.5 w-3.5"}),T==="CRON"?t("schedules.typeCron","Cron"):t("schedules.typeHeartbeat","Heartbeat")]},T))})]}),s==="CRON"?d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-muted-foreground",children:t("schedules.cronExpression","Cron Expression")}),d.jsx("input",{value:u,onChange:T=>h(T.target.value),placeholder:"0 9 * * MON-FRI",className:"w-full rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary focus:outline-none"}),d.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t("schedules.cronHelp","5-field format: minute hour day-of-month month day-of-week")})]}):d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-muted-foreground",children:t("schedules.interval","Interval (seconds)")}),d.jsx("input",{type:"number",min:60,value:g,onChange:T=>f(Number(T.target.value)),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground focus:border-primary focus:outline-none"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-muted-foreground",children:t("schedules.agentId","Agent ID")}),d.jsx("input",{value:l,onChange:T=>c(T.target.value),placeholder:t("schedules.agentIdPlaceholder","Enter agent ID..."),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary focus:outline-none"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-muted-foreground",children:t("schedules.environment","Environment")}),d.jsxs("select",{value:v,onChange:T=>_(T.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground focus:border-primary focus:outline-none",children:[d.jsx("option",{value:"production",children:t("schedules.envProduction","Production")}),d.jsx("option",{value:"test",children:t("schedules.envTest","Test")})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-muted-foreground",children:t("schedules.message","Message")}),d.jsx("input",{value:m,onChange:T=>x(T.target.value),placeholder:t("schedules.messagePlaceholder","Message to send to agent"),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary focus:outline-none"})]}),s==="CRON"&&d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-muted-foreground",children:t("schedules.conversationStrategy","Conversation Strategy")}),d.jsxs("select",{value:w,onChange:T=>k(T.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground focus:border-primary focus:outline-none",children:[d.jsx("option",{value:"new",children:t("schedules.strategyNew","New (fresh conversation each fire)")}),d.jsx("option",{value:"persistent",children:t("schedules.strategyPersistent","Persistent (reuse same conversation)")})]})]})]}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.jsx("button",{onClick:e,className:"rounded-lg border border-border px-4 py-2 text-sm font-medium text-foreground transition-colors hover:bg-muted",children:t("common.cancel","Cancel")}),d.jsx("button",{onClick:D,disabled:!E||n.isPending,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:n.isPending?t("schedules.creating","Creating..."):t("common.create","Create")})]})]})]})}function rdt(){var C,E;const{t:i}=xe(),e=$s(D=>D.maybeAutoStart);L.useEffect(()=>{const D=setTimeout(()=>e("schedules"),500);return()=>clearTimeout(D)},[e]);const{data:t,isLoading:n}=Gct(),s=Xct(),r=Zct(),o=Jct(),a=edt(),[l,c]=L.useState(!1),[u,h]=L.useState(null),g=(t==null?void 0:t.length)??0,f=(t==null?void 0:t.filter(D=>D.enabled).length)??0,m=(t==null?void 0:t.filter(D=>D.fireStatus==="FAILED"||D.fireStatus==="DEAD_LETTERED").length)??0,x=(E=(C=t==null?void 0:t.filter(D=>D.enabled&&D.nextFire))==null?void 0:C.sort((D,T)=>(D.nextFire??0)-(T.nextFire??0)))==null?void 0:E[0],v=D=>{r.mutate({id:D.id,enable:!D.enabled},{onSuccess:()=>ze.success(D.enabled?i("schedules.disabled","Schedule disabled"):i("schedules.enabled","Schedule enabled")),onError:()=>ze.error(i("schedules.toggleError","Failed to toggle schedule"))})},_=D=>{o.mutate(D,{onSuccess:()=>ze.success(i("schedules.fired","Schedule fired successfully")),onError:()=>ze.error(i("schedules.fireError","Failed to fire schedule"))})},w=D=>{s.mutate(D,{onSuccess:()=>{ze.success(i("schedules.deleteSuccess","Schedule deleted")),h(null)},onError:()=>ze.error(i("schedules.deleteError","Failed to delete schedule"))})},k=D=>{a.mutate(D,{onSuccess:()=>ze.success(i("schedules.retrySuccess","Schedule re-queued")),onError:()=>ze.error(i("schedules.retryError","Failed to retry schedule"))})};return d.jsxs("div",{className:"space-y-6 p-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Zr,{className:"h-7 w-7 text-primary"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-foreground",children:i("schedules.title","Schedules")}),d.jsx("p",{className:"text-sm text-muted-foreground",children:i("schedules.subtitle","Manage scheduled agent triggers — cron jobs and heartbeats")})]})]}),d.jsxs("button",{onClick:()=>c(!0),className:"flex items-center gap-1.5 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90","data-testid":"create-schedule-btn",children:[d.jsx(Gt,{className:"h-4 w-4"}),i("schedules.create","Create Schedule")]})]}),n?d.jsx("div",{className:"cq-stat-grid",children:[...Array(4)].map((D,T)=>d.jsxs("div",{className:"animate-pulse rounded-xl border border-border bg-card p-5",children:[d.jsx("div",{className:"h-4 w-24 rounded bg-muted"}),d.jsx("div",{className:"mt-3 h-8 w-16 rounded bg-muted"})]},T))}):d.jsxs("div",{className:"cq-stat-grid","data-tour":"schedules-stats",children:[d.jsxs("div",{className:"rounded-xl border border-border bg-card p-5","data-testid":"schedules-total-card",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[d.jsx(Zr,{className:"h-4 w-4"}),i("schedules.total","Total Schedules")]}),d.jsx("p",{className:"mt-2 text-2xl font-bold tabular-nums text-foreground",children:g})]}),d.jsxs("div",{className:"rounded-xl border border-border bg-card p-5","data-testid":"schedules-active-card",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[d.jsx(nc,{className:"h-4 w-4"}),i("schedules.active","Active")]}),d.jsx("p",{className:"mt-2 text-2xl font-bold tabular-nums text-emerald-500",children:f})]}),d.jsxs("div",{className:"rounded-xl border border-border bg-card p-5","data-testid":"schedules-failed-card",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[d.jsx(Vi,{className:"h-4 w-4"}),i("schedules.failedCount","Failed / Dead-Lettered")]}),d.jsx("p",{className:`mt-2 text-2xl font-bold tabular-nums ${m>0?"text-amber-500":"text-foreground"}`,children:m})]}),d.jsxs("div",{className:"rounded-xl border border-border bg-card p-5","data-testid":"schedules-next-fire-card",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[d.jsx(a7,{className:"h-4 w-4"}),i("schedules.nextFireLabel","Next Fire")]}),d.jsx("p",{className:"mt-2 text-lg font-semibold tabular-nums text-foreground",children:x!=null&&x.nextFire?new Date(x.nextFire).toLocaleString():"—"}),x&&d.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:x.name})]})]}),d.jsxs("div",{className:"rounded-xl border border-border bg-card","data-testid":"schedules-table-container",children:[d.jsx("div",{className:"border-b border-border px-5 py-4",children:d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:i("schedules.tableTitle","All Schedules")})}),n?d.jsx("div",{className:"p-8 text-center",children:d.jsx("div",{className:"mx-auto h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):!t||t.length===0?d.jsxs("div",{className:"p-8 text-center text-muted-foreground","data-testid":"schedules-empty",children:[d.jsx(Zr,{className:"mx-auto mb-2 h-8 w-8 text-muted-foreground/50"}),d.jsx("p",{children:i("schedules.empty","No schedules yet")}),d.jsx("p",{className:"mt-1 text-xs",children:i("schedules.emptyHint","Create a schedule to automate agent triggers.")})]}):d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full","data-testid":"schedules-table",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-border text-start text-sm text-muted-foreground",children:[d.jsx("th",{className:"px-5 py-3 text-start font-medium",children:i("schedules.colName","Name")}),d.jsx("th",{className:"px-5 py-3 text-start font-medium",children:i("schedules.colType","Type")}),d.jsx("th",{className:"px-5 py-3 text-start font-medium",children:i("schedules.colSchedule","Schedule")}),d.jsx("th",{className:"px-5 py-3 text-start font-medium",children:i("schedules.colAgent","Agent")}),d.jsx("th",{className:"px-5 py-3 text-start font-medium",children:i("schedules.colStatus","Status")}),d.jsx("th",{className:"px-5 py-3 text-start font-medium",children:i("schedules.colNextFire","Next Fire")}),d.jsx("th",{className:"px-5 py-3 text-start font-medium",children:i("schedules.colLastFired","Last Fired")}),d.jsx("th",{className:"px-5 py-3 text-end font-medium",children:i("schedules.colActions","Actions")})]})}),d.jsx("tbody",{children:t.map(D=>d.jsxs(L.Fragment,{children:[d.jsxs("tr",{className:"border-b border-border/50 transition-colors hover:bg-muted/30",children:[d.jsx("td",{className:"px-5 py-3",children:d.jsx("span",{className:"font-medium text-foreground",children:D.name})}),d.jsx("td",{className:"px-5 py-3",children:d.jsx(ndt,{type:D.triggerType})}),d.jsxs("td",{className:"px-5 py-3",children:[d.jsx("code",{className:"text-xs text-muted-foreground",children:D.triggerType==="CRON"?D.cronExpression:`Every ${D.heartbeatIntervalSeconds}s`}),D.cronDescription&&d.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground/70",children:D.cronDescription})]}),d.jsx("td",{className:"px-5 py-3",children:d.jsx("code",{className:"text-xs text-foreground",children:D.agentId})}),d.jsxs("td",{className:"px-5 py-3",children:[d.jsx(tdt,{schedule:D}),D.failCount>0&&d.jsxs("span",{className:"ms-1.5 text-xs text-amber-500",children:["×",D.failCount]})]}),d.jsx("td",{className:"px-5 py-3 text-sm tabular-nums text-muted-foreground",children:D.nextFire?new Date(D.nextFire).toLocaleString():"—"}),d.jsx("td",{className:"px-5 py-3 text-sm tabular-nums text-muted-foreground",children:D.lastFired?new Date(D.lastFired).toLocaleString():"—"}),d.jsx("td",{className:"px-5 py-3",children:d.jsxs("div",{className:"flex items-center justify-end gap-1",children:[d.jsx("button",{onClick:()=>v(D),disabled:r.isPending,title:D.enabled?i("schedules.disable","Disable"):i("schedules.enable","Enable"),className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-primary/10 hover:text-primary disabled:opacity-50","data-testid":`toggle-${D.id}`,children:D.enabled?d.jsx(zie,{className:"h-4 w-4 text-emerald-500"}):d.jsx(GSe,{className:"h-4 w-4"})}),d.jsx("button",{onClick:()=>_(D.id),disabled:o.isPending,title:i("schedules.fireNow","Fire Now"),className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-primary/10 hover:text-primary disabled:opacity-50","data-testid":`fire-${D.id}`,children:d.jsx(Hie,{className:"h-4 w-4"})}),D.fireStatus==="DEAD_LETTERED"&&d.jsx("button",{onClick:()=>k(D.id),disabled:a.isPending,title:i("schedules.retry","Retry"),className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-amber-500/10 hover:text-amber-500 disabled:opacity-50","data-testid":`retry-${D.id}`,children:d.jsx(S_,{className:"h-4 w-4"})}),u===D.id?d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{onClick:()=>w(D.id),disabled:s.isPending,className:"rounded-md bg-red-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-red-600 disabled:opacity-50",children:i("common.delete","Delete")}),d.jsx("button",{onClick:()=>h(null),className:"rounded-md border border-border px-2 py-1 text-xs font-medium text-foreground transition-colors hover:bg-muted",children:i("common.cancel","Cancel")})]}):d.jsx("button",{onClick:()=>h(D.id),title:i("common.delete","Delete"),className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-red-500/10 hover:text-red-500 disabled:opacity-50","data-testid":`delete-${D.id}`,children:d.jsx(_n,{className:"h-4 w-4"})})]})})]}),d.jsx(idt,{scheduleId:D.id},`logs-${D.id}`)]},D.id))})]})})]}),d.jsx(sdt,{open:l,onClose:()=>c(!1)})]})}function odt(i=!1){return Oe.get(`/administration/orphans?includeDeleted=${i}`)}function adt(i=!0){return Oe.delete(`/administration/orphans?includeDeleted=${i}`)}const NDe=["orphans"];function ldt(i=!1){return hn({queryKey:[...NDe,{includeDeleted:i}],queryFn:()=>odt(i),enabled:!1})}function cdt(){const i=cn();return Kt({mutationFn:e=>adt(e),onSuccess:()=>{i.invalidateQueries({queryKey:NDe}),i.invalidateQueries({queryKey:["agents"]}),i.invalidateQueries({queryKey:["workflows"]}),i.invalidateQueries({queryKey:["resources"]})}})}function ddt(i){try{const e=i.startsWith("eddi://")?i.replace("eddi://","http://"):i,n=new URL(e,"http://dummy").pathname.split("/").filter(Boolean);return n[n.length-1]??i}catch{const e=i.split("/"),t=e[e.length-1]??i;return t.split("?")[0]??t}}function udt(i){try{const e=i.startsWith("eddi://")?i.replace("eddi://","http://"):i;return new URL(e,"http://dummy").searchParams.get("version")}catch{const e=i.match(/[?&]version=(\d+)/);return(e==null?void 0:e[1])??null}}function hdt(){const{t:i}=xe(),e=$s(k=>k.maybeAutoStart);L.useEffect(()=>{const k=setTimeout(()=>e("orphans"),500);return()=>clearTimeout(k)},[e]);const[t,n]=L.useState(!1),[s,r]=L.useState(!1),[o,a]=L.useState(new Set),{data:l,isFetching:c,refetch:u}=ldt(t),h=cdt(),g=L.useCallback(()=>{a(new Set),u()},[u]),f=L.useCallback(()=>{h.mutate(t,{onSuccess:k=>{ze.success(i("orphans.purgeSuccess",{count:k.deletedCount,defaultValue:`${k.deletedCount} orphans deleted`})),r(!1),a(new Set),u()},onError:()=>ze.error(i("common.error"))})},[h,t,i,u]),m=L.useMemo(()=>l!=null&&l.orphans?l.orphans.reduce((k,C)=>{const E=C.type;return k[E]||(k[E]=[]),k[E].push(C),k},{}):null,[l]),x=L.useCallback(k=>{a(C=>{const E=new Set(C);return E.has(k)?E.delete(k):E.add(k),E})},[]),v=L.useCallback(k=>{a(C=>{const E=new Set(C),D=k.every(T=>E.has(T.resourceUri));for(const T of k)D?E.delete(T.resourceUri):E.add(T.resourceUri);return E})},[]),_=L.useCallback(()=>{l!=null&&l.orphans&&a(k=>l.orphans.every(E=>k.has(E.resourceUri))?new Set:new Set(l.orphans.map(E=>E.resourceUri)))},[l]),w=L.useCallback(k=>{navigator.clipboard.writeText(k).then(()=>ze.success(i("common.copied","Copied")),()=>ze.error(i("common.error")))},[i]);return d.jsxs("div",{className:"space-y-6 p-6","data-testid":"orphans-page",children:[d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold text-foreground",children:[d.jsx(ASe,{className:"h-6 w-6 text-primary"}),i("orphans.title","Orphan Detection")]}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i("orphans.description","Find and clean up resources not referenced by any agent or package.")})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[d.jsx("input",{type:"checkbox",checked:t,onChange:k=>n(k.target.checked),className:"h-4 w-4 rounded border-input bg-background text-primary accent-primary","data-testid":"include-deleted-checkbox"}),i("orphans.includeDeleted","Include soft-deleted")]}),d.jsxs("button",{onClick:g,disabled:c,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50","data-testid":"scan-button",children:[c?d.jsx(ni,{className:"h-4 w-4 animate-spin"}):d.jsx(br,{className:"h-4 w-4"}),i("orphans.scan","Scan")]})]})]}),!l&&!c&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border-2 border-dashed border-border bg-card/50 px-6 py-16 text-center","data-testid":"pre-scan-state",children:[d.jsx("div",{className:"mb-4 flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:d.jsx(zge,{className:"h-8 w-8 text-primary"})}),d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:i("orphans.scanPromptTitle","Scan your platform")}),d.jsx("p",{className:"mt-2 max-w-md text-sm text-muted-foreground",children:i("orphans.scanPromptDesc","Find extension configs (rules, API calls, LLMs, outputs) that are not referenced by any workflow or agent. Clean up unused resources to keep your platform tidy.")}),d.jsxs("button",{onClick:g,disabled:c,className:"mt-6 inline-flex items-center gap-2 rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50","data-testid":"pre-scan-button",children:[c?d.jsx(ni,{className:"h-4 w-4 animate-spin"}):d.jsx(zge,{className:"h-4 w-4"}),i("orphans.runScan","Run Scan")]})]}),c&&!l&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-border bg-card px-6 py-16 text-center",children:[d.jsx(ni,{className:"mb-4 h-10 w-10 animate-spin text-primary"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:i("orphans.scanning","Scanning resources…")})]}),l&&d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"rounded-xl border border-border bg-card p-4 shadow-sm",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[l.totalOrphans===0?d.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-green-500/10",children:d.jsx(Rie,{className:"h-5 w-5 text-green-500"})}):d.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-amber-500/10",children:d.jsx(Vi,{className:"h-5 w-5 text-amber-500"})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-lg font-semibold text-foreground",children:l.totalOrphans===0?i("orphans.noOrphans","No orphans found"):i("orphans.found",{count:l.totalOrphans,defaultValue:`${l.totalOrphans} orphan(s) found`})}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:[i("orphans.lastScanned","Last scanned"),": ",new Date().toLocaleTimeString()]})]})]}),d.jsx("div",{className:"flex items-center gap-2",children:l.totalOrphans>0&&d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:_,className:"rounded-lg border border-input bg-background px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-muted","data-testid":"select-all-btn",children:o.size===l.orphans.length?i("orphans.deselectAll","Deselect All"):i("orphans.selectAll","Select All")}),o.size>0&&d.jsxs("button",{onClick:()=>r(!0),className:"inline-flex items-center gap-1.5 rounded-lg bg-destructive px-3 py-1.5 text-xs font-medium text-destructive-foreground transition-colors hover:bg-destructive/90","data-testid":"delete-selected-btn",children:[d.jsx(_n,{className:"h-3.5 w-3.5"}),i("orphans.deleteSelected",{count:o.size,defaultValue:`Delete ${o.size} selected`})]}),s?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm font-medium text-destructive",children:i("orphans.confirmPurge","Are you sure?")}),d.jsxs("button",{onClick:f,disabled:h.isPending,className:"inline-flex items-center gap-1.5 rounded-lg bg-destructive px-3 py-1.5 text-xs font-medium text-destructive-foreground transition-colors hover:bg-destructive/90 disabled:opacity-50","data-testid":"confirm-purge-button",children:[h.isPending?d.jsx(ni,{className:"h-3.5 w-3.5 animate-spin"}):d.jsx(_n,{className:"h-3.5 w-3.5"}),i("orphans.purge","Purge All")]}),d.jsx("button",{onClick:()=>r(!1),className:"rounded-lg px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted",children:i("common.cancel","Cancel")})]}):o.size===0&&d.jsxs("button",{onClick:()=>r(!0),className:"inline-flex items-center gap-2 rounded-lg bg-destructive px-4 py-2 text-sm font-medium text-destructive-foreground transition-colors hover:bg-destructive/90","data-testid":"purge-button",children:[d.jsx(_n,{className:"h-4 w-4"}),i("orphans.purge","Purge All")]})]})})]})}),m&&Object.entries(m).map(([k,C])=>{const E=Ort(k),D=E.icon,T=C.every(I=>o.has(I.resourceUri));return d.jsxs("div",{className:"rounded-xl border border-border bg-card shadow-sm overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 bg-muted/30",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("input",{type:"checkbox",checked:T,onChange:()=>v(C),className:"h-4 w-4 rounded border-input bg-background accent-primary","data-testid":`group-checkbox-${k}`}),d.jsx(D,{className:`h-4 w-4 ${E.color}`}),d.jsx("h3",{className:"text-sm font-semibold text-foreground",children:E.label})]}),d.jsx("span",{className:"rounded-full bg-muted px-2.5 py-0.5 text-xs font-medium text-muted-foreground",children:C.length})]}),d.jsx("div",{className:"divide-y divide-border/50",children:C.map((I,R)=>{const P=ddt(I.resourceUri),j=udt(I.resourceUri);return d.jsxs("div",{className:`flex items-center gap-3 px-4 py-3 transition-colors hover:bg-muted/30 ${o.has(I.resourceUri)?"bg-primary/5":""}`,children:[d.jsx("input",{type:"checkbox",checked:o.has(I.resourceUri),onChange:()=>x(I.resourceUri),className:"h-4 w-4 shrink-0 rounded border-input bg-background accent-primary","data-testid":`orphan-checkbox-${R}`}),d.jsx(D,{className:`h-4 w-4 shrink-0 ${E.color} opacity-50`}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:I.name||P}),d.jsxs("div",{className:"mt-0.5 flex items-center gap-2",children:[d.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:P}),d.jsx("button",{onClick:()=>w(I.resourceUri),className:"shrink-0 rounded p-0.5 text-muted-foreground/50 hover:text-muted-foreground transition-colors",title:i("common.copy","Copy"),children:d.jsx(mo,{className:"h-3 w-3"})})]})]}),j&&d.jsxs("span",{className:"shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary",children:["v",j]}),I.deleted&&d.jsx("span",{className:"shrink-0 rounded bg-destructive/10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-destructive",children:i("orphans.softDeleted","Deleted")})]},`${I.resourceUri}-${R}`)})})]},k)})]})]})}const Eme=1e3,b2=ML(()=>({entries:[],connected:!1}));let Yp=null;function EDe(){try{Yp=Lse();const i=e=>{try{const t=JSON.parse(e.data);b2.setState(n=>{const s=[t,...n.entries];return{entries:s.length>Eme?s.slice(0,Eme):s}})}catch{}};Yp.addEventListener("log",i),Yp.onmessage=i,Yp.onerror=()=>{b2.setState({connected:!1}),Yp==null||Yp.close(),Yp=null,setTimeout(EDe,5e3)},Yp.onopen=()=>{b2.setState({connected:!0})}}catch{b2.setState({connected:!1})}}typeof window<"u"&&typeof EventSource<"u"&&setTimeout(EDe,2e3);const LDe={recent:i=>["logs","recent",i],history:i=>["logs","history",i],instance:["logs","instance"]};function gdt(i={}){return hn({queryKey:LDe.history(i),queryFn:()=>xJe(i)})}function fdt(){return hn({queryKey:LDe.instance,queryFn:vJe,staleTime:1/0})}const WU=500;function pdt(i){return!!(i.agentId||i.conversationId||i.level)}function mdt(i={}){const e=b2(f=>f.entries),[t,n]=L.useState(()=>pdt(i)?[]:e.slice(0,WU)),[s,r]=L.useState(!1),[o,a]=L.useState(!1),l=L.useRef(null),c=L.useRef(!1),u=JSON.stringify(i);L.useEffect(()=>{c.current=o},[o]);const h=L.useCallback(()=>{try{const f=Lse(i);l.current=f;const m=x=>{if(!c.current)try{const v=JSON.parse(x.data);n(_=>{const w=[v,..._];return w.length>WU?w.slice(0,WU):w})}catch{}};f.addEventListener("log",m),f.onmessage=m,f.onerror=()=>{r(!1),f.close(),setTimeout(h,5e3)},f.onopen=()=>{r(!0)}}catch{r(!1)}},[u]);L.useEffect(()=>(h(),()=>{var f;(f=l.current)==null||f.close()}),[u]);const g=L.useCallback(()=>{n([])},[]);return{entries:t,sseConnected:s,paused:o,setPaused:a,clearEntries:g}}const bdt={SEVERE:{label:"ERROR",className:"bg-red-500/15 text-red-400 border-red-500/30"},ERROR:{label:"ERROR",className:"bg-red-500/15 text-red-400 border-red-500/30"},FATAL:{label:"FATAL",className:"bg-red-600/20 text-red-300 border-red-600/40"},WARNING:{label:"WARN",className:"bg-amber-500/15 text-amber-400 border-amber-500/30"},WARN:{label:"WARN",className:"bg-amber-500/15 text-amber-400 border-amber-500/30"},INFO:{label:"INFO",className:"bg-blue-500/15 text-blue-400 border-blue-500/30"},CONFIG:{label:"CFG",className:"bg-sky-500/15 text-sky-400 border-sky-500/30"},FINE:{label:"DEBUG",className:"bg-gray-500/15 text-gray-400 border-gray-500/30"},DEBUG:{label:"DEBUG",className:"bg-gray-500/15 text-gray-400 border-gray-500/30"},FINER:{label:"TRACE",className:"bg-gray-500/10 text-gray-500 border-gray-500/20"},FINEST:{label:"TRACE",className:"bg-gray-500/10 text-gray-500 border-gray-500/20"},TRACE:{label:"TRACE",className:"bg-gray-500/10 text-gray-500 border-gray-500/20"}};function DDe({level:i}){const e=bdt[i==null?void 0:i.toUpperCase()]??{label:i??"?",className:"bg-gray-500/15 text-gray-400 border-gray-500/30"};return d.jsx("span",{className:`inline-flex min-w-14 items-center justify-center rounded border px-1.5 py-0.5 text-[10px] font-bold tracking-wider ${e.className}`,children:e.label})}function Wj(i){if(!i)return"—";const e=typeof i=="string"?new Date(i):new Date(i);try{return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}).format(e)}catch{return e.toLocaleTimeString()}}function xdt(){const{t:i}=xe(),e=$s(s=>s.maybeAutoStart);L.useEffect(()=>{const s=setTimeout(()=>e("logs"),500);return()=>clearTimeout(s)},[e]);const[t,n]=L.useState("live");return d.jsxs("div",{className:"flex h-full flex-col p-6","data-testid":"logs-page",children:[d.jsx("div",{className:"mb-4 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:d.jsxs("div",{children:[d.jsxs("h1",{className:"text-2xl font-bold text-foreground",children:[d.jsx($v,{className:"me-2 inline h-6 w-6"}),i("logs.title","Logs")]}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i("logs.description","Monitor real-time log stream or search historical logs.")})]})}),d.jsxs("div",{className:"mb-4 flex gap-1 rounded-lg border border-border bg-muted/30 p-1","data-tour":"logs-tabs",children:[d.jsxs("button",{className:`inline-flex flex-1 items-center justify-center gap-2 rounded-md px-3 py-2 text-sm font-medium transition-all ${t==="live"?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>n("live"),"data-testid":"tab-live",children:[d.jsx(zSe,{className:"h-4 w-4"}),i("logs.tabLive","Live")]}),d.jsxs("button",{className:`inline-flex flex-1 items-center justify-center gap-2 rounded-md px-3 py-2 text-sm font-medium transition-all ${t==="history"?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>n("history"),"data-testid":"tab-history",children:[d.jsx(PE,{className:"h-4 w-4"}),i("logs.tabHistory","History")]})]}),t==="live"?d.jsx(vdt,{}):d.jsx(_dt,{})]})}function vdt(){const{t:i}=xe(),[e,t]=L.useState(""),[n,s]=L.useState(""),r=L.useRef(null),[o,a]=L.useState(!0),l=L.useMemo(()=>({agentId:e||void 0,level:n||void 0}),[e,n]),{entries:c,sseConnected:u,paused:h,setPaused:g,clearEntries:f}=mdt(l),{data:m}=fdt(),[x,v]=L.useState(""),_=L.useMemo(()=>{if(!x.trim())return c;const C=x.toLowerCase();return c.filter(E=>(E.message??"").toLowerCase().includes(C)||(E.loggerName??"").toLowerCase().includes(C))},[c,x]),w=L.useMemo(()=>{const C={error:0,warn:0,info:0,debug:0};for(const E of c){const D=(E.level??"").toUpperCase();D==="ERROR"||D==="SEVERE"||D==="FATAL"?C.error++:D==="WARNING"||D==="WARN"?C.warn++:D==="INFO"?C.info++:C.debug++}return C},[c]),k=L.useCallback(()=>{if(_.length===0)return;const C=_.map(I=>`[${Wj(I.timestamp)}] [${I.level}] ${I.message}`).join(`
-`),E=new Blob([C],{type:"text/plain"}),D=URL.createObjectURL(E),T=document.createElement("a");T.href=D,T.download=`logs-${new Date().toISOString().slice(0,19).replace(/:/g,"-")}.txt`,T.click(),URL.revokeObjectURL(D)},[_]);return L.useEffect(()=>{o&&r.current&&!h&&(r.current.scrollTop=0)},[c.length,o,h]),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[d.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2","data-tour":"logs-filters",children:[d.jsx(kDe,{connected:u}),m&&d.jsx("span",{className:"rounded-full border border-border bg-muted/50 px-2.5 py-1 text-xs text-muted-foreground",children:m.instanceId}),d.jsx("div",{className:"flex-1"}),d.jsx(TDe,{value:e,onChange:t,testId:"filter-agent"}),d.jsxs("div",{className:"relative",children:[d.jsxs("select",{value:n,onChange:C=>s(C.target.value),className:"appearance-none rounded-lg border border-input bg-background pe-7 ps-3 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary","data-testid":"filter-level",children:[d.jsx("option",{value:"",children:i("logs.allLevels","All Levels")}),d.jsx("option",{value:"ERROR",children:"ERROR"}),d.jsx("option",{value:"WARNING",children:"WARN"}),d.jsx("option",{value:"INFO",children:"INFO"}),d.jsx("option",{value:"FINE",children:"DEBUG"})]}),d.jsx(Rn,{className:"pointer-events-none absolute inset-e-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"})]}),d.jsxs("button",{onClick:()=>g(!h),className:`inline-flex items-center gap-1.5 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors ${h?"border-amber-500/30 bg-amber-500/10 text-amber-400 hover:bg-amber-500/20":"border-input bg-background text-foreground hover:bg-muted"}`,"data-testid":"pause-button",children:[h?d.jsx(Hie,{className:"h-3.5 w-3.5"}):d.jsx(Bie,{className:"h-3.5 w-3.5"}),h?i("logs.resume","Resume"):i("logs.pause","Pause")]}),d.jsxs("button",{onClick:f,className:"inline-flex items-center gap-1.5 rounded-lg border border-input bg-background px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-muted","data-testid":"clear-button",children:[d.jsx(_n,{className:"h-3.5 w-3.5"}),i("logs.clear","Clear")]}),d.jsxs("button",{onClick:k,disabled:_.length===0,className:"inline-flex items-center gap-1.5 rounded-lg border border-input bg-background px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-50","data-testid":"export-logs-btn",children:[d.jsx(Q_,{className:"h-3.5 w-3.5"}),i("logs.export","Export")]})]}),c.length>0&&d.jsxs("div",{className:"mb-3 flex items-center gap-3 rounded-lg border border-border bg-card px-3 py-2","data-testid":"level-stats",children:[d.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-semibold text-red-400",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"}),w.error," ",i("logs.errors","errors")]}),d.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-semibold text-amber-400",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-500"}),w.warn," ",i("logs.warnings","warns")]}),d.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-semibold text-blue-400",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-blue-500"}),w.info," ",i("logs.infos","info")]}),d.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-semibold text-gray-400",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-gray-500"}),w.debug," ",i("logs.debugs","debug")]}),d.jsx("div",{className:"flex-1"}),d.jsxs("div",{className:"relative",children:[d.jsx(br,{className:"pointer-events-none absolute inset-s-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:x,onChange:C=>v(C.target.value),placeholder:i("logs.searchLogs","Search logs…"),className:"h-7 w-48 rounded-md border border-input bg-background ps-7 pe-2 text-xs placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary","data-testid":"text-search"})]})]}),d.jsx("div",{ref:r,className:"flex-1 overflow-auto rounded-xl border border-border bg-card",onScroll:C=>{const E=C.currentTarget;a(E.scrollTop<10)},children:c.length===0?d.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-8",children:u?d.jsxs(d.Fragment,{children:[d.jsx(zSe,{className:"h-10 w-10 text-muted-foreground/40 animate-pulse"}),d.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:i("logs.waitingForLogs","Waiting for logs...")}),d.jsx("p",{className:"text-xs text-muted-foreground/60",children:i("logs.waitingHint","Logs will appear here as they stream in from the backend.")})]}):d.jsxs(d.Fragment,{children:[d.jsx(ni,{className:"h-10 w-10 text-muted-foreground/40 animate-spin"}),d.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:i("logs.connectingStream","Connecting to stream...")})]})}):d.jsx("div",{className:"divide-y divide-border/50 font-mono text-xs",children:_.map((C,E)=>d.jsx(Sdt,{entry:C},`${C.timestamp}-${E}`))})}),d.jsx("div",{className:"mt-2 text-end text-xs text-muted-foreground",children:x&&_.length!==c.length?i("logs.filteredCount",{shown:_.length,total:c.length,defaultValue:`${_.length} of ${c.length} entries`}):i("logs.entryCount",{count:c.length,defaultValue:`${c.length} entries`})})]})}function _dt(){const{t:i}=xe(),[e,t]=L.useState({limit:100}),{data:n,isLoading:s,refetch:r}=gdt(e),o=L.useCallback((l,c)=>{t(u=>({...u,[l]:c||void 0,skip:0}))},[]),a=L.useCallback(l=>{t(c=>({...c,agentId:l||void 0,conversationId:void 0,skip:0}))},[]);return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[d.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[d.jsx(TDe,{value:e.agentId??"",onChange:a,testId:"history-filter-agent"}),d.jsx(Edt,{value:e.conversationId??"",onChange:l=>o("conversationId",l),agentId:e.agentId,testId:"history-filter-conversation"}),d.jsx("input",{type:"text",placeholder:i("logs.filterInstance","Instance ID..."),value:e.instanceId??"",onChange:l=>o("instanceId",l.target.value),className:"w-36 rounded-lg border border-input bg-background px-3 py-1.5 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary","data-testid":"history-filter-instance"}),d.jsx("div",{className:"flex-1"}),d.jsxs("button",{onClick:()=>r(),disabled:s,className:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50","data-testid":"history-search",children:[s?d.jsx(ni,{className:"h-3.5 w-3.5 animate-spin"}):d.jsx(PE,{className:"h-3.5 w-3.5"}),i("logs.search","Search")]})]}),d.jsx("div",{className:"flex-1 overflow-auto rounded-xl border border-border bg-card",children:s?d.jsx("div",{className:"flex h-full items-center justify-center p-8",children:d.jsx(ni,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):!n||n.length===0?d.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-8","data-testid":"history-empty",children:[d.jsx(PE,{className:"h-10 w-10 text-muted-foreground/40"}),d.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:i("logs.noHistoryLogs","No historical logs found.")}),d.jsx("p",{className:"text-xs text-muted-foreground/60",children:i("logs.noHistoryHint","Try adjusting the filters or search for a different agent or conversation.")})]}):d.jsx("div",{className:"divide-y divide-border/50 font-mono text-xs",children:n.map((l,c)=>d.jsxs("div",{className:"flex items-start gap-3 px-3 py-2 hover:bg-muted/30 transition-colors",children:[d.jsx("span",{className:"shrink-0 text-muted-foreground",children:Wj(l.timestamp)}),d.jsx(DDe,{level:l.level??"INFO"}),l.agentId&&d.jsx("span",{className:"shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary",children:l.agentId}),l.instanceId&&d.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:l.instanceId}),d.jsx("span",{className:"min-w-0 flex-1 break-all text-foreground",children:l.message})]},`${l.timestamp}-${c}`))})}),d.jsx("div",{className:"mt-2 text-end text-xs text-muted-foreground",children:n&&i("logs.entryCount",{count:n.length,defaultValue:`${n.length} entries`})})]})}function ydt(i){return/\n\s+at /.test(i)||/\nCaused by:/.test(i)}function wdt(i){const e=i.match(/(\n\s+at |\nCaused by:)/);return!e||e.index===void 0?{main:i,frames:""}:{main:i.substring(0,e.index),frames:i.substring(e.index)}}function Cdt(i){return(i.match(/(\n\s+at |\nCaused by:)/g)||[]).length}function Sdt({entry:i}){const[e,t]=L.useState(!1),{t:n}=xe(),s=i.message?ydt(i.message):!1,{main:r,frames:o}=s?wdt(i.message):{main:i.message,frames:""},a=s?Cdt(o):0,l=L.useCallback(()=>{const c=`[${Wj(i.timestamp)}] [${i.level}] ${i.message}`;navigator.clipboard.writeText(c)},[i]);return d.jsxs("div",{className:"group px-3 py-2 hover:bg-muted/30 transition-colors",children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("span",{className:"shrink-0 text-muted-foreground",children:Wj(i.timestamp)}),d.jsx(DDe,{level:i.level}),i.agentId&&d.jsx("span",{className:"shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary",children:i.agentId}),i.conversationId&&d.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:i.conversationId}),d.jsx("span",{className:"min-w-0 flex-1 break-all text-foreground",children:r}),d.jsx("button",{onClick:l,className:"shrink-0 opacity-0 group-hover:opacity-100 rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-all",title:n("logs.copyEntry","Copy log entry"),"data-testid":"copy-log-btn",children:d.jsx(mo,{className:"h-3 w-3"})})]}),s&&d.jsxs("div",{className:"ms-18 mt-1",children:[d.jsxs("button",{onClick:()=>t(!e),className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium text-red-400/80 transition-colors hover:bg-red-500/10 hover:text-red-400","data-testid":"stacktrace-toggle",children:[e?d.jsx(Rn,{className:"h-3 w-3"}):d.jsx(hs,{className:"h-3 w-3"}),e?n("logs.hideStacktrace","Hide stacktrace"):n("logs.showStacktrace",{count:a,defaultValue:`Show stacktrace (${a} frames)`})]}),e&&d.jsx("pre",{className:"mt-1 overflow-x-auto whitespace-pre rounded-lg border border-red-500/20 bg-red-500/5 p-2 text-[10px] leading-relaxed text-red-300/80",children:o.trim()})]})]})}function TDe({value:i,onChange:e,testId:t}){const{t:n}=xe(),{data:s}=nse();return d.jsxs("div",{className:"relative",children:[d.jsxs("select",{value:i,onChange:r=>e(r.target.value),className:"appearance-none rounded-lg border border-input bg-background pe-7 ps-3 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary","data-testid":t,children:[d.jsx("option",{value:"",children:n("logs.allAgents","All Agents")}),s==null?void 0:s.map(r=>d.jsx("option",{value:r.id,children:r.name||r.id},r.id))]}),d.jsx(Rn,{className:"pointer-events-none absolute inset-e-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"})]})}const kdt={READY:{i18nKey:"logs.stateReady",fallback:"Ready",className:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30"},IN_PROGRESS:{i18nKey:"logs.stateActive",fallback:"Active",className:"bg-blue-500/15 text-blue-400 border-blue-500/30"},ERROR:{i18nKey:"logs.stateError",fallback:"Error",className:"bg-red-500/15 text-red-400 border-red-500/30"},ENDED:{i18nKey:"logs.stateEnded",fallback:"Ended",className:"bg-gray-500/15 text-gray-400 border-gray-500/30"}};function Lme({state:i}){const{t:e}=xe(),t=kdt[i]??{i18nKey:"",fallback:i,className:"bg-gray-500/15 text-gray-400 border-gray-500/30"};return d.jsx("span",{className:`inline-flex items-center rounded border px-1.5 py-0.5 text-[10px] font-medium leading-none ${t.className}`,children:t.i18nKey?e(t.i18nKey,t.fallback):t.fallback})}function Dme(i){if(!i)return"—";const e=typeof i=="string"?new Date(i):new Date(i),n=Date.now()-e.getTime(),s=Math.floor(n/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const r=Math.floor(s/60);if(r<24)return`${r}h ago`;const o=Math.floor(r/24);return o<30?`${o}d ago`:e.toLocaleDateString()}function Ndt(i){return i?(typeof i=="string"?new Date(i):new Date(i)).toLocaleString():""}function Edt({value:i,onChange:e,agentId:t,testId:n}){const{t:s}=xe(),[r,o]=L.useState(!1),[a,l]=L.useState(""),c=L.useRef(null),u=L.useRef(null),{data:h,isLoading:g}=hn({queryKey:["logs","conversations-filter",t??"all"],queryFn:()=>PL(100,0,"",t??""),staleTime:6e4});L.useEffect(()=>{l("")},[t]);const f=L.useMemo(()=>{if(!h)return[];if(!a.trim())return h;const k=a.toLowerCase();return h.filter(C=>dg(C.resource).toLowerCase().includes(k)||(C.name||"").toLowerCase().includes(k)||(C.agentId||"").toLowerCase().includes(k)||(C.userId||"").toLowerCase().includes(k)||(C.conversationState||"").toLowerCase().includes(k))},[h,a]),x=/^[a-f0-9]{24}$/i.test(a.trim())&&!(h!=null&&h.some(k=>dg(k.resource)===a.trim())),v=h==null?void 0:h.find(k=>dg(k.resource)===i);L.useEffect(()=>{if(!r)return;const k=C=>{c.current&&!c.current.contains(C.target)&&o(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[r]),L.useEffect(()=>{r&&requestAnimationFrame(()=>{var k;return(k=u.current)==null?void 0:k.focus()})},[r]);const _=L.useCallback(k=>{k.key==="Escape"&&o(!1)},[]),w=L.useCallback(k=>{e(k),o(!1),l("")},[e]);return d.jsxs("div",{ref:c,className:"relative",onKeyDown:_,"data-testid":n,children:[d.jsxs("button",{onClick:()=>o(!r),className:"inline-flex items-center gap-2 rounded-lg border border-input bg-background pe-2 ps-3 py-1.5 text-xs text-foreground transition-colors hover:bg-muted focus:outline-none focus:ring-1 focus:ring-primary","data-testid":`${n}-trigger`,children:[d.jsx(Zl,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),v?d.jsxs("span",{className:"flex items-center gap-1.5 truncate max-w-[200px]",children:[d.jsx(Lme,{state:v.conversationState}),d.jsx("span",{className:"truncate",children:v.name||v.agentId||dg(v.resource).substring(0,10)}),d.jsx("span",{className:"text-muted-foreground",children:Dme(v.lastModifiedOn)})]}):d.jsx("span",{className:"text-muted-foreground",children:s("logs.allConversations","All Conversations")}),i?d.jsx(An,{className:"h-3 w-3 shrink-0 text-muted-foreground hover:text-foreground",onClick:k=>{k.stopPropagation(),w("")}}):d.jsx(Rn,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}),r&&d.jsxs("div",{className:"absolute inset-s-0 top-full z-50 mt-1 w-96 max-w-[calc(100vw-2rem)] rounded-xl border border-border bg-card shadow-xl shadow-black/20",children:[d.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[d.jsx(br,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),d.jsx("input",{ref:u,type:"text",value:a,onChange:k=>l(k.target.value),placeholder:s("logs.searchConversations","Search by ID, agent, user…"),className:"w-full bg-transparent text-xs text-foreground placeholder:text-muted-foreground focus:outline-none","data-testid":`${n}-search`}),a&&d.jsx("button",{onClick:()=>l(""),className:"text-muted-foreground hover:text-foreground",children:d.jsx(An,{className:"h-3 w-3"})})]}),d.jsxs("div",{className:"max-h-72 overflow-y-auto overscroll-contain","data-testid":`${n}-list`,children:[d.jsxs("button",{onClick:()=>w(""),className:`flex w-full items-center gap-2 px-3 py-2 text-start text-xs transition-colors hover:bg-muted/50 ${i?"text-foreground":"bg-primary/5 text-primary"}`,children:[!i&&d.jsx(Ns,{className:"h-3 w-3 shrink-0 text-primary"}),d.jsx(Zl,{className:`h-3.5 w-3.5 shrink-0 ${i?"text-muted-foreground":"text-primary"}`}),s("logs.allConversations","All Conversations")]}),g&&d.jsx("div",{className:"flex items-center justify-center py-6",children:d.jsx(ni,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!g&&f.map(k=>{const C=dg(k.resource),E=C===i;return d.jsxs("button",{onClick:()=>w(C),className:`flex w-full flex-col gap-1 px-3 py-2.5 text-start transition-colors hover:bg-muted/50 ${E?"bg-primary/5":""}`,title:Ndt(k.createdOn),children:[d.jsxs("div",{className:"flex items-center gap-2",children:[E&&d.jsx(Ns,{className:"h-3 w-3 shrink-0 text-primary"}),d.jsx(Lme,{state:k.conversationState}),d.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:k.name||k.agentId||"Unnamed"}),d.jsxs("span",{className:"ms-auto shrink-0 text-[10px] text-muted-foreground",children:[d.jsx(Zr,{className:"me-0.5 inline h-2.5 w-2.5"}),Dme(k.lastModifiedOn)]})]}),d.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground",children:[d.jsxs("span",{className:"font-mono",children:[C.substring(0,12),"…"]}),k.conversationStepSize!=null&&d.jsxs("span",{children:["· ",s("logs.stepsCount",{count:k.conversationStepSize,defaultValue:`${k.conversationStepSize} steps`})]}),k.userId&&d.jsxs("span",{className:"truncate",children:["· ",k.userId]})]})]},C)}),x&&d.jsxs("button",{onClick:()=>w(a.trim()),className:"flex w-full items-center gap-2 border-t border-border px-3 py-2.5 text-start text-xs text-primary transition-colors hover:bg-primary/5",children:[d.jsx(br,{className:"h-3.5 w-3.5 shrink-0"}),s("logs.useConversationId",{id:a.trim(),defaultValue:`Use ID: ${a.trim()}`})]}),!g&&f.length===0&&!x&&d.jsxs("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:[d.jsx(Zl,{className:"mx-auto mb-2 h-6 w-6 text-muted-foreground/30"}),s("logs.noConversationsFound","No conversations found")]})]})]})]})}const VU="default";function Ldt(){const{t:i}=xe(),e=$s(H=>H.maybeAutoStart);L.useEffect(()=>{const H=setTimeout(()=>e("secrets"),500);return()=>clearTimeout(H)},[e]);const[t,n]=L.useState(VU),[s,r]=L.useState(!1),[o,a]=L.useState(""),[l,c]=L.useState(""),[u,h]=L.useState(""),[g,f]=L.useState(!1),[m,x]=L.useState(null),[v,_]=L.useState(null),[w,k]=L.useState(""),[C,E]=L.useState(!1),[D,T]=L.useState([]),{data:I,isLoading:R}=SEe(t),{data:P}=Ise(),j=kEe(),B=uet(),U=het(),$=(P==null?void 0:P.available)===!1,K=L.useCallback(H=>{const Q=t===VU?`\${vault:${H}}`:`\${vault:${t}/${H}}`;navigator.clipboard.writeText(Q).then(()=>{ze.success(i("secrets.refCopied",{ref:Q,defaultValue:`Copied: ${Q}`}))})},[t,i]),z=L.useCallback(()=>{!o.trim()||!l.trim()||j.mutate({tenantId:t,keyName:o.trim(),value:l.trim(),description:u.trim()||void 0,allowedAgents:D.length>0?D:void 0},{onSuccess:()=>{ze.success(i("secrets.storeSuccess",{key:o,defaultValue:`Secret "${o}" stored`})),r(!1),a(""),c(""),h(""),f(!1),T([])},onError:H=>ze.error(H instanceof Error?H.message:String(H))})},[t,o,l,u,D,j,i]),G=L.useCallback(()=>{m&&B.mutate({tenantId:m.tenantId,keyName:m.keyName},{onSuccess:()=>{ze.success(i("secrets.deleteSuccess",{key:m.keyName,defaultValue:`Secret "${m.keyName}" deleted`})),x(null)},onError:H=>ze.error(H instanceof Error?H.message:String(H))})},[m,B,i]),ne=H=>{if(!H)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(H))}catch{return H}},te=L.useMemo(()=>H=>t===VU?`\${vault:${H}}`:`\${vault:${t}/${H}}`,[t]);return d.jsxs("div",{className:"space-y-6 p-6","data-testid":"secrets-page",children:[d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-foreground",children:i("secrets.title","Secrets Vault")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i("secrets.description","Manage encrypted secrets shared across all agents in a tenant. Values are never exposed.")})]}),d.jsx("div",{className:"flex items-center gap-3",children:d.jsxs("button",{onClick:()=>r(!0),disabled:$,title:$?i("secrets.vaultNotConfigured","Secrets vault is not configured"):void 0,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"create-secret-button",children:[d.jsx(Gt,{className:"h-4 w-4"}),i("secrets.create","Add Secret")]})})]}),$?d.jsxs("div",{className:"space-y-2 rounded-lg border border-destructive/30 bg-destructive/5 px-4 py-4","data-testid":"vault-not-configured",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Vi,{className:"h-4 w-4 shrink-0 text-destructive"}),d.jsx("span",{className:"text-sm font-semibold text-destructive",children:(P==null?void 0:P.error)||i("secrets.vaultNotConfigured","Secrets Vault is not configured")})]}),(P==null?void 0:P.reason)&&d.jsx("p",{className:"text-xs text-muted-foreground",children:P.reason}),(P==null?void 0:P.action)&&d.jsx("div",{className:"rounded-md bg-muted/50 px-3 py-2",children:d.jsx("code",{className:"break-all text-xs text-foreground",children:P.action})}),(P==null?void 0:P.docs)&&d.jsxs("a",{href:P.docs,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[d.jsx(To,{className:"h-3 w-3"}),i("secrets.viewDocs","View documentation")]})]}):d.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-primary/20 bg-primary/5 px-4 py-3","data-tour":"secrets-info",children:[d.jsx(_d,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),d.jsx("div",{className:"space-y-1",children:d.jsx("p",{className:"text-xs text-muted-foreground",children:i("secrets.scopeExplanation","Secrets are scoped per tenant and shared across all agents. Reference them in configs with ${vault:keyName}. Access is controlled by configuration authorship — only admins who write the config decide which secrets to use.")})})]}),d.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("label",{htmlFor:"secrets-tenant-input",className:"text-xs font-medium text-muted-foreground",children:i("secrets.tenantId","Tenant ID")}),d.jsx("input",{id:"secrets-tenant-input",type:"text",value:t,onChange:H=>n(H.target.value),placeholder:"default",className:"h-9 w-48 rounded-lg border border-input bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50","data-testid":"tenant-input"})]}),R&&d.jsxs("div",{className:"flex h-9 items-center gap-2 text-sm text-muted-foreground",children:[d.jsx(ni,{className:"h-4 w-4 animate-spin"}),i("common.loading","Loading…")]})]}),I&&I.length>0&&d.jsxs("div",{className:"rounded-xl border border-border bg-card shadow-sm",children:[d.jsx("div",{className:"border-b border-border px-4 py-3",children:d.jsx("h2",{className:"text-sm font-semibold text-foreground",children:i("secrets.tableTitle",{tenant:t,count:I.length,defaultValue:`${I.length} secret${I.length===1?"":"s"} in tenant "${t}"`})})}),d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-border text-start",children:[d.jsx("th",{className:"px-4 py-3 text-start font-semibold text-foreground",children:i("secrets.keyName","Key Name")}),d.jsx("th",{className:"px-4 py-3 text-start font-semibold text-foreground",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(IL,{className:"h-3.5 w-3.5"}),i("secrets.descriptionCol","Description")]})}),d.jsx("th",{className:"px-4 py-3 text-start font-semibold text-foreground",children:i("secrets.reference","Reference")}),d.jsx("th",{className:"px-4 py-3 text-start font-semibold text-foreground",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(Zr,{className:"h-3.5 w-3.5"}),i("secrets.created","Created")]})}),d.jsx("th",{className:"px-4 py-3 text-start font-semibold text-foreground",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(xi,{className:"h-3.5 w-3.5"}),i("secrets.lastRotated","Last Rotated")]})}),d.jsx("th",{className:"px-4 py-3 text-start font-semibold text-foreground",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(Zf,{className:"h-3.5 w-3.5"}),i("secrets.checksum","Checksum")]})}),d.jsx("th",{className:"px-4 py-3 text-start font-semibold text-foreground",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(ai,{className:"h-3.5 w-3.5"}),i("secrets.allowedAgents","Allowed Agents")]})}),d.jsx("th",{className:"px-4 py-3 text-end font-semibold text-foreground",children:i("secrets.actions","Actions")})]})}),d.jsx("tbody",{className:"divide-y divide-border",children:I.map(H=>d.jsxs("tr",{className:"transition-colors hover:bg-muted/50",children:[d.jsx("td",{className:"px-4 py-3",children:d.jsxs("span",{className:"inline-flex items-center gap-2",children:[d.jsx(Uv,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"font-medium text-foreground",children:H.keyName})]})}),d.jsx("td",{className:"max-w-48 px-4 py-3 text-muted-foreground",children:d.jsx("span",{className:"line-clamp-1",children:H.description||"—"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("button",{onClick:()=>K(H.keyName),className:"inline-flex items-center gap-1.5 rounded-md bg-muted/50 px-2 py-1 font-mono text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:i("secrets.copyRef","Copy vault reference"),"data-testid":`copy-ref-${H.keyName}`,children:[d.jsx(mo,{className:"h-3 w-3"}),te(H.keyName)]})}),d.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:ne(H.createdAt)}),d.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:ne(H.lastRotatedAt)}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:H.checksum?H.checksum.substring(0,12)+"…":"—"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"flex flex-wrap gap-1",children:(H.allowedAgents??["*"]).map(Q=>d.jsx("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium ${Q==="*"?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-primary/10 text-primary"}`,children:Q==="*"?d.jsx(d.Fragment,{children:i("secrets.allAgents","All agents")}):d.jsxs(d.Fragment,{children:[d.jsx(ai,{className:"h-2.5 w-2.5"}),Q.length>16?Q.slice(0,16)+"…":Q]})},Q))})}),d.jsx("td",{className:"px-4 py-3 text-end",children:d.jsxs("div",{className:"flex items-center justify-end gap-1",children:[d.jsxs("button",{onClick:()=>{_(H),k(""),E(!1)},className:"inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium text-amber-600 dark:text-amber-400 transition-colors hover:bg-amber-500/10","data-testid":`rotate-${H.keyName}`,"aria-label":i("secrets.rotateKey",{key:H.keyName,defaultValue:`Rotate ${H.keyName}`}),children:[d.jsx(xi,{className:"h-3.5 w-3.5","aria-hidden":"true"}),i("secrets.rotate","Rotate")]}),d.jsxs("button",{onClick:()=>x(H),className:"inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium text-destructive transition-colors hover:bg-destructive/10","data-testid":`delete-${H.keyName}`,"aria-label":i("secrets.deleteKey",{key:H.keyName,defaultValue:`Delete ${H.keyName}`}),children:[d.jsx(_n,{className:"h-3.5 w-3.5","aria-hidden":"true"}),i("common.delete","Delete")]})]})})]},`${H.tenantId}-${H.keyName}`))})]})})]}),I&&I.length===0&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-dashed border-border p-12 text-center",children:[d.jsx(Uv,{className:"h-12 w-12 text-muted-foreground/30"}),d.jsx("p",{className:"mt-4 text-lg font-medium text-foreground",children:i("secrets.empty","No secrets found")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i("secrets.emptyHint",{tenant:t,defaultValue:`No secrets stored for tenant "${t}" yet. Click "Add Secret" to create one.`})})]}),s&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:()=>{r(!1),a(""),c(""),h(""),f(!1),T([])},onKeyDown:H=>{H.key==="Escape"&&(r(!1),a(""),c(""),h(""),f(!1),T([]))},children:d.jsxs("div",{className:"w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-2xl",onClick:H=>H.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"create-secret-title",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{id:"create-secret-title",className:"text-lg font-semibold text-foreground",children:i("secrets.createTitle","Add Secret")}),d.jsx("button",{onClick:()=>{r(!1),a(""),c(""),h(""),f(!1),T([])},className:"rounded-lg p-1.5 text-muted-foreground hover:bg-muted",children:d.jsx(An,{className:"h-4 w-4"})})]}),d.jsxs("div",{className:"mt-3 flex items-center gap-2 rounded-lg bg-muted/50 px-3 py-2 text-xs text-muted-foreground",children:[d.jsx(Uv,{className:"h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:i("secrets.creatingFor",{tenant:t,defaultValue:`Storing in tenant "${t}" — available to all agents`})})]}),d.jsxs("div",{className:"mt-4 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"new-key-name",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:i("secrets.keyNameLabel","Key Name")}),d.jsx("input",{id:"new-key-name",type:"text",value:o,onChange:H=>a(H.target.value),placeholder:i("secrets.keyNamePlaceholder","e.g. openaiKey, dbPassword"),className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50","data-testid":"new-key-input",autoComplete:"off",autoFocus:!0}),o.trim()&&d.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[i("secrets.willUseRef","Reference:")," ",d.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:te(o.trim())})]})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"new-secret-value",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:i("secrets.valueLabel","Secret Value")}),d.jsxs("div",{className:"relative",children:[d.jsx("input",{id:"new-secret-value",type:g?"text":"password",value:l,onChange:H=>c(H.target.value),placeholder:i("secrets.valuePlaceholder","Enter secret value…"),className:"h-9 w-full rounded-lg border border-input bg-background pe-10 ps-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50","data-testid":"new-value-input",autoComplete:"new-password"}),d.jsx("button",{type:"button",onClick:()=>f(!g),className:"absolute inset-e-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":g?i("secrets.hideValue","Hide value"):i("secrets.showValue","Show value"),"data-testid":"new-value-eye",children:g?d.jsx(Sh,{className:"h-4 w-4","aria-hidden":"true"}):d.jsx(_b,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"new-description",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:i("secrets.descriptionLabel","Description (optional)")}),d.jsx("input",{id:"new-description",type:"text",value:u,onChange:H=>h(H.target.value),placeholder:i("secrets.descriptionPlaceholder","e.g. OpenAI API key for production"),className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50","data-testid":"new-description-input",autoComplete:"off"})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"new-allowed-agents",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:i("secrets.allowedAgentsLabel","Allowed Agents (optional)")}),d.jsxs("div",{className:"space-y-1.5",children:[D.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1",children:D.map(H=>d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:[d.jsx(ai,{className:"h-2.5 w-2.5"}),H.length>20?H.slice(0,20)+"…":H,d.jsx("button",{type:"button",onClick:()=>T(Q=>Q.filter(Y=>Y!==H)),className:"ms-0.5 rounded-full p-0.5 text-primary/60 hover:text-primary transition-colors",children:d.jsx(An,{className:"h-2.5 w-2.5"})})]},H))}),d.jsx("input",{id:"new-allowed-agents",type:"text",placeholder:i("secrets.allowedAgentsPlaceholder","Type agent ID and press Enter (empty = all agents)"),className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50","data-testid":"new-allowed-agents-input",autoComplete:"off",onKeyDown:H=>{if(H.key==="Enter"||H.key===","){H.preventDefault();const Q=H.currentTarget,Y=Q.value.trim().replace(/,$/,"");Y&&!D.includes(Y)&&(T(V=>[...V,Y]),Q.value="")}}}),d.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("secrets.allowedAgentsHint","Leave empty for all agents. Adding agent IDs helps track which agents use this secret.")})]})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:i("secrets.storeWarning","The value will be encrypted with AES-256-GCM. It cannot be retrieved once stored — only replaced.")})]}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.jsx("button",{onClick:()=>{r(!1),a(""),c(""),h(""),f(!1),T([])},className:"rounded-lg px-4 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted",children:i("common.cancel","Cancel")}),d.jsxs("button",{onClick:z,disabled:!o.trim()||!l.trim()||j.isPending,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50","data-testid":"confirm-create-button",children:[j.isPending&&d.jsx(ni,{className:"h-4 w-4 animate-spin"}),i("secrets.store","Store Secret")]})]})]})}),m&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:()=>x(null),onKeyDown:H=>{H.key==="Escape"&&x(null)},children:d.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-border bg-card p-6 shadow-2xl",onClick:H=>H.stopPropagation(),role:"alertdialog","aria-modal":"true","aria-labelledby":"delete-secret-title","aria-describedby":"delete-secret-desc",children:[d.jsx("h2",{id:"delete-secret-title",className:"text-lg font-semibold text-foreground",children:i("secrets.confirmDeleteTitle","Delete Secret")}),d.jsx("p",{id:"delete-secret-desc",className:"mt-2 text-sm text-muted-foreground",children:i("secrets.confirmDeleteMessage",{key:m.keyName,defaultValue:`Are you sure you want to permanently delete "${m.keyName}"? Any agent configs using this secret will fail to resolve. This cannot be undone.`})}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.jsx("button",{onClick:()=>x(null),className:"rounded-lg px-4 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted",children:i("common.cancel","Cancel")}),d.jsxs("button",{onClick:G,disabled:B.isPending,className:"inline-flex items-center gap-2 rounded-lg bg-destructive px-4 py-2 text-sm font-medium text-destructive-foreground transition-colors hover:bg-destructive/90 disabled:opacity-50","data-testid":"confirm-delete-button",children:[B.isPending&&d.jsx(ni,{className:"h-4 w-4 animate-spin"}),i("common.delete","Delete")]})]})]})}),v&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:()=>_(null),onKeyDown:H=>{H.key==="Escape"&&_(null)},children:d.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-border bg-card p-6 shadow-2xl",onClick:H=>H.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"rotate-secret-title",children:[d.jsxs("h2",{id:"rotate-secret-title",className:"flex items-center gap-2 text-lg font-semibold text-foreground",children:[d.jsx(xi,{className:"h-5 w-5 text-amber-500"}),i("secrets.rotateTitle",{key:v.keyName,defaultValue:`Rotate "${v.keyName}"`})]}),d.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:i("secrets.rotateDesc","Enter the new value. The existing references will continue to resolve to the updated value.")}),d.jsxs("div",{className:"relative mt-4",children:[d.jsx("input",{type:C?"text":"password",value:w,onChange:H=>k(H.target.value),placeholder:i("secrets.newValuePlaceholder","New secret value…"),className:"h-9 w-full rounded-lg border border-input bg-background pe-10 ps-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-primary/50","data-testid":"rotate-value-input",autoComplete:"new-password",autoFocus:!0}),d.jsx("button",{type:"button",onClick:()=>E(!C),className:"absolute inset-e-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:C?d.jsx(Sh,{className:"h-4 w-4"}):d.jsx(_b,{className:"h-4 w-4"})})]}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.jsx("button",{onClick:()=>_(null),className:"rounded-lg px-4 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted",children:i("common.cancel","Cancel")}),d.jsxs("button",{onClick:()=>{w.trim()&&U.mutate({tenantId:t,keyName:v.keyName,newValue:w.trim()},{onSuccess:()=>{ze.success(i("secrets.rotateSuccess",{key:v.keyName,defaultValue:`Secret "${v.keyName}" rotated`})),_(null),k("")},onError:H=>ze.error(H.message)})},disabled:!w.trim()||U.isPending,className:"inline-flex items-center gap-2 rounded-lg bg-amber-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-amber-600 disabled:opacity-50","data-testid":"confirm-rotate-button",children:[U.isPending&&d.jsx(ni,{className:"h-4 w-4 animate-spin"}),i("secrets.rotate","Rotate")]})]})]})})]})}const Jse="/variablestore/variables",ere="default";async function Ddt(i=ere){return Oe.get(`${Jse}/${encodeURIComponent(i)}`)}async function Tdt(i,e,t=ere){await Oe.put(`${Jse}/${encodeURIComponent(t)}/${encodeURIComponent(i)}`,e)}async function Idt(i,e=ere){await Oe.delete(`${Jse}/${encodeURIComponent(e)}/${encodeURIComponent(i)}`)}const Adt=/^[a-zA-Z0-9_.-]+$/;function Rdt(i){return Adt.test(i)}const tre={list:["variables","list"]};function Mdt(){return hn({queryKey:tre.list,queryFn:()=>Ddt()})}function Pdt(){const i=cn();return Kt({mutationFn:e=>Tdt(e.key,e.variable),onSuccess:()=>{i.invalidateQueries({queryKey:tre.list})}})}function Odt(){const i=cn();return Kt({mutationFn:e=>Idt(e),onSuccess:()=>{i.invalidateQueries({queryKey:tre.list})}})}const Tme="Letters, digits, dots, underscores, hyphens only.";function jdt(){const{t:i}=xe(),[e,t]=L.useState(!1),[n,s]=L.useState(!1),[r,o]=L.useState(""),[a,l]=L.useState(""),[c,u]=L.useState(""),[h,g]=L.useState(!0),[f,m]=L.useState(null),[x,v]=L.useState(""),{data:_,isLoading:w}=Mdt(),k=Pdt(),C=Odt(),E=r.trim().length>0&&Rdt(r.trim()),D=r.trim().length>0,T=E&&a.trim().length>0,I=L.useMemo(()=>{if(!_)return[];if(!x.trim())return _;const z=x.toLowerCase();return _.filter(G=>G.key.toLowerCase().includes(z)||G.value.toLowerCase().includes(z)||(G.description??"").toLowerCase().includes(z))},[_,x]),R=L.useCallback((z,G)=>{const ne=G==="vars"?`\${vars:${z}}`:`{{vars.${z}}}`;navigator.clipboard.writeText(ne).then(()=>{ze.success(i("variables.refCopied",{ref:ne,defaultValue:`Copied: ${ne}`}))},()=>{ze.error(i("common.copyFailed","Failed to copy to clipboard"))})},[i]),P=L.useCallback(()=>{s(!1),o(""),l(""),u(""),g(!0),t(!0)},[]),j=L.useCallback(z=>{s(!0),o(z.key),l(z.value),u(z.description??""),g(z.exportable??!0),t(!0)},[]),B=L.useCallback(()=>{t(!1),o(""),l(""),u(""),g(!0)},[]),U=L.useCallback(()=>{if(!T)return;const z={key:r.trim(),value:a.trim(),description:c.trim()||void 0,exportable:h};k.mutate({key:z.key,variable:z},{onSuccess:()=>{ze.success(i("variables.saveSuccess",{key:z.key,defaultValue:`Variable "${z.key}" saved`})),B()},onError:G=>ze.error(G instanceof Error?G.message:String(G))})},[T,r,a,c,h,k,i,B]),$=L.useCallback(()=>{f&&C.mutate(f.key,{onSuccess:()=>{ze.success(i("variables.deleteSuccess",{key:f.key,defaultValue:`Variable "${f.key}" deleted`})),m(null)},onError:z=>ze.error(z instanceof Error?z.message:String(z))})},[f,C,i]),K=(z,G)=>z.length>G?z.substring(0,G)+"…":z;return d.jsxs("div",{className:"space-y-6 p-6","data-testid":"variables-page",children:[d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-foreground",children:i("variables.title","Global Variables")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i("variables.description","Deployment-wide configuration values available in all agents.")})]}),d.jsx("div",{className:"flex items-center gap-3",children:d.jsxs("button",{onClick:P,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90","data-testid":"create-variable-button",children:[d.jsx(Gt,{className:"h-4 w-4"}),i("variables.create","Add Variable")]})})]}),d.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-primary/20 bg-primary/5 px-4 py-3",children:[d.jsx(_d,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("p",{className:"text-xs text-muted-foreground",children:i("variables.infoLine1","Use {{vars.}} in system prompts or ${vars:} anywhere in agent configurations.")}),d.jsx("p",{className:"text-xs text-muted-foreground",children:i("variables.infoLine2","Changes take effect within 2 minutes (cache TTL). For sensitive values, use the Secrets Vault instead.")})]})]}),_&&_.length>0&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("div",{className:"relative max-w-sm flex-1",children:[d.jsx(br,{className:"absolute inset-s-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:x,onChange:z=>v(z.target.value),placeholder:i("variables.searchPlaceholder","Filter variables…"),className:"h-9 w-full rounded-lg border border-input bg-background ps-9 pe-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50","data-testid":"variables-search"})]}),w&&d.jsxs("div",{className:"flex h-9 items-center gap-2 text-sm text-muted-foreground",children:[d.jsx(ni,{className:"h-4 w-4 animate-spin"}),i("common.loading","Loading…")]})]}),w&&!_&&d.jsx("div",{className:"flex items-center justify-center py-12",children:d.jsx(ni,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),I.length>0&&d.jsxs("div",{className:"rounded-xl border border-border bg-card shadow-sm",children:[d.jsx("div",{className:"border-b border-border px-4 py-3",children:d.jsx("h2",{className:"text-sm font-semibold text-foreground",children:i("variables.tableTitle",{count:I.length,defaultValue:`${I.length} variable${I.length===1?"":"s"}`})})}),d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-border text-start",children:[d.jsx("th",{className:"px-4 py-3 text-start font-semibold text-foreground",children:i("variables.colKey","Key")}),d.jsx("th",{className:"px-4 py-3 text-start font-semibold text-foreground",children:i("variables.colValue","Value")}),d.jsx("th",{className:"px-4 py-3 text-start font-semibold text-foreground",children:i("variables.colDescription","Description")}),d.jsx("th",{className:"px-4 py-3 text-start font-semibold text-foreground",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(rHe,{className:"h-3.5 w-3.5"}),i("variables.colExportable","Export")]})}),d.jsx("th",{className:"px-4 py-3 text-start font-semibold text-foreground",children:i("variables.colReference","Reference")}),d.jsx("th",{className:"px-4 py-3 text-end font-semibold text-foreground",children:i("variables.colActions","Actions")})]})}),d.jsx("tbody",{className:"divide-y divide-border",children:I.map(z=>d.jsxs("tr",{className:"transition-colors hover:bg-muted/50","data-testid":`variable-row-${z.key}`,children:[d.jsx("td",{className:"px-4 py-3",children:d.jsxs("span",{className:"inline-flex items-center gap-2",children:[d.jsx(mG,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"font-mono text-sm font-medium text-foreground",children:z.key})]})}),d.jsx("td",{className:"max-w-48 px-4 py-3 text-muted-foreground",children:d.jsx("span",{className:"line-clamp-1 font-mono text-xs",title:z.value,children:K(z.value,40)})}),d.jsx("td",{className:"max-w-48 px-4 py-3 text-muted-foreground",children:d.jsx("span",{className:"line-clamp-1",title:z.description??void 0,children:z.description||"—"})}),d.jsx("td",{className:"px-4 py-3",children:z.exportable??!0?d.jsx(Ns,{className:"h-4 w-4 text-emerald-500","aria-label":i("variables.exportYes","Included in exports"),"data-testid":`export-yes-${z.key}`}):d.jsx(NBe,{className:"h-4 w-4 text-muted-foreground/50","aria-label":i("variables.exportNo","Excluded from exports"),"data-testid":`export-no-${z.key}`})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"flex items-center gap-1",children:d.jsxs("button",{onClick:()=>R(z.key,"vars"),className:"inline-flex items-center gap-1 rounded-md bg-muted/50 px-2 py-1 font-mono text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:i("variables.copyVars","Copy ${vars:…} reference"),"data-testid":`copy-vars-${z.key}`,children:[d.jsx(mo,{className:"h-3 w-3"}),`\${vars:${z.key}}`]})})}),d.jsx("td",{className:"px-4 py-3 text-end",children:d.jsxs("div",{className:"flex items-center justify-end gap-1",children:[d.jsxs("button",{onClick:()=>j(z),className:"inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10","data-testid":`edit-${z.key}`,"aria-label":i("variables.editKey",{key:z.key,defaultValue:`Edit ${z.key}`}),children:[d.jsx(VSe,{className:"h-3.5 w-3.5","aria-hidden":"true"}),i("common.edit","Edit")]}),d.jsxs("button",{onClick:()=>m(z),className:"inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium text-destructive transition-colors hover:bg-destructive/10","data-testid":`delete-${z.key}`,"aria-label":i("variables.deleteKey",{key:z.key,defaultValue:`Delete ${z.key}`}),children:[d.jsx(_n,{className:"h-3.5 w-3.5","aria-hidden":"true"}),i("common.delete","Delete")]})]})})]},z.key))})]})})]}),_&&_.length===0&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-dashed border-border p-12 text-center","data-testid":"variables-empty",children:[d.jsx(mG,{className:"h-12 w-12 text-muted-foreground/30"}),d.jsx("p",{className:"mt-4 text-lg font-medium text-foreground",children:i("variables.empty","No global variables defined")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i("variables.emptyHint",'Click "Add Variable" to create your first deployment-wide configuration value.')})]}),_&&_.length>0&&I.length===0&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-dashed border-border p-12 text-center",children:[d.jsx(br,{className:"h-12 w-12 text-muted-foreground/30"}),d.jsx("p",{className:"mt-4 text-lg font-medium text-foreground",children:i("common.noResults","No results found")})]}),e&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:B,onKeyDown:z=>{z.key==="Escape"&&B()},children:d.jsxs("div",{className:"w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-2xl",onClick:z=>z.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"variable-dialog-title",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{id:"variable-dialog-title",className:"text-lg font-semibold text-foreground",children:n?i("variables.editTitle","Edit Variable"):i("variables.createTitle","Add Global Variable")}),d.jsx("button",{onClick:B,className:"rounded-lg p-1.5 text-muted-foreground hover:bg-muted",children:d.jsx(An,{className:"h-4 w-4"})})]}),d.jsxs("div",{className:"mt-4 space-y-4",children:[d.jsxs("div",{children:[d.jsxs("label",{htmlFor:"var-key",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:[i("variables.keyLabel","Key")," *"]}),d.jsx("input",{id:"var-key",type:"text",value:r,onChange:z=>o(z.target.value),disabled:n,placeholder:i("variables.keyPlaceholder","e.g., default-model"),className:"h-9 w-full rounded-lg border border-input bg-background px-3 font-mono text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50 disabled:cursor-not-allowed disabled:opacity-60","data-testid":"var-key-input",autoComplete:"off",autoFocus:!n}),D&&!E&&d.jsx("p",{className:"mt-1 text-xs text-destructive","data-testid":"key-error",children:i("variables.keyError",Tme)}),!n&&d.jsx("p",{className:"mt-1 text-[10px] text-muted-foreground",children:Tme})]}),d.jsxs("div",{children:[d.jsxs("label",{htmlFor:"var-value",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:[i("variables.valueLabel","Value")," *"]}),d.jsx("input",{id:"var-value",type:"text",value:a,onChange:z=>l(z.target.value),placeholder:i("variables.valuePlaceholder","e.g., gpt-4.1"),className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50","data-testid":"var-value-input",autoComplete:"off",autoFocus:n}),d.jsxs("p",{className:"mt-1 flex items-center gap-1 text-[10px] text-amber-600 dark:text-amber-400",children:[d.jsx(_d,{className:"h-3 w-3 shrink-0"}),i("variables.valueWarning","Values are visible in UI and logs. Use the Secrets Vault for sensitive data.")]})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"var-description",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:i("variables.descriptionLabel","Description (optional)")}),d.jsx("input",{id:"var-description",type:"text",value:c,onChange:z=>u(z.target.value),placeholder:i("variables.descriptionPlaceholder","Optional description…"),className:"h-9 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50","data-testid":"var-description-input",autoComplete:"off"})]}),d.jsxs("label",{className:"flex items-center gap-2 text-sm text-foreground",children:[d.jsx("input",{type:"checkbox",checked:h,onChange:z=>g(z.target.checked),className:"h-4 w-4 rounded border-input accent-primary","data-testid":"var-exportable-checkbox"}),i("variables.exportableLabel","Include in agent exports")]})]}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.jsx("button",{onClick:B,className:"rounded-lg px-4 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted",children:i("common.cancel","Cancel")}),d.jsxs("button",{onClick:U,disabled:!T||k.isPending,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50","data-testid":"confirm-save-button",children:[k.isPending&&d.jsx(ni,{className:"h-4 w-4 animate-spin"}),i("variables.save","Save Variable")]})]})]})}),f&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:()=>m(null),onKeyDown:z=>{z.key==="Escape"&&m(null)},children:d.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-border bg-card p-6 shadow-2xl",onClick:z=>z.stopPropagation(),role:"alertdialog","aria-modal":"true","aria-labelledby":"delete-variable-title","aria-describedby":"delete-variable-desc",children:[d.jsx("h2",{id:"delete-variable-title",className:"text-lg font-semibold text-foreground",children:i("variables.confirmDeleteTitle","Delete Variable")}),d.jsx("p",{id:"delete-variable-desc",className:"mt-2 text-sm text-muted-foreground",children:i("variables.confirmDeleteMessage",{key:f.key,defaultValue:`Are you sure you want to delete "${f.key}"? Agents using \${vars:${f.key}} will see unresolved references.`})}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.jsx("button",{onClick:()=>m(null),className:"rounded-lg px-4 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted",children:i("common.cancel","Cancel")}),d.jsxs("button",{onClick:$,disabled:C.isPending,className:"inline-flex items-center gap-2 rounded-lg bg-destructive px-4 py-2 text-sm font-medium text-destructive-foreground transition-colors hover:bg-destructive/90 disabled:opacity-50","data-testid":"confirm-delete-button",children:[C.isPending&&d.jsx(ni,{className:"h-4 w-4 animate-spin"}),i("common.delete","Delete")]})]})]})})]})}const IDe={trail:(i,e,t)=>["audit","trail",i,e,t],trailByAgent:(i,e,t,n)=>["audit","trail-by-agent",i,e,t,n],count:i=>["audit","count",i]};function Fdt(i,e=0,t=100){return hn({queryKey:IDe.trail(i,e,t),queryFn:()=>L7(i,e,t),enabled:!!i})}function Bdt(i,e,t=0,n=100){return hn({queryKey:IDe.trailByAgent(i,e,t,n),queryFn:()=>JZe(i,e,t,n),enabled:!!i})}const Hdt={langchain:{bg:"bg-purple-500/15",text:"text-purple-400",icon:Nl},behavior:{bg:"bg-blue-500/15",text:"text-blue-400",icon:nc},output:{bg:"bg-emerald-500/15",text:"text-emerald-400",icon:vj},expressions:{bg:"bg-amber-500/15",text:"text-amber-400",icon:Sh},httpcalls:{bg:"bg-orange-500/15",text:"text-orange-400",icon:Mie},propertysetter:{bg:"bg-teal-500/15",text:"text-teal-400",icon:xp}},Wdt={bg:"bg-gray-500/15",text:"text-gray-400",icon:Zf},I5=100;function Vdt(i){return Hdt[i]??Wdt}function z7(i){return i<1e3?`${i}ms`:`${(i/1e3).toFixed(1)}s`}function U7(i){return i===0?"":i<.01?`$${i.toFixed(4)}`:`$${i.toFixed(2)}`}function ADe(i){const e=new Map;for(const t of i){const n=t.stepIndex;e.has(n)||e.set(n,[]),e.get(n).push(t)}return e}function zdt(i){const e=new Map;for(const t of i){const n=t.conversationId;e.has(n)||e.set(n,[]),e.get(n).push(t)}return e}function Udt(i){try{return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(i))}catch{return i}}function $dt(i){try{return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(i))}catch{return i}}function A5({data:i,label:e}){const[t,n]=L.useState(!1);return!i||(Array.isArray(i)?i.length===0:Object.keys(i).length===0)?null:d.jsxs("div",{className:"mt-2",children:[d.jsxs("button",{type:"button",onClick:()=>n(!t),className:"flex items-center gap-1.5 text-xs font-medium text-foreground/60 hover:text-foreground/80 transition-colors","data-testid":`expand-${e}`,children:[t?d.jsx(Rn,{className:"h-3.5 w-3.5"}):d.jsx(hs,{className:"h-3.5 w-3.5"}),e]}),t&&d.jsx("pre",{className:"mt-1.5 max-h-64 overflow-auto rounded-lg bg-card/50 p-3 text-xs text-foreground/80 border border-border/50",children:JSON.stringify(i,null,2)})]})}function qdt({entry:i,t:e}){const t=Vdt(i.taskType),n=t.icon,s=U7(i.cost);return d.jsxs("div",{className:"rounded-xl border border-border/50 bg-card p-4 transition-all hover:border-border hover:shadow-sm","data-testid":`audit-entry-${i.id}`,children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-semibold ${t.bg} ${t.text}`,"data-testid":"task-type-badge",children:[d.jsx(n,{className:"h-3.5 w-3.5"}),i.taskType]}),d.jsx("span",{className:"text-xs text-foreground/40 font-mono",children:i.taskId}),d.jsx("div",{className:"flex-1"}),d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-foreground/5 px-2 py-0.5 text-xs text-foreground/60","data-testid":"duration-pill",children:[d.jsx(Zr,{className:"h-3 w-3"}),z7(i.durationMs)]}),s&&d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-500","data-testid":"cost-pill",children:[d.jsx(MM,{className:"h-3 w-3"}),s]}),i.hmac&&d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[11px] font-medium text-emerald-600 dark:text-emerald-400 cursor-help",title:`HMAC: ${i.hmac.slice(0,16)}…${i.hmac.slice(-8)}${i.agentSignature?`
-Agent Signature: ${i.agentSignature.slice(0,16)}…`:""}`,"data-testid":"hmac-badge",children:[d.jsx(ME,{className:"h-3 w-3"}),e("audit.signed","Signed")]})]}),i.actions&&i.actions.length>0&&d.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:i.actions.map(r=>d.jsx("span",{className:"rounded-md bg-foreground/5 px-2 py-0.5 text-[11px] font-medium text-foreground/60","data-testid":"action-badge",children:r},r))}),d.jsxs("div",{className:"mt-2 flex items-center gap-3 text-[11px] text-foreground/40",children:[i.environment&&d.jsx("span",{className:"rounded bg-foreground/5 px-1.5 py-0.5","data-testid":"env-badge",children:i.environment}),d.jsx("span",{children:Udt(i.timestamp)})]}),d.jsx(A5,{data:i.input,label:e("audit.input","Input")}),d.jsx(A5,{data:i.output,label:e("audit.output","Output")}),d.jsx(A5,{data:i.llmDetail,label:e("audit.llmDetail","LLM Detail")}),d.jsx(A5,{data:i.toolCalls,label:e("audit.toolCalls","Tool Calls")})]})}function RDe({stepIdx:i,stepEntries:e,t,defaultOpen:n=!0}){var l,c;const[s,r]=L.useState(n),o=e.reduce((u,h)=>u+h.durationMs,0),a=e.reduce((u,h)=>u+h.cost,0);return d.jsxs("div",{className:"relative",children:[d.jsxs("button",{type:"button",onClick:()=>r(!s),className:"mb-3 flex w-full items-center gap-3 text-start group","data-testid":`step-header-${i}`,children:[d.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary shrink-0",children:i}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("span",{className:"text-sm font-semibold text-foreground",children:[t("audit.step","Step")," ",i]}),((c=(l=e[0])==null?void 0:l.input)==null?void 0:c["input:initial"])!=null&&d.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:["“",String(e[0].input["input:initial"]),"”"]})]}),d.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[d.jsxs("span",{className:"text-xs text-muted-foreground hidden sm:inline-flex items-center gap-1",children:[d.jsx(Zr,{className:"h-3 w-3"}),z7(o)]}),a>0&&d.jsxs("span",{className:"text-xs text-amber-500 hidden sm:inline-flex items-center gap-1",children:[d.jsx(MM,{className:"h-3 w-3"}),U7(a)]}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:[e.length," ",t("audit.tasks","tasks")]}),d.jsx(mBe,{className:"h-3.5 w-3.5 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]}),s&&d.jsx("div",{className:"relative ms-4 border-s-2 border-border/50 ps-6 space-y-3 animate-in fade-in slide-in-from-top-1 duration-200",children:e.sort((u,h)=>u.taskIndex-h.taskIndex).map(u=>d.jsxs("div",{className:"relative",children:[d.jsx("div",{className:"absolute -inset-s-[31px] top-4 h-2.5 w-2.5 rounded-full border-2 border-border bg-card"}),d.jsx(qdt,{entry:u,t})]},u.id))})]})}function Kdt({conversationId:i,entries:e,t}){const[n,s]=L.useState(!0),r=L.useMemo(()=>ADe(e),[e]),{totalDuration:o,totalCost:a,signedCount:l,firstTs:c}=L.useMemo(()=>{let u=0,h=0,g=0,f="";for(const m of e)u+=m.durationMs,h+=m.cost,m.hmac&&g++,(!f||m.timestamps(!n),className:"flex w-full items-center gap-3 p-4 text-start hover:bg-muted/30 transition-colors group",children:[d.jsx(Zl,{className:"h-4 w-4 text-primary shrink-0"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"text-sm font-semibold text-foreground font-mono",children:i.length>24?`${i.slice(0,12)}…${i.slice(-8)}`:i}),c&&d.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:$dt(c)})]}),d.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[d.jsxs("span",{className:"text-xs text-muted-foreground",children:[e.length," ",t("audit.entries","entries")]}),d.jsxs("span",{className:"text-xs text-muted-foreground hidden sm:inline-flex items-center gap-1",children:[d.jsx(Zr,{className:"h-3 w-3"}),z7(o)]}),a>0&&d.jsxs("span",{className:"text-xs text-amber-500 hidden sm:inline-flex items-center gap-1",children:[d.jsx(MM,{className:"h-3 w-3"}),U7(a)]}),l>0&&d.jsxs("span",{className:`hidden sm:inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium ${l===e.length?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-amber-500/10 text-amber-600 dark:text-amber-400"}`,children:[d.jsx(ME,{className:"h-3 w-3"}),l===e.length?t("audit.allSigned","All signed"):`${l}/${e.length}`]}),d.jsx(Rn,{className:`h-4 w-4 text-muted-foreground transition-transform ${n?"":"-rotate-90"}`})]})]}),n&&d.jsx("div",{className:"border-t border-border/50 p-4 space-y-6",children:[...r.entries()].sort(([u],[h])=>u-h).map(([u,h])=>d.jsx(RDe,{stepIdx:u,stepEntries:h,t},u))})]})}function Gdt(){return d.jsx("div",{className:"space-y-4 animate-pulse","data-testid":"loading-skeleton",children:Array.from({length:3}).map((i,e)=>d.jsxs("div",{className:"rounded-xl border border-border bg-card p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"h-8 w-8 rounded-full bg-foreground/5"}),d.jsx("div",{className:"h-4 w-32 rounded bg-foreground/5"}),d.jsx("div",{className:"flex-1"}),d.jsx("div",{className:"h-4 w-16 rounded bg-foreground/5"})]}),d.jsxs("div",{className:"ms-11 space-y-2",children:[d.jsx("div",{className:"h-16 rounded-lg bg-foreground/5"}),d.jsx("div",{className:"h-16 rounded-lg bg-foreground/5"})]})]},e))})}function Ydt(){const{t:i}=xe(),e=$s(Y=>Y.maybeAutoStart);L.useEffect(()=>{const Y=setTimeout(()=>e("audit"),500);return()=>clearTimeout(Y)},[e]);const[t,n]=L.useState("agent"),[s,r]=L.useState(""),[o,a]=L.useState(""),[l,c]=L.useState(""),[u,h]=L.useState(""),[g,f]=L.useState(""),[m,x]=L.useState(),[v,_]=L.useState(0),w=Fdt(t==="conversation"?o:"",v,I5),k=Bdt(t==="agent"?g:"",m,v,I5),C=t==="conversation"?w.data:k.data,E=t==="conversation"?w.isLoading:k.isLoading,D=t==="conversation"?w.isFetching:k.isFetching,T=t==="conversation"?!!o:!!g,I=L.useMemo(()=>C?ADe(C):new Map,[C]),R=L.useMemo(()=>!C||t!=="agent"?new Map:zdt(C),[C,t]),P=L.useMemo(()=>!C||C.length===0?{count:0,cost:0,duration:0,signed:0}:{count:C.length,cost:C.reduce((Y,V)=>Y+V.cost,0),duration:C.reduce((Y,V)=>Y+V.durationMs,0),signed:C.filter(Y=>!!Y.hmac).length},[C]),j=L.useCallback(Y=>{if(c(Y),_(0),Y){f(Y);const V=parseInt(u,10);x(isNaN(V)?void 0:V)}else f(""),x(void 0)},[u]),B=L.useCallback(Y=>{if(h(Y),l){_(0),f(l);const V=parseInt(Y,10);x(isNaN(V)?void 0:V)}},[l]),U=L.useCallback(()=>{const Y=s.trim();Y&&(_(0),a(Y))},[s]),$=L.useCallback(Y=>{Y.key==="Enter"&&U()},[U]),[K,z]=L.useState(!1),G=t==="conversation"?w.refetch:k.refetch,ne=L.useRef(K);ne.current=K,L.useEffect(()=>{if(!K||!T)return;const Y=setInterval(()=>{ne.current&&G()},1e4);return()=>clearInterval(Y)},[K,T,G]);const te=L.useCallback(()=>{if(!C||C.length===0)return;const Y=new Blob([JSON.stringify(C,null,2)],{type:"application/json"}),V=URL.createObjectURL(Y),ue=document.createElement("a");ue.href=V,ue.download=`audit-${o||g||"export"}-${new Date().toISOString().slice(0,10)}.json`,ue.click(),URL.revokeObjectURL(V)},[C,o,g]),{data:H}=nse(),Q=L.useMemo(()=>{var Y;return!g||!H?null:((Y=H.find(V=>V.id===g))==null?void 0:Y.name)??null},[g,H]);return d.jsxs("div",{className:"space-y-6","data-testid":"audit-page",children:[d.jsx("div",{children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-primary/10",children:d.jsx(bh,{className:"h-5 w-5 text-primary"})}),d.jsxs("div",{className:"flex-1",children:[d.jsx("h1",{className:"text-2xl font-bold text-foreground",children:i("audit.title","Audit Trail")}),d.jsx("p",{className:"text-sm text-muted-foreground",children:i("audit.description","Browse the immutable audit ledger for compliance and debugging.")})]}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("button",{type:"button",onClick:te,disabled:!C||C.length===0,className:"inline-flex items-center gap-1.5 rounded-lg border border-input bg-background px-3 py-2 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-50","data-testid":"export-btn",children:[d.jsx(Q_,{className:"h-4 w-4"}),i("audit.export","Export")]})})]})}),d.jsxs("div",{className:"rounded-xl border border-border bg-card p-4",children:[d.jsxs("div",{className:"mb-3 flex items-center gap-2","data-tour":"audit-mode-toggle",children:[d.jsxs("button",{type:"button",onClick:()=>n("agent"),className:`inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-all ${t==="agent"?"bg-primary text-primary-foreground shadow-sm":"bg-foreground/5 text-foreground/60 hover:text-foreground/80"}`,"data-testid":"mode-agent",children:[d.jsx(ai,{className:"h-3.5 w-3.5"}),i("audit.byAgent","By Agent")]}),d.jsxs("button",{type:"button",onClick:()=>n("conversation"),className:`inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-all ${t==="conversation"?"bg-primary text-primary-foreground shadow-sm":"bg-foreground/5 text-foreground/60 hover:text-foreground/80"}`,"data-testid":"mode-conversation",children:[d.jsx(Zl,{className:"h-3.5 w-3.5"}),i("audit.byConversation","By Conversation")]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[t==="agent"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsxs("select",{value:l,onChange:Y=>j(Y.target.value),className:"w-full appearance-none rounded-lg border border-border bg-background pe-8 ps-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-primary/50","data-testid":"agent-input",children:[d.jsx("option",{value:"",children:i("audit.selectAgent","Select an agent…")}),H==null?void 0:H.map(Y=>d.jsx("option",{value:Y.id,children:Y.name||Y.id},Y.id))]}),d.jsx(Rn,{className:"pointer-events-none absolute inset-e-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"})]}),d.jsx("input",{type:"text",value:u,onChange:Y=>B(Y.target.value),placeholder:i("audit.versionPlaceholder","Version (optional)"),className:"w-36 rounded-lg border border-border bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50","data-testid":"version-input"})]}):d.jsxs(d.Fragment,{children:[d.jsx("input",{type:"text",value:s,onChange:Y=>r(Y.target.value),onKeyDown:$,placeholder:i("audit.conversationIdPlaceholder","Enter conversation ID..."),className:"flex-1 rounded-lg border border-border bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50","data-testid":"conversation-input"}),d.jsxs("button",{type:"button",onClick:U,disabled:!s.trim(),className:"inline-flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed","data-testid":"search-button",children:[d.jsx(br,{className:"h-4 w-4"}),i("audit.search","Search")]})]}),T&&d.jsxs("button",{type:"button",onClick:()=>z(Y=>!Y),className:`inline-flex items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${K?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-foreground/5 text-muted-foreground hover:text-foreground"}`,title:i("audit.autoRefreshToggle","Toggle auto-refresh (every 10s)"),"data-testid":"auto-refresh-toggle",children:[d.jsx(xi,{className:`h-4 w-4 ${K?"animate-spin":""}`}),i(K?"audit.autoRefreshOn":"audit.autoRefreshOff","Auto")]})]})]}),T&&C&&C.length>0&&d.jsxs("div",{className:"flex items-center gap-4 rounded-xl border border-border bg-card px-4 py-3","data-testid":"summary-strip",children:[Q&&t==="agent"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.jsx(ai,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"font-semibold text-foreground",children:Q})]}),d.jsx("div",{className:"h-4 w-px bg-border"})]}),d.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.jsx(l7,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"font-semibold text-foreground",children:P.count}),d.jsx("span",{className:"text-muted-foreground",children:i("audit.entries","entries")})]}),d.jsx("div",{className:"h-4 w-px bg-border"}),d.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.jsx(Zr,{className:"h-4 w-4 text-muted-foreground"}),d.jsx("span",{className:"font-semibold text-foreground",children:z7(P.duration)}),d.jsx("span",{className:"text-muted-foreground",children:i("audit.totalDuration","total")})]}),P.cost>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"h-4 w-px bg-border"}),d.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.jsx(MM,{className:"h-4 w-4 text-amber-500"}),d.jsx("span",{className:"font-semibold text-amber-500",children:U7(P.cost)}),d.jsx("span",{className:"text-muted-foreground",children:i("audit.totalCost","total cost")})]})]}),t==="agent"&&R.size>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"h-4 w-px bg-border"}),d.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.jsx(Zl,{className:"h-4 w-4 text-muted-foreground"}),d.jsx("span",{className:"font-semibold text-foreground",children:R.size}),d.jsx("span",{className:"text-muted-foreground",children:i("audit.conversations","conversations")})]})]}),D&&d.jsx(ni,{className:"ms-auto h-4 w-4 animate-spin text-muted-foreground"})]}),T&&C&&C.length>0&&d.jsx("div",{className:`flex items-center gap-3 rounded-xl border px-4 py-3 ${P.signed===P.count?"border-emerald-500/30 bg-emerald-500/5":P.signed>0?"border-amber-500/30 bg-amber-500/5":"border-border bg-card"}`,"data-testid":"integrity-banner",children:P.signed===P.count?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-emerald-500/15 shrink-0",children:d.jsx(ME,{className:"h-4 w-4 text-emerald-500"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-emerald-700 dark:text-emerald-400",children:i("audit.integrityVerified","All entries cryptographically signed")}),d.jsx("p",{className:"text-xs text-emerald-600/70 dark:text-emerald-400/60",children:i("audit.integrityVerifiedDesc","{{count}} of {{total}} entries have HMAC-SHA256 signatures",{count:P.signed,total:P.count})})]}),d.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 rounded-full bg-emerald-500/10 px-2.5 py-1",children:[d.jsx(bh,{className:"h-3.5 w-3.5 text-emerald-500"}),d.jsx("span",{className:"text-xs font-semibold text-emerald-600 dark:text-emerald-400",children:i("audit.integrityPass","SIGNED")})]})]}):P.signed>0?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-amber-500/15 shrink-0",children:d.jsx(h7,{className:"h-4 w-4 text-amber-500"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-amber-700 dark:text-amber-400",children:i("audit.integrityPartial","Partially signed audit trail")}),d.jsx("p",{className:"text-xs text-amber-600/70 dark:text-amber-400/60",children:i("audit.integrityPartialDesc","{{count}} of {{total}} entries have HMAC signatures",{count:P.signed,total:P.count})})]}),d.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 rounded-full bg-amber-500/10 px-2.5 py-1",children:[d.jsx(ME,{className:"h-3.5 w-3.5 text-amber-500"}),d.jsxs("span",{className:"text-xs font-semibold text-amber-600 dark:text-amber-400",children:[P.signed,"/",P.count]})]})]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-foreground/5 shrink-0",children:d.jsx(OE,{className:"h-4 w-4 text-muted-foreground"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-foreground/70",children:i("audit.integrityNone","Unsigned audit entries")}),d.jsx("p",{className:"text-xs text-muted-foreground",children:i("audit.integrityNoneDesc","Configure a vault master key to enable automatic HMAC-SHA256 signing on all future audit entries.")})]})]})}),E&&T&&d.jsx(Gdt,{}),!T&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-dashed border-border bg-card/50 py-16","data-testid":"empty-state",children:[d.jsx(bh,{className:"h-12 w-12 text-muted-foreground/30"}),d.jsx("p",{className:"mt-4 text-sm font-medium text-foreground/60",children:t==="agent"?i("audit.emptyAgent","Select an agent to view its audit trail"):i("audit.empty","Search for audit entries")}),d.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t==="agent"?i("audit.emptyAgentHint","Choose a deployed agent from the dropdown above to see all its audit records."):i("audit.emptyHint","Enter a conversation ID above to browse the audit trail.")})]}),T&&!E&&C&&C.length===0&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-dashed border-border bg-card/50 py-16",children:[d.jsx(bh,{className:"h-12 w-12 text-muted-foreground/30"}),d.jsx("p",{className:"mt-4 text-sm font-medium text-foreground/60",children:i("audit.noResults","No audit entries found")}),d.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i("audit.noResultsHint","Try a different ID or check that the conversation has been processed.")})]}),T&&!E&&C&&C.length>0&&d.jsxs("div",{className:"space-y-4","data-testid":"audit-timeline",children:[t==="agent"&&R.size>0?[...R.entries()].map(([Y,V])=>d.jsx(Kdt,{conversationId:Y,entries:V,t:i},Y)):[...I.entries()].sort(([Y],[V])=>Y-V).map(([Y,V])=>d.jsx(RDe,{stepIdx:Y,stepEntries:V,t:i},Y)),C.length>=I5&&d.jsx("div",{className:"flex justify-center",children:d.jsx("button",{type:"button",onClick:()=>_(Y=>Y+I5),className:"rounded-lg bg-foreground/5 px-6 py-2 text-sm font-medium text-foreground/60 transition-all hover:bg-foreground/10 hover:text-foreground/80","data-testid":"load-more",children:i("audit.loadMore","Load more")})})]})]})}const $7="/administration/quotas";async function Qdt(i){return Oe.get(`${$7}/${i}`)}async function Xdt(i,e){return Oe.put(`${$7}/${i}`,e)}async function Zdt(i){return Oe.get(`${$7}/${i}/usage`)}async function Jdt(i){await Oe.post(`${$7}/${i}/usage/reset`,void 0)}const TA={all:["quotas"],list:["quotas","list"],detail:i=>["quotas","detail",i],usage:i=>["quotas","usage",i]};function eut(i){return hn({queryKey:TA.detail(i),queryFn:()=>Qdt(i),enabled:!0})}function tut(i){return hn({queryKey:TA.usage(i),queryFn:()=>Zdt(i),enabled:!0,refetchInterval:1e4})}function nut(){const i=cn();return Kt({mutationFn:e=>Xdt(e.tenantId,e.quota),onSuccess:(e,t)=>{i.invalidateQueries({queryKey:TA.detail(t.tenantId)}),i.invalidateQueries({queryKey:TA.list})}})}function iut(){const i=cn();return Kt({mutationFn:e=>Jdt(e),onSuccess:(e,t)=>{i.invalidateQueries({queryKey:TA.usage(t)})}})}const R5="default";function sut(){const{t:i}=xe(),{data:e,isLoading:t}=eut(R5),{data:n,isLoading:s}=tut(R5),r=nut(),o=iut(),[a,l]=L.useState(null),[c,u]=L.useState(!1),h=$s(v=>v.maybeAutoStart);L.useEffect(()=>{const v=setTimeout(()=>h("quotas"),500);return()=>clearTimeout(v)},[h]),L.useEffect(()=>{e&&!c&&l(e)},[e,c]);const g=L.useCallback((v,_)=>{l(w=>w&&{...w,[v]:_}),u(!0)},[]),f=L.useCallback(()=>{a&&r.mutate({tenantId:R5,quota:a},{onSuccess:v=>{l(v),u(!1)}})},[a,r]),m=L.useCallback(()=>{o.mutate(R5)},[o]),x=t||s;return d.jsxs("div",{className:"space-y-6","data-testid":"quotas-page",children:[d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-primary/10",children:d.jsx($Se,{className:"h-5 w-5 text-primary"})}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold tracking-tight text-foreground",children:i("quotas.title","Tenant Quotas")}),d.jsx("p",{className:"text-sm text-muted-foreground",children:i("quotas.description","Configure rate limits, usage caps, and cost budgets per tenant.")})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[c&&d.jsx("span",{className:"text-xs font-medium text-amber-500",children:i("editor.dirty","Unsaved changes")}),d.jsxs("button",{"data-testid":"quotas-save",onClick:f,disabled:!c||r.isPending,className:"inline-flex items-center gap-2 rounded-lg bg-sidebar-accent px-4 py-2 text-sm font-medium text-white shadow-sm transition-all hover:bg-sidebar-accent/90 disabled:opacity-50",children:[d.jsx(u7,{className:"h-4 w-4"}),r.isPending?i("editor.saving","Saving..."):i("editor.save","Save")]})]})]}),x?d.jsx("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:i("common.loading","Loading...")}):d.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[d.jsxs("div",{className:"rounded-xl border border-border bg-card p-6 shadow-sm",children:[d.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:i("quotas.configuration","Configuration")}),a&&d.jsxs("button",{"data-testid":"quotas-toggle-enabled",onClick:()=>g("enabled",!a.enabled),className:"flex items-center gap-2 text-sm font-medium",title:a.enabled?i("quotas.disable","Disable"):i("quotas.enable","Enable"),children:[a.enabled?d.jsx(zie,{className:"h-6 w-6 text-emerald-500"}):d.jsx(GSe,{className:"h-6 w-6 text-muted-foreground"}),d.jsx("span",{className:a.enabled?"text-emerald-500":"text-muted-foreground",children:a.enabled?i("quotas.enabled","Enabled"):i("quotas.disabled","Disabled")})]})]}),a&&d.jsxs("div",{className:"space-y-4",children:[d.jsx(M5,{label:i("quotas.maxConversationsPerDay","Max Conversations / Day"),value:a.maxConversationsPerDay,onChange:v=>g("maxConversationsPerDay",v),hint:i("quotas.limitHint","-1 = unlimited"),testId:"quota-max-conversations"}),d.jsx(M5,{label:i("quotas.maxAgentsPerTenant","Max Agents / Tenant"),value:a.maxAgentsPerTenant,onChange:v=>g("maxAgentsPerTenant",v),hint:i("quotas.limitHint","-1 = unlimited"),testId:"quota-max-agents"}),d.jsx(M5,{label:i("quotas.maxApiCallsPerMinute","Max API Calls / Minute"),value:a.maxApiCallsPerMinute,onChange:v=>g("maxApiCallsPerMinute",v),hint:i("quotas.limitHint","-1 = unlimited"),testId:"quota-max-api-calls"}),d.jsx(M5,{label:i("quotas.maxMonthlyCostUsd","Max Monthly Cost (USD)"),value:a.maxMonthlyCostUsd,onChange:v=>g("maxMonthlyCostUsd",v),hint:i("quotas.limitHint","-1 = unlimited"),testId:"quota-max-cost",step:.01})]})]}),d.jsxs("div",{className:"rounded-xl border border-border bg-card p-6 shadow-sm",children:[d.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[d.jsxs("h2",{className:"text-lg font-semibold text-foreground",children:[d.jsx(AE,{className:"me-2 inline-block h-5 w-5 text-muted-foreground"}),i("quotas.liveUsage","Live Usage")]}),d.jsxs("button",{"data-testid":"quotas-reset-usage",onClick:m,disabled:o.isPending,className:"inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50",children:[d.jsx(xi,{className:`h-3.5 w-3.5 ${o.isPending?"animate-spin":""}`}),i("quotas.resetCounters","Reset Counters")]})]}),n&&d.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[d.jsx(zU,{label:i("quotas.conversationsToday","Conversations Today"),value:n.conversationsToday,limit:(a==null?void 0:a.maxConversationsPerDay)??-1,testId:"usage-conversations"}),d.jsx(zU,{label:i("quotas.apiCallsMinute","API Calls / Minute"),value:n.apiCallsThisMinute,limit:(a==null?void 0:a.maxApiCallsPerMinute)??-1,testId:"usage-api-calls"}),d.jsx(zU,{label:i("quotas.monthlyCost","Monthly Cost"),value:n.monthlyCostUsd,limit:(a==null?void 0:a.maxMonthlyCostUsd)??-1,prefix:"$",testId:"usage-cost"}),d.jsxs("div",{className:"flex flex-col justify-center rounded-lg border border-border/50 bg-muted/30 p-3",children:[d.jsx("span",{className:"text-xs text-muted-foreground",children:i("quotas.tenantId","Tenant ID")}),d.jsx("span",{className:"text-sm font-mono font-medium text-foreground","data-testid":"usage-tenant-id",children:n.tenantId})]})]})]})]})]})}function M5({label:i,value:e,onChange:t,hint:n,testId:s,step:r=1}){return d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-foreground",children:i}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsx("input",{"data-testid":s,type:"number",value:e,step:r,onChange:o=>t(Number(o.target.value)),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground shadow-sm transition-colors focus:border-sidebar-accent focus:outline-none focus:ring-1 focus:ring-sidebar-accent"})}),d.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:n})]})}function zU({label:i,value:e,limit:t,prefix:n="",testId:s}){const r=t<0,o=!r&&t>0?e/t:0,a=o>=.9?"bg-red-500":o>=.7?"bg-amber-500":"bg-emerald-500";return d.jsxs("div",{className:"rounded-lg border border-border/50 bg-muted/30 p-3","data-testid":s,children:[d.jsx("span",{className:"text-xs text-muted-foreground",children:i}),d.jsxs("div",{className:"mt-1 flex items-baseline gap-1",children:[d.jsxs("span",{className:"text-xl font-bold text-foreground",children:[n,typeof e=="number"&&e%1!==0?e.toFixed(2):e]}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:["/ ",r?"∞":`${n}${t}`]})]}),!r&&d.jsx("div",{className:"mt-2 h-1.5 w-full overflow-hidden rounded-full bg-muted",children:d.jsx("div",{className:`h-full rounded-full transition-all ${a}`,style:{width:`${Math.min(o*100,100)}%`}})})]})}const MDe=["ROUND_TABLE","PEER_REVIEW","DEVIL_ADVOCATE","DELPHI","DEBATE","CUSTOM"];function rut(i=20,e=0,t=""){const n=new URLSearchParams({limit:String(i),index:String(e)});return t&&n.set("filter",t),Oe.get(`/groupstore/groups/descriptors?${n.toString()}`)}function PDe(i,e){const t=e!=null?`?version=${e}`:"";return Oe.get(`/groupstore/groups/${i}${t}`)}function out(i){return Oe.post("/groupstore/groups",i)}function ODe(i,e,t=!0){const n=new URLSearchParams({version:String(e),permanent:String(t)});return Oe.delete(`/groupstore/groups/${i}?${n}`)}function aut(i,e){return Oe.post(`/groupstore/groups/${i}?version=${e}`)}function lut(i,e){return Oe.get(`/groups/${i}/conversations/${e}`)}function cut(i,e=20,t=0){const n=new URLSearchParams({limit:String(e),index:String(t)});return Oe.get(`/groups/${i}/conversations?${n.toString()}`)}function dut(i,e){return Oe.delete(`/groups/${i}/conversations/${e}`)}async function*uut(i,e,t,n){var l;const s=await fetch(`${Oe.getBaseUrl()}/groups/${i}/conversations/stream`,{method:"POST",headers:{"Content-Type":"application/json",...Oe.getAuthHeader()},body:JSON.stringify({question:e,userId:"manager-user"}),signal:n});if(!s.ok)throw new Error(`Group streaming failed: ${s.status} ${s.statusText}`);const r=(l=s.body)==null?void 0:l.getReader();if(!r)throw new Error("No readable stream");const o=new TextDecoder;let a="";try{for(;;){const{done:c,value:u}=await r.read();if(c)break;a+=o.decode(u,{stream:!0});const h=a.split(`
-
-`);a=h.pop()??"";for(const g of h){if(!g.trim())continue;let f="group_start",m="";for(const x of g.split(`
-`))x.startsWith("event:")?f=x.slice(6).trim():x.startsWith("data:")&&(m+=(m?`
-`:"")+x.slice(5).trim());(m||f)&&(yield{type:f,data:m})}}}finally{r.releaseLock()}}function hut(i){const e=i.startsWith("eddi://")?i.replace("eddi://","http://"):i,t=new URL(e,"http://dummy"),n=t.pathname.split("/").filter(Boolean);let s=n[n.length-1]??i;const r=t.searchParams.has("version");let o=r?parseInt(t.searchParams.get("version"),10):NaN;if(!r){const a=s.match(/^(.+?)version(\d+)$/);a&&(s=a[1],o=parseInt(a[2],10))}return{id:s,version:isNaN(o)?1:o}}function gut(i){const e=new Map;for(const t of i){const{id:n,version:s}=hut(t.resource),r=e.get(n);(!r||s>r.version)&&e.set(n,{...t,id:n,version:s})}return Array.from(e.values()).sort((t,n)=>n.lastModifiedOn-t.lastModifiedOn)}async function fut(i=20,e=0,t=""){const n=await rut(i,e,t),s=gut(n);return await Promise.all(s.map(async o=>{var a;try{const l=await PDe(o.id,o.version);return{...o,name:l.name||o.name,description:l.description||o.description,memberCount:((a=l.members)==null?void 0:a.length)??0,style:l.style}}catch{return{...o,memberCount:0}}}))}const Jl={ROUND_TABLE:{label:"Round Table",flow:"Opinion → Discussion → Synthesis",icon:"🗣️"},PEER_REVIEW:{label:"Peer Review",flow:"Opinion → Critique → Revision → Synthesis",icon:"🔍"},DEVIL_ADVOCATE:{label:"Devil's Advocate",flow:"Opinion → Challenge → Defense → Synthesis",icon:"😈"},DELPHI:{label:"Delphi",flow:"Independent → Anonymous Sharing → Revised → Synthesis",icon:"🔮"},DEBATE:{label:"Debate",flow:"Pro Opening → Con Opening → Rebuttals → Judgment",icon:"⚖️"},CUSTOM:{label:"Custom",flow:"User-defined phases",icon:"🛠️"}},put={QUESTION:{label:"Question",color:"blue"},OPINION:{label:"Opinion",color:"green"},CRITIQUE:{label:"Critique",color:"orange"},REVISION:{label:"Revision",color:"teal"},CHALLENGE:{label:"Challenge",color:"red"},DEFENSE:{label:"Defense",color:"purple"},ARGUMENT:{label:"Argument",color:"indigo"},REBUTTAL:{label:"Rebuttal",color:"pink"},SYNTHESIS:{label:"Synthesis",color:"gold"},ERROR:{label:"Error",color:"destructive"},SKIPPED:{label:"Skipped",color:"muted"}};async function mut(i){try{return await Oe.get(`/agentstore/agents/${i}/currentversion`)??1}catch{return 1}}async function but(i,e,t){const n=new Set;for(const r of t.members)r.agentId&&r.memberType!=="GROUP"&&n.add(r.agentId);t.moderatorAgentId&&n.add(t.moderatorAgentId);const s=Array.from(n).map(async r=>{try{const o=await mut(r);await mke(r,o,{permanent:!1})}catch{}});await Promise.allSettled(s),await ODe(i,e,!1)}const GL=["groups"],nre=["groupConversations"];function ire(i=20,e=0,t=""){return hn({queryKey:[...GL,"enriched",{limit:i,index:e,filter:t}],queryFn:()=>fut(i,e,t)})}function xut(i,e){return hn({queryKey:[...GL,i,e],queryFn:()=>PDe(i,e),enabled:!!i})}function jDe(){const i=cn();return Kt({mutationFn:e=>out(e),onSuccess:()=>{i.invalidateQueries({queryKey:GL})}})}function vut(){const i=cn();return Kt({mutationFn:({id:e,version:t,permanent:n})=>ODe(e,t,n),onSuccess:()=>{i.invalidateQueries({queryKey:GL})}})}function _ut(){const i=cn();return Kt({mutationFn:({id:e,version:t})=>aut(e,t),onSuccess:()=>{i.invalidateQueries({queryKey:GL})}})}function yut(i,e=20,t=0){return hn({queryKey:[...nre,i,{limit:e,index:t}],queryFn:()=>cut(i,e,t),enabled:!!i})}function wut(i,e){return hn({queryKey:[...nre,i,e],queryFn:()=>lut(i,e),enabled:!!i&&!!e,refetchInterval:t=>{var s;const n=(s=t.state.data)==null?void 0:s.state;return n==="IN_PROGRESS"||n==="SYNTHESIZING"?3e3:!1}})}function Cut(){const i=cn();return Kt({mutationFn:({groupId:e,conversationId:t})=>dut(e,t),onSuccess:()=>{i.invalidateQueries({queryKey:nre})}})}function Sut(){const i=cn();return Kt({mutationFn:({groupId:e,version:t,config:n})=>but(e,t,n),onSuccess:()=>{i.invalidateQueries({queryKey:GL})}})}const kut=DEe("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",success:"border-transparent bg-emerald-500/15 text-emerald-700 dark:text-emerald-400",warning:"border-transparent bg-amber-500/15 text-amber-700 dark:text-amber-400",destructive:"border-transparent bg-destructive/15 text-destructive",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Fi({className:i,variant:e,...t}){return d.jsx("div",{className:be(kut({variant:e}),i),...t})}function Nut({group:i,memberCount:e=0,style:t,onDuplicate:n,onDelete:s}){const{t:r}=xe(),[o,a]=L.useState(!1),l=t?Jl[t]:null,c=Tw(i.lastModifiedOn);return d.jsxs("div",{className:be("group relative flex flex-col rounded-xl border bg-card p-5 shadow-sm transition-all duration-200","hover:shadow-md hover:border-primary/30","ring-1 ring-border"),"data-testid":`group-card-${i.id}`,children:[d.jsxs("div",{className:"flex items-start justify-between",children:[l?d.jsxs("div",{className:"inline-flex items-center gap-1.5 rounded-full bg-primary/10 px-2.5 py-1 text-xs font-medium text-primary ring-1 ring-primary/20",title:l.flow,children:[d.jsx("span",{children:l.icon}),l.label]}):d.jsxs("div",{className:"inline-flex items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground ring-1 ring-border",children:[d.jsx(ga,{className:"h-3.5 w-3.5"}),"Group"]}),d.jsxs("div",{className:"relative",children:[d.jsx("button",{onClick:()=>a(!o),className:"rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-secondary hover:text-foreground group-hover:opacity-100","data-testid":`group-menu-${i.id}`,children:d.jsx(c7,{className:"h-4 w-4"})}),o&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>a(!1)}),d.jsxs("div",{className:"absolute inset-e-0 z-50 mt-1 w-44 rounded-lg border bg-popover py-1 shadow-lg",children:[n&&d.jsxs("button",{onClick:()=>{n(i.id,i.version),a(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-popover-foreground hover:bg-secondary",children:[d.jsx(mo,{className:"h-4 w-4"}),r("common.duplicate","Duplicate")]}),s&&d.jsxs("button",{onClick:()=>{s(i.id,i.version),a(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-destructive hover:bg-destructive/10",children:[d.jsx(_n,{className:"h-4 w-4"}),r("common.delete")]})]})]})]})]}),d.jsxs("div",{className:"mt-4 flex-1",children:[d.jsxs(Kn,{to:`/manage/groups/${i.id}?version=${i.version}`,className:"text-lg font-semibold text-foreground hover:text-primary transition-colors",children:[i.name||r("groups.unnamed","Unnamed Group"),d.jsx(To,{className:"ms-1 inline h-3.5 w-3.5 opacity-0 group-hover:opacity-50"})]}),d.jsx("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground/70 truncate",title:i.id,children:i.id}),d.jsx("p",{className:"mt-1 line-clamp-2 text-sm text-muted-foreground",children:i.description||r("groups.noDescription","No description")})]}),d.jsxs("div",{className:"mt-4 flex items-center justify-between border-t border-border pt-3",children:[d.jsx("span",{className:"text-xs text-muted-foreground",title:new Date(i.lastModifiedOn).toLocaleString(),children:c}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(Fi,{variant:"secondary",className:"text-[10px]",children:[d.jsx(ga,{className:"me-0.5 h-3 w-3"}),e]}),d.jsxs("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:["v",i.version]})]})]})]})}function FDe(i){return[{key:"advisory-board",name:i("groupTemplates.advisoryBoard"),description:i("groupTemplates.advisoryBoardDesc"),icon:"👔",style:"ROUND_TABLE",maxRounds:2,roles:[{displayName:i("groupTemplates.roles.marketingExpert"),role:"Marketing"},{displayName:i("groupTemplates.roles.techLead"),role:"Engineering"},{displayName:i("groupTemplates.roles.financeDirector"),role:"Finance"},{displayName:i("groupTemplates.roles.legalCounsel"),role:"Legal"},{displayName:i("groupTemplates.roles.strategyConsultant"),role:"Strategy"}],moderatorSuggested:!0},{key:"code-review",name:i("groupTemplates.codeReview"),description:i("groupTemplates.codeReviewDesc"),icon:"🔍",style:"PEER_REVIEW",maxRounds:1,roles:[{displayName:i("groupTemplates.roles.seniorEngineer"),role:"Code Quality"},{displayName:i("groupTemplates.roles.architect"),role:"Architecture"},{displayName:i("groupTemplates.roles.securityReviewer"),role:"Security"}],moderatorSuggested:!0},{key:"risk-assessment",name:i("groupTemplates.riskAssessment"),description:i("groupTemplates.riskAssessmentDesc"),icon:"⚠️",style:"DEVIL_ADVOCATE",maxRounds:1,roles:[{displayName:i("groupTemplates.roles.riskAnalyst"),role:"Risk"},{displayName:i("groupTemplates.roles.domainExpert"),role:"Domain"},{displayName:i("groupTemplates.roles.devilsAdvocate"),role:"DEVIL_ADVOCATE"}],moderatorSuggested:!0},{key:"forecasting",name:i("groupTemplates.forecasting"),description:i("groupTemplates.forecastingDesc"),icon:"🔮",style:"DELPHI",maxRounds:3,roles:[{displayName:i("groupTemplates.roles.analystA"),role:"Forecasting"},{displayName:i("groupTemplates.roles.analystB"),role:"Forecasting"},{displayName:i("groupTemplates.roles.analystC"),role:"Forecasting"},{displayName:i("groupTemplates.roles.analystD"),role:"Forecasting"}],moderatorSuggested:!0},{key:"pro-con",name:i("groupTemplates.proCon"),description:i("groupTemplates.proConDesc"),icon:"⚖️",style:"DEBATE",maxRounds:1,roles:[{displayName:i("groupTemplates.roles.proAdvocate1"),role:"PRO"},{displayName:i("groupTemplates.roles.proAdvocate2"),role:"PRO"},{displayName:i("groupTemplates.roles.conAdvocate1"),role:"CON"},{displayName:i("groupTemplates.roles.conAdvocate2"),role:"CON"}],moderatorSuggested:!0}]}function Eut({open:i,onClose:e,template:t}){const{t:n}=xe(),s=jDe(),{data:r}=e0(100),o=L.useMemo(()=>r?Cg(r):[],[r]),[a,l]=L.useState(t?"basics":"template"),[,c]=L.useState(t??null),[u,h]=L.useState((t==null?void 0:t.name)??""),[g,f]=L.useState((t==null?void 0:t.description)??""),[m,x]=L.useState((t==null?void 0:t.style)??"ROUND_TABLE"),[v,_]=L.useState((t==null?void 0:t.maxRounds)??2),[w,k]=L.useState(t?t.roles.map((G,ne)=>({agentId:"",displayName:G.displayName,speakingOrder:ne+1,role:G.role,memberType:"AGENT"})):[]),[C,E]=L.useState(""),D=L.useMemo(()=>{const G=new Map;for(const ne of o)G.set(ne.id,ne.name||ne.id.slice(0,12));return G},[o]),T=L.useCallback(()=>{l("template"),c(null),h(""),f(""),x("ROUND_TABLE"),_(2),k([]),E(""),e()},[e]);function I(G){c(G),h(G.name),f(G.description),x(G.style),_(G.maxRounds),k(G.roles.map((ne,te)=>({agentId:"",displayName:ne.displayName,speakingOrder:te+1,role:ne.role,memberType:"AGENT"}))),l("basics")}function R(){c(null),l("basics")}function P(){k([...w,{agentId:"",displayName:"",speakingOrder:w.length+1,role:null,memberType:"AGENT"}])}function j(G){k(w.filter((ne,te)=>te!==G))}function B(G,ne){k(w.map((te,H)=>H===G?{...te,...ne}:te))}function U(){const G={name:u,description:g,members:w.filter(ne=>ne.agentId||ne.displayName),moderatorAgentId:C||null,style:m,maxRounds:v,phases:null,protocol:{agentTimeoutSeconds:60,onAgentFailure:"SKIP",maxRetries:2,onMemberUnavailable:"SKIP"}};s.mutate(G,{onSuccess:()=>{ze.success(n("groups.createSuccess","Group created successfully")),T()},onError:()=>ze.error(n("common.error"))})}if(!i)return null;const $=["template","basics","members","review"],K=$.indexOf(a),z=a==="template"||a==="basics"&&u.trim()||a==="members"&&w.length>=2||a==="review";return d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:d.jsxs("div",{className:"relative w-full max-w-2xl max-h-[85vh] overflow-hidden rounded-xl border border-border bg-card shadow-2xl flex flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-3",children:[d.jsx("h2",{className:"text-lg font-bold",children:n("groups.createGroup","Create Group")}),d.jsx("button",{onClick:T,className:"rounded-md p-1 hover:bg-secondary transition-colors",children:d.jsx(An,{className:"h-5 w-5"})})]}),d.jsx("div",{className:"flex items-center gap-2 px-5 py-2 border-b border-border bg-secondary/20",children:$.map((G,ne)=>d.jsxs("div",{className:be("flex items-center gap-1",ne>0&&"ms-2"),children:[ne>0&&d.jsx(hs,{className:"h-3 w-3 text-muted-foreground"}),d.jsx("span",{className:be("text-xs font-medium px-2 py-0.5 rounded-full transition-colors",G===a?"bg-primary text-primary-foreground":ne{var ne;return d.jsxs("button",{onClick:()=>I(G),className:"text-start rounded-lg border border-border p-3 hover:border-primary/50 hover:bg-primary/5 transition-all","data-testid":`template-${G.key}`,children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx("span",{className:"text-lg",children:G.icon}),d.jsx("span",{className:"text-sm font-semibold",children:G.name})]}),d.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:G.description}),d.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[d.jsx(Fi,{variant:"outline",className:"text-[10px]",children:(ne=Jl[G.style])==null?void 0:ne.label}),d.jsxs(Fi,{variant:"secondary",className:"text-[10px]",children:[G.roles.length," roles"]})]})]},G.key)}),d.jsxs("button",{onClick:R,className:"text-start rounded-lg border border-dashed border-border p-3 hover:border-primary/50 hover:bg-primary/5 transition-all","data-testid":"template-blank",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx(Gt,{className:"h-5 w-5 text-muted-foreground"}),d.jsx("span",{className:"text-sm font-semibold",children:n("groups.startBlank","Start from Scratch")})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:n("groups.blankDesc","Configure everything manually.")})]})]})]}),a==="basics"&&d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[n("common.name","Name")," *"]}),d.jsx("input",{value:u,onChange:G=>h(G.target.value),className:"mt-1 w-full rounded-lg border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",placeholder:n("groups.namePlaceholder","e.g. Advisory Board"),"data-testid":"group-name-input"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:n("common.description","Description")}),d.jsx("textarea",{value:g,onChange:G=>f(G.target.value),className:"mt-1 w-full rounded-lg border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",rows:2})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:n("groups.discussionStyle","Discussion Style")}),d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 mt-1",children:MDe.filter(G=>G!=="CUSTOM").map(G=>{var ne,te;return d.jsxs("button",{onClick:()=>x(G),className:be("rounded-lg border p-2 text-start transition-all text-xs",m===G?"border-primary bg-primary/10":"border-border hover:border-primary/30"),children:[d.jsx("span",{className:"text-sm",children:(ne=Jl[G])==null?void 0:ne.icon})," ",d.jsx("span",{className:"font-medium",children:(te=Jl[G])==null?void 0:te.label})]},G)})})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:n("groups.maxRounds","Max Rounds")}),d.jsx("input",{type:"number",value:v,onChange:G=>_(Math.max(1,parseInt(G.target.value)||1)),className:"mt-1 w-20 rounded-lg border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",min:1,max:10})]})]}),a==="members"&&d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:n("groups.assignAgents","Assign agents to each member role.")}),d.jsxs(Yt,{variant:"outline",size:"sm",onClick:P,children:[d.jsx(Gt,{className:"h-3 w-3"})," ",n("groups.addMember","Add Member")]})]}),d.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto pe-1",children:w.map((G,ne)=>d.jsxs("div",{className:"rounded-lg border border-border overflow-hidden bg-card",children:[d.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-secondary/20",children:[d.jsxs("div",{className:"flex items-center rounded-md border border-border bg-background overflow-hidden shrink-0",children:[d.jsx("button",{onClick:()=>B(ne,{memberType:"AGENT"}),className:be("px-2 py-0.5 text-[10px] font-medium transition-colors",G.memberType==="AGENT"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:"Agent"}),d.jsxs("button",{onClick:()=>B(ne,{memberType:"GROUP"}),className:be("px-2 py-0.5 text-[10px] font-medium transition-colors",G.memberType==="GROUP"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[d.jsx(ga,{className:"inline h-2.5 w-2.5 me-0.5"}),"Group"]})]}),d.jsx("input",{value:G.displayName,onChange:te=>B(ne,{displayName:te.target.value}),className:"flex-1 min-w-0 bg-transparent text-xs font-semibold text-foreground focus:outline-none placeholder:text-muted-foreground",placeholder:n("groupWizard.displayName","Display Name")}),d.jsx("input",{value:G.role??"",onChange:te=>B(ne,{role:te.target.value||null}),className:"w-24 bg-transparent text-xs text-muted-foreground focus:outline-none placeholder:text-muted-foreground/50",placeholder:n("groupWizard.rolePlaceholder","Role")}),d.jsx("button",{onClick:()=>j(ne),className:"shrink-0 rounded p-1 text-muted-foreground hover:text-destructive transition-colors",children:d.jsx(_n,{className:"h-3.5 w-3.5"})})]}),d.jsx("div",{className:"px-3 py-2",children:G.memberType==="GROUP"?d.jsx(Dut,{value:G.agentId,onChange:te=>B(ne,{agentId:te})}):d.jsxs("select",{value:G.agentId,onChange:te=>B(ne,{agentId:te.target.value}),className:be("w-full rounded-md border bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring",G.agentId?"border-input":"border-amber-400/50"),children:[d.jsx("option",{value:"",children:n("groups.selectAgent","Select agent…")}),o.map(te=>d.jsx("option",{value:te.id,children:te.name||te.id.slice(0,12)},te.id))]})})]},ne))}),d.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-3",children:[d.jsxs("label",{className:"text-xs font-semibold text-foreground flex items-center gap-1.5 mb-2",children:["⭐ ",n("groups.moderator","Moderator (for synthesis)")]}),d.jsxs("select",{value:C,onChange:G=>E(G.target.value),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",children:[d.jsx("option",{value:"",children:n("groups.noModerator","No moderator")}),o.map(G=>d.jsx("option",{value:G.id,children:G.name||G.id.slice(0,12)},G.id))]})]})]}),a==="review"&&d.jsx(Lut,{name:u,description:g,style:m,maxRounds:v,members:w,moderatorAgentId:C,agentNameMap:D})]}),d.jsxs("div",{className:"flex items-center justify-between border-t border-border px-5 py-3",children:[d.jsx(Yt,{variant:"outline",onClick:()=>{K>0?l($[K-1]):T()},children:K>0?d.jsxs(d.Fragment,{children:[d.jsx(kSe,{className:"h-4 w-4"})," ",n("common.back","Back")]}):n("common.cancel","Cancel")}),a==="review"?d.jsx(Yt,{onClick:U,disabled:s.isPending,children:s.isPending?n("common.saving","Saving…"):n("groups.createGroup","Create Group")}):d.jsxs(Yt,{onClick:()=>l($[K+1]),disabled:!z,children:[n("common.next","Next")," ",d.jsx(hs,{className:"h-4 w-4"})]})]})]})})}function Lut({name:i,description:e,style:t,maxRounds:n,members:s,moderatorAgentId:r,agentNameMap:o}){var c,u,h;const{t:a}=xe(),l=s.filter(g=>!g.agentId).length;return d.jsxs("div",{className:"space-y-4","data-testid":"review-summary",children:[l>0&&d.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-amber-400/40 bg-amber-400/10 px-3 py-2.5",children:[d.jsx(Vi,{className:"h-4 w-4 text-amber-500 shrink-0 mt-0.5"}),d.jsxs("p",{className:"text-xs",children:[d.jsx("span",{className:"font-semibold text-amber-500",children:a("groups.reviewUnassignedWarning","{{count}} member(s) unassigned",{count:l})}),d.jsxs("span",{className:"text-muted-foreground ms-1",children:["— ",a("groups.reviewUnassignedHint","Go back to assign agents before creating.")]})]})]}),d.jsxs("div",{className:"rounded-lg border border-border bg-secondary/10 p-3 space-y-2",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("h3",{className:"text-sm font-bold truncate",children:i}),e&&d.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:e})]}),d.jsxs(Fi,{variant:"outline",className:"shrink-0",children:[(c=Jl[t])==null?void 0:c.icon," ",(u=Jl[t])==null?void 0:u.label]})]}),d.jsx("p",{className:"text-[10px] text-muted-foreground font-mono",children:(h=Jl[t])==null?void 0:h.flow})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[d.jsxs("div",{className:"rounded-lg border border-border bg-secondary/10 p-2.5 text-center",children:[d.jsx(ga,{className:"h-3.5 w-3.5 text-muted-foreground inline-block mb-1"}),d.jsx("div",{className:"text-sm font-bold",children:s.length}),d.jsx("div",{className:"text-[10px] text-muted-foreground",children:a("groups.reviewMembers","Members")})]}),d.jsxs("div",{className:"rounded-lg border border-border bg-secondary/10 p-2.5 text-center",children:[d.jsx(S_,{className:"h-3.5 w-3.5 text-muted-foreground inline-block mb-1"}),d.jsx("div",{className:"text-sm font-bold",children:n}),d.jsx("div",{className:"text-[10px] text-muted-foreground",children:a("groups.reviewRounds","Max Rounds")})]}),d.jsxs("div",{className:"rounded-lg border border-border bg-secondary/10 p-2.5 text-center",children:[d.jsx(Zr,{className:"h-3.5 w-3.5 text-muted-foreground inline-block mb-1"}),d.jsx("div",{className:"text-sm font-bold",children:"60s"}),d.jsx("div",{className:"text-[10px] text-muted-foreground",children:a("groups.reviewTimeout","Agent Timeout")})]})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:a("groups.reviewMemberRoster","Member Roster")}),d.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:s.map((g,f)=>{const m=g.agentId?o.get(g.agentId):null,x=!g.agentId;return d.jsxs("div",{className:be("flex items-center gap-2 px-3 py-2 text-xs",f>0&&"border-t border-border",x&&"bg-amber-400/5"),children:[d.jsx("span",{className:"text-[10px] font-mono text-muted-foreground w-4 shrink-0 text-center",children:f+1}),d.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[d.jsx("span",{className:"font-medium truncate",children:g.displayName}),g.role&&d.jsx(Fi,{variant:"outline",className:"text-[9px] px-1.5 py-0 shrink-0",children:g.role}),g.memberType==="GROUP"&&d.jsxs(Fi,{variant:"secondary",className:"text-[9px] px-1.5 py-0 shrink-0",children:[d.jsx(ga,{className:"h-2 w-2 me-0.5"}),a("groups.memberTypeGroup","Group")]})]}),d.jsx("div",{className:"shrink-0 flex items-center gap-1",children:x?d.jsxs("span",{className:"flex items-center gap-1 text-amber-500 font-medium",children:[d.jsx(Vi,{className:"h-3 w-3"}),a("groups.reviewUnassigned","Unassigned")]}):d.jsxs("span",{className:"flex items-center gap-1 text-emerald-500",children:[d.jsx(Ns,{className:"h-3 w-3"}),d.jsx("span",{className:"text-foreground/70 truncate max-w-[140px]",children:m})]})})]},`${g.displayName}-${f}`)})})]}),d.jsx("div",{className:"rounded-lg border-2 border-primary/15 bg-primary/5 p-3",children:d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx("span",{children:"⭐"}),d.jsx("span",{className:"font-semibold",children:a("groups.reviewModerator","Moderator")}),d.jsx("span",{className:"text-muted-foreground",children:"—"}),r?d.jsx("span",{className:"text-foreground font-medium",children:o.get(r)||r.slice(0,12)}):d.jsx("span",{className:"text-muted-foreground italic",children:a("groups.reviewNoModerator","None (auto-synthesis disabled)")})]})}),d.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-muted-foreground px-1",children:[d.jsx(OE,{className:"h-3 w-3 shrink-0"}),d.jsx("span",{children:a("groups.reviewProtocol","On failure: skip agent • 2 retries • Unavailable members: skip")})]})]})}function Dut({value:i,onChange:e}){const{t}=xe(),{data:n,isLoading:s}=ire(100),r=n&&n.length>0;return s?d.jsx("div",{className:"rounded-md border border-input bg-background px-2 py-1.5 text-xs text-muted-foreground animate-pulse",children:t("common.loading","Loading…")}):r?d.jsxs("select",{value:i,onChange:o=>e(o.target.value),className:be("w-full rounded-md border bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring",i?"border-input":"border-amber-400/50"),children:[d.jsx("option",{value:"",children:t("groupWizard.selectGroup","Select existing group…")}),n.map(o=>d.jsxs("option",{value:o.id,children:[o.name||o.id.slice(0,12)," (",o.memberCount," members)"]},o.id))]}):d.jsxs("div",{className:"rounded-md border border-dashed border-amber-400/50 bg-amber-400/5 px-2 py-2 text-center",children:[d.jsx("p",{className:"text-[10px] font-medium text-amber-600 dark:text-amber-400",children:t("groupWizard.noGroupsYet","No groups available")}),d.jsx("p",{className:"text-[9px] text-muted-foreground mt-0.5",children:t("groupWizard.noGroupsHint","Create a group first, then add it as a nested sub-group member.")})]})}function Tut(){const{t:i}=xe(),[e,t]=L.useState(""),[n,s]=L.useState(!1),[r,o]=L.useState(!1),[a,l]=L.useState(null),[c,u]=L.useState(()=>WE("groups")),h=$s(T=>T.maybeAutoStart);L.useEffect(()=>{const T=setTimeout(()=>h("groups"),500);return()=>clearTimeout(T)},[h]);const{data:g,isLoading:f,isError:m,refetch:x}=ire(100,0,e),v=vut(),_=_ut(),w=g??[];function k(T,I){l({id:T,version:I})}function C(){a&&v.mutate(a,{onSuccess:()=>{ze.success(i("common.delete")+" ✓"),l(null)},onError:()=>ze.error(i("common.error"))})}function E(T,I){_.mutate({id:T,version:I},{onSuccess:()=>ze.success(i("groups.duplicateSuccess","Group duplicated")),onError:()=>ze.error(i("common.error"))})}function D(T){u(T),JM("groups",T)}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-2 text-3xl font-bold text-foreground",children:[d.jsx(pA,{className:"h-8 w-8 text-primary"}),i("pages.groups.title","Groups")]}),d.jsx("p",{className:"mt-1 text-muted-foreground",children:i("pages.groups.subtitle","Multi-agent discussion groups for structured debate and collaboration.")})]}),d.jsx("div",{className:"flex flex-wrap items-center gap-2",children:d.jsxs(Yt,{onClick:()=>s(!0),"data-testid":"create-group-btn",children:[d.jsx(Gt,{className:"h-4 w-4"}),i("createOrWizard.newGroup","New Group")]})})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx(br,{className:"absolute inset-s-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:e,onChange:T=>t(T.target.value),placeholder:i("common.search"),className:"w-full rounded-lg border border-input bg-background py-2.5 ps-10 pe-4 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"group-search"})]}),d.jsx(zL,{view:c,onChange:D})]}),d.jsxs("div",{"data-tour":"groups-content",children:[f&&d.jsx("div",{className:"cq-card-grid",children:Array.from({length:4}).map((T,I)=>d.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 space-y-3",children:[d.jsx(bi,{className:"h-5 w-3/4"}),d.jsx(bi,{className:"h-4 w-1/2"}),d.jsx(bi,{className:"h-4 w-full"}),d.jsx(bi,{className:"h-8 w-1/3"})]},I))}),m&&d.jsx(ep,{message:i("common.error"),onRetry:()=>x(),retryLabel:i("common.retry")}),!f&&!m&&w.length===0&&d.jsx(ZM,{icon:pA,title:e?i("common.noResults"):i("groups.empty","No groups yet"),description:e?void 0:i("groups.emptyDescription","Groups let multiple agents collaborate on structured discussions."),actionLabel:e?void 0:i("groups.createGroup","Create Group"),onAction:e?void 0:()=>s(!0)}),!f&&!m&&w.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:i("groups.count",{count:w.length,defaultValue:"{{count}} groups"})}),c==="card"?d.jsx("div",{className:"cq-card-grid","data-testid":"group-grid",children:w.map(T=>d.jsx(Nut,{group:T,memberCount:T.memberCount,style:T.style,onDuplicate:E,onDelete:k},T.id))}):d.jsx("div",{className:"overflow-hidden rounded-xl border bg-card shadow-sm","data-testid":"group-list",children:d.jsxs("table",{className:"w-full",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-border bg-secondary/50",children:[d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("common.name","Name")}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("common.id","ID")}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("common.version","Version")}),d.jsx("th",{className:"px-5 py-3 text-start text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("common.modified","Modified")}),d.jsx("th",{className:"px-5 py-3 text-end text-xs font-medium uppercase tracking-wider text-muted-foreground",children:i("conversations.actions","Actions")})]})}),d.jsx("tbody",{className:"divide-y divide-border",children:w.map(T=>d.jsxs("tr",{className:"hover:bg-secondary/30 transition-colors",children:[d.jsx("td",{className:"px-5 py-3",children:d.jsxs(Kn,{to:`/manage/groups/${T.id}?version=${T.version}`,className:"text-sm font-medium text-foreground hover:text-primary transition-colors",children:[T.name||i("groups.unnamed","Unnamed Group"),d.jsx(To,{className:"ms-1 inline h-3 w-3 opacity-40"})]})}),d.jsx("td",{className:"px-5 py-3",children:d.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[T.id.slice(0,12),"…"]})}),d.jsx("td",{className:"px-5 py-3",children:d.jsxs("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:["v",T.version]})}),d.jsx("td",{className:"px-5 py-3",children:d.jsx("span",{className:"text-sm text-muted-foreground",title:new Date(T.lastModifiedOn).toLocaleString(),children:Tw(T.lastModifiedOn)})}),d.jsx("td",{className:"px-5 py-3 text-end",children:d.jsxs("div",{className:"inline-flex items-center gap-1",children:[d.jsx("button",{onClick:()=>E(T.id,T.version),className:"rounded-md p-1.5 text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors",title:i("common.duplicate","Duplicate"),children:d.jsx(mo,{className:"h-4 w-4"})}),d.jsx("button",{onClick:()=>k(T.id,T.version),className:"rounded-md p-1.5 text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",title:i("common.delete"),children:d.jsx(_n,{className:"h-4 w-4"})})]})})]},T.id))})]})})]})]}),d.jsx(MEe,{open:n,onClose:()=>s(!1),type:"group",wizardPath:"/manage/groups/wizard",onQuickCreate:()=>{s(!1),o(!0)}}),d.jsx(Eut,{open:r,onClose:()=>o(!1)}),d.jsx(sl,{open:a!==null,onOpenChange:T=>!T&&l(null),title:i("groups.confirmDelete","Delete this group?"),description:i("groups.confirmDeleteDesc","This will permanently delete the group configuration."),confirmLabel:i("common.delete"),cancelLabel:i("common.cancel"),onConfirm:C,isPending:v.isPending})]})}const Ime={isStreaming:!1,conversationId:null,state:"CREATED",transcript:[],currentPhase:null,activeSpeakers:new Set,synthesizedAnswer:null,error:null,startedAt:null};function Iut(){const[i,e]=L.useState(Ime),t=L.useRef(null),n=L.useCallback(async(r,o)=>{var l;(l=t.current)==null||l.abort();const a=new AbortController;t.current=a,e({...Ime,isStreaming:!0,state:"IN_PROGRESS",startedAt:new Date().toISOString()});try{const c=uut(r,o,void 0,a.signal);for await(const u of c)if(Aut(u,e)){a.abort();break}}catch(c){if(!(c instanceof DOMException&&c.name==="AbortError")){const u=c instanceof Error?c.message:String(c);e(h=>({...h,isStreaming:!1,state:"FAILED",error:u}))}}e(c=>c.isStreaming?{...c,isStreaming:!1}:c)},[]),s=L.useCallback(()=>{var r;(r=t.current)==null||r.abort(),e(o=>({...o,isStreaming:!1}))},[]);return{streamState:i,startStream:n,abortStream:s}}function Aut(i,e){switch(i.type){case"group_start":{try{const t=JSON.parse(i.data);e(n=>({...n,conversationId:t.conversationId,state:"IN_PROGRESS",transcript:[{speakerAgentId:"user",speakerDisplayName:"User",content:t.question,phaseIndex:-1,phaseName:null,type:"QUESTION",timestamp:new Date().toISOString(),errorReason:null,targetAgentId:null}]}))}catch{}return!1}case"phase_start":{try{const t=JSON.parse(i.data);e(n=>({...n,currentPhase:{index:t.phaseIndex,name:t.phaseName,type:t.phaseType}}))}catch{}return!1}case"speaker_start":{try{const t=JSON.parse(i.data);e(n=>{var r;const s=new Set(n.activeSpeakers);return s.add(t.agentId),{...n,activeSpeakers:s,transcript:[...n.transcript,{speakerAgentId:t.agentId,speakerDisplayName:t.displayName,content:null,phaseIndex:t.phaseIndex,phaseName:t.phaseName,type:Ame((r=n.currentPhase)==null?void 0:r.type),timestamp:new Date().toISOString(),errorReason:null,targetAgentId:null}]}})}catch{}return!1}case"speaker_complete":{try{const t=JSON.parse(i.data);e(n=>{var a;const s=new Set(n.activeSpeakers);s.delete(t.agentId);const r=[...n.transcript],o=r.findIndex(l=>l.speakerAgentId===t.agentId&&l.content===null&&l.phaseIndex===t.phaseIndex);if(o>=0){const l=r[o];r[o]={speakerAgentId:l.speakerAgentId,speakerDisplayName:l.speakerDisplayName,content:t.response??t.content??null,phaseIndex:l.phaseIndex,phaseName:l.phaseName,type:l.type,timestamp:new Date().toISOString(),errorReason:l.errorReason,targetAgentId:l.targetAgentId}}else r.push({speakerAgentId:t.agentId,speakerDisplayName:t.displayName,content:t.response??t.content??null,phaseIndex:t.phaseIndex,phaseName:t.phaseName,type:Ame((a=n.currentPhase)==null?void 0:a.type),timestamp:new Date().toISOString(),errorReason:null,targetAgentId:null});return{...n,activeSpeakers:s,transcript:r}})}catch{}return!1}case"phase_complete":{try{JSON.parse(i.data),e(t=>({...t,activeSpeakers:new Set}))}catch{}return!1}case"synthesis_start":return e(t=>({...t,state:"SYNTHESIZING"})),!1;case"group_complete":{try{const t=JSON.parse(i.data);e(n=>({...n,isStreaming:!1,state:"COMPLETED",synthesizedAnswer:t.synthesizedAnswer,activeSpeakers:new Set}))}catch{e(t=>({...t,isStreaming:!1,state:"COMPLETED",activeSpeakers:new Set}))}return!0}case"group_error":{let t="Unknown error";try{const n=JSON.parse(i.data);t=n.error||n.message||t}catch{t=i.data||t}return e(n=>({...n,isStreaming:!1,state:"FAILED",error:t,activeSpeakers:new Set})),!0}default:return!1}}function Ame(i){switch(i){case"OPINION":return"OPINION";case"CRITIQUE":return"CRITIQUE";case"REVISION":return"REVISION";case"CHALLENGE":return"CHALLENGE";case"DEFENSE":return"DEFENSE";case"ARGUE":return"ARGUMENT";case"REBUTTAL":return"REBUTTAL";case"SYNTHESIS":return"SYNTHESIS";default:return"OPINION"}}const Rut={OPINION:"💬",CRITIQUE:"🔍",REVISION:"✏️",CHALLENGE:"⚔️",DEFENSE:"🛡️",ARGUE:"📢",REBUTTAL:"↩️",SYNTHESIS:"⭐"};function Mut({name:i,type:e,turnOrder:t,entryCount:n,isActive:s,defaultExpanded:r=!0,children:o}){const[a,l]=L.useState(r),c=Rut[e]||"📋";return d.jsxs("div",{className:be("rounded-xl border",e==="SYNTHESIS"?"border-primary/30 bg-primary/5":"border-border bg-card",s&&"ring-2 ring-primary/30"),"data-testid":`phase-section-${i.replace(/\s+/g,"-").toLowerCase()}`,children:[d.jsxs("button",{onClick:()=>l(!a),className:"flex w-full items-center gap-3 p-3 text-start transition-colors hover:bg-secondary/30 rounded-t-xl",children:[a?d.jsx(Rn,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):d.jsx(hs,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),d.jsx("span",{className:"text-base",children:c}),d.jsx("span",{className:"text-sm font-semibold text-foreground flex-1",children:i}),d.jsxs("div",{className:"flex items-center gap-2",children:[t==="PARALLEL"&&d.jsxs(Fi,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[d.jsx(nc,{className:"me-0.5 h-2.5 w-2.5"})," Parallel"]}),d.jsxs(Fi,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:[d.jsx(ga,{className:"me-0.5 h-2.5 w-2.5"})," ",n]})]})]}),a&&d.jsx("div",{className:"border-t border-border p-2 space-y-1",children:o})]})}/*! @license DOMPurify 3.4.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.1/LICENSE */const{entries:BDe,setPrototypeOf:Rme,isFrozen:Put,getPrototypeOf:Out,getOwnPropertyDescriptor:jut}=Object;let{freeze:Oc,seal:kh,create:pk}=Object,{apply:YG,construct:QG}=typeof Reflect<"u"&&Reflect;Oc||(Oc=function(e){return e});kh||(kh=function(e){return e});YG||(YG=function(e,t){for(var n=arguments.length,s=new Array(n>2?n-2:0),r=2;r1?t-1:0),s=1;s"u"?null:fa(BigInt.prototype.toString),Fme=typeof Symbol>"u"?null:fa(Symbol.prototype.toString),_o=fa(Object.prototype.hasOwnProperty),kT=fa(Object.prototype.toString),fl=fa(RegExp.prototype.test),P5=zut(TypeError);function fa(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s2&&arguments[2]!==void 0?arguments[2]:x2;if(Rme&&Rme(i,null),!xc(e))return i;let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=t(s);r!==s&&(Put(e)||(e[n]=r),s=r)}i[s]=!0}return i}function Uut(i){for(let e=0;e/gm),Xut=kh(/\$\{[\w\W]*/gm),Zut=kh(/^data-[\-\w.\u00B7-\uFFFF]+$/),Jut=kh(/^aria-[\-\w]+$/),HDe=kh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),eht=kh(/^(?:\w+script|data):/i),tht=kh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),WDe=kh(/^html$/i),nht=kh(/^[a-z][.\w]*(-[.\w]+)+$/i);var zme=Object.freeze({__proto__:null,ARIA_ATTR:Jut,ATTR_WHITESPACE:tht,CUSTOM_ELEMENT:nht,DATA_ATTR:Zut,DOCTYPE_NAME:WDe,ERB_EXPR:Qut,IS_ALLOWED_URI:HDe,IS_SCRIPT_OR_DATA:eht,MUSTACHE_EXPR:Yut,TMPLIT_EXPR:Xut});const NT={element:1,text:3,progressingInstruction:7,comment:8,document:9},iht=function(){return typeof window>"u"?null:window},sht=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(n=t.getAttribute(s));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Ume=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function VDe(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:iht();const e=qe=>VDe(qe);if(e.version="3.4.1",e.removed=[],!i||!i.document||i.document.nodeType!==NT.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const n=t,s=n.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:h,DOMParser:g,trustedTypes:f}=i,m=l.prototype,x=mk(m,"cloneNode"),v=mk(m,"remove"),_=mk(m,"nextSibling"),w=mk(m,"childNodes"),k=mk(m,"parentNode");if(typeof o=="function"){const qe=t.createElement("template");qe.content&&qe.content.ownerDocument&&(t=qe.content.ownerDocument)}let C,E="";const{implementation:D,createNodeIterator:T,createDocumentFragment:I,getElementsByTagName:R}=t,{importNode:P}=n;let j=Ume();e.isSupported=typeof BDe=="function"&&typeof k=="function"&&D&&D.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:B,ERB_EXPR:U,TMPLIT_EXPR:$,DATA_ATTR:K,ARIA_ATTR:z,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:ne,CUSTOM_ELEMENT:te}=zme;let{IS_ALLOWED_URI:H}=zme,Q=null;const Y=pi({},[...Bme,...$U,...qU,...KU,...Hme]);let V=null;const ue=pi({},[...Wme,...GU,...Vme,...O5]);let he=Object.seal(pk(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}})),Te=null,nt=null;const ge=Object.seal(pk(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let _e=!0,$e=!0,Ke=!1,ht=!0,Ct=!1,Ft=!0,Ve=!1,tt=!1,qt=!1,It=!1,Zt=!1,En=!1,Xi=!0,zi=!1;const Tr="user-content-";let Fs=!0,qo=!1,Ge={},mt=null;const tn=pi({},["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 Ln=null;const Un=pi({},["audio","video","img","source","image","track"]);let vs=null;const _r=pi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Js="http://www.w3.org/1998/Math/MathML",Ei="http://www.w3.org/2000/svg",wi="http://www.w3.org/1999/xhtml";let ii=wi,Ko=!1,Vr=null;const ba=pi({},[Js,Ei,wi],UU);let ll=pi({},["mi","mo","mn","ms","mtext"]),qc=pi({},["annotation-xml"]);const _s=pi({},["title","style","font","a","script"]);let ys=null;const on=["application/xhtml+xml","text/html"],Nn="text/html";let vn=null,Ci=null;const zr=t.createElement("form"),Ii=function(le){return le instanceof RegExp||le instanceof Function},Si=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ci&&Ci===le)return;(!le||typeof le!="object")&&(le={}),le=id(le),ys=on.indexOf(le.PARSER_MEDIA_TYPE)===-1?Nn:le.PARSER_MEDIA_TYPE,vn=ys==="application/xhtml+xml"?UU:x2,Q=_o(le,"ALLOWED_TAGS")&&xc(le.ALLOWED_TAGS)?pi({},le.ALLOWED_TAGS,vn):Y,V=_o(le,"ALLOWED_ATTR")&&xc(le.ALLOWED_ATTR)?pi({},le.ALLOWED_ATTR,vn):ue,Vr=_o(le,"ALLOWED_NAMESPACES")&&xc(le.ALLOWED_NAMESPACES)?pi({},le.ALLOWED_NAMESPACES,UU):ba,vs=_o(le,"ADD_URI_SAFE_ATTR")&&xc(le.ADD_URI_SAFE_ATTR)?pi(id(_r),le.ADD_URI_SAFE_ATTR,vn):_r,Ln=_o(le,"ADD_DATA_URI_TAGS")&&xc(le.ADD_DATA_URI_TAGS)?pi(id(Un),le.ADD_DATA_URI_TAGS,vn):Un,mt=_o(le,"FORBID_CONTENTS")&&xc(le.FORBID_CONTENTS)?pi({},le.FORBID_CONTENTS,vn):tn,Te=_o(le,"FORBID_TAGS")&&xc(le.FORBID_TAGS)?pi({},le.FORBID_TAGS,vn):id({}),nt=_o(le,"FORBID_ATTR")&&xc(le.FORBID_ATTR)?pi({},le.FORBID_ATTR,vn):id({}),Ge=_o(le,"USE_PROFILES")?le.USE_PROFILES&&typeof le.USE_PROFILES=="object"?id(le.USE_PROFILES):le.USE_PROFILES:!1,_e=le.ALLOW_ARIA_ATTR!==!1,$e=le.ALLOW_DATA_ATTR!==!1,Ke=le.ALLOW_UNKNOWN_PROTOCOLS||!1,ht=le.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ct=le.SAFE_FOR_TEMPLATES||!1,Ft=le.SAFE_FOR_XML!==!1,Ve=le.WHOLE_DOCUMENT||!1,It=le.RETURN_DOM||!1,Zt=le.RETURN_DOM_FRAGMENT||!1,En=le.RETURN_TRUSTED_TYPE||!1,qt=le.FORCE_BODY||!1,Xi=le.SANITIZE_DOM!==!1,zi=le.SANITIZE_NAMED_PROPS||!1,Fs=le.KEEP_CONTENT!==!1,qo=le.IN_PLACE||!1,H=qut(le.ALLOWED_URI_REGEXP)?le.ALLOWED_URI_REGEXP:HDe,ii=typeof le.NAMESPACE=="string"?le.NAMESPACE:wi,ll=_o(le,"MATHML_TEXT_INTEGRATION_POINTS")&&le.MATHML_TEXT_INTEGRATION_POINTS&&typeof le.MATHML_TEXT_INTEGRATION_POINTS=="object"?id(le.MATHML_TEXT_INTEGRATION_POINTS):pi({},["mi","mo","mn","ms","mtext"]),qc=_o(le,"HTML_INTEGRATION_POINTS")&&le.HTML_INTEGRATION_POINTS&&typeof le.HTML_INTEGRATION_POINTS=="object"?id(le.HTML_INTEGRATION_POINTS):pi({},["annotation-xml"]);const Ze=_o(le,"CUSTOM_ELEMENT_HANDLING")&&le.CUSTOM_ELEMENT_HANDLING&&typeof le.CUSTOM_ELEMENT_HANDLING=="object"?id(le.CUSTOM_ELEMENT_HANDLING):pk(null);if(he=pk(null),_o(Ze,"tagNameCheck")&&Ii(Ze.tagNameCheck)&&(he.tagNameCheck=Ze.tagNameCheck),_o(Ze,"attributeNameCheck")&&Ii(Ze.attributeNameCheck)&&(he.attributeNameCheck=Ze.attributeNameCheck),_o(Ze,"allowCustomizedBuiltInElements")&&typeof Ze.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=Ze.allowCustomizedBuiltInElements),Ct&&($e=!1),Zt&&(It=!0),Ge&&(Q=pi({},Hme),V=pk(null),Ge.html===!0&&(pi(Q,Bme),pi(V,Wme)),Ge.svg===!0&&(pi(Q,$U),pi(V,GU),pi(V,O5)),Ge.svgFilters===!0&&(pi(Q,qU),pi(V,GU),pi(V,O5)),Ge.mathMl===!0&&(pi(Q,KU),pi(V,Vme),pi(V,O5))),ge.tagCheck=null,ge.attributeCheck=null,_o(le,"ADD_TAGS")&&(typeof le.ADD_TAGS=="function"?ge.tagCheck=le.ADD_TAGS:xc(le.ADD_TAGS)&&(Q===Y&&(Q=id(Q)),pi(Q,le.ADD_TAGS,vn))),_o(le,"ADD_ATTR")&&(typeof le.ADD_ATTR=="function"?ge.attributeCheck=le.ADD_ATTR:xc(le.ADD_ATTR)&&(V===ue&&(V=id(V)),pi(V,le.ADD_ATTR,vn))),_o(le,"ADD_URI_SAFE_ATTR")&&xc(le.ADD_URI_SAFE_ATTR)&&pi(vs,le.ADD_URI_SAFE_ATTR,vn),_o(le,"FORBID_CONTENTS")&&xc(le.FORBID_CONTENTS)&&(mt===tn&&(mt=id(mt)),pi(mt,le.FORBID_CONTENTS,vn)),_o(le,"ADD_FORBID_CONTENTS")&&xc(le.ADD_FORBID_CONTENTS)&&(mt===tn&&(mt=id(mt)),pi(mt,le.ADD_FORBID_CONTENTS,vn)),Fs&&(Q["#text"]=!0),Ve&&pi(Q,["html","head","body"]),Q.table&&(pi(Q,["tbody"]),delete Te.tbody),le.TRUSTED_TYPES_POLICY){if(typeof le.TRUSTED_TYPES_POLICY.createHTML!="function")throw P5('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof le.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw P5('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=le.TRUSTED_TYPES_POLICY,E=C.createHTML("")}else C===void 0&&(C=sht(f,s)),C!==null&&typeof E=="string"&&(E=C.createHTML(""));Oc&&Oc(le),Ci=le},bo=pi({},[...$U,...qU,...Kut]),Bs=pi({},[...KU,...Gut]),Ai=function(le){let Ze=k(le);(!Ze||!Ze.tagName)&&(Ze={namespaceURI:ii,tagName:"template"});const Mt=x2(le.tagName),Tn=x2(Ze.tagName);return Vr[le.namespaceURI]?le.namespaceURI===Ei?Ze.namespaceURI===wi?Mt==="svg":Ze.namespaceURI===Js?Mt==="svg"&&(Tn==="annotation-xml"||ll[Tn]):!!bo[Mt]:le.namespaceURI===Js?Ze.namespaceURI===wi?Mt==="math":Ze.namespaceURI===Ei?Mt==="math"&&qc[Tn]:!!Bs[Mt]:le.namespaceURI===wi?Ze.namespaceURI===Ei&&!qc[Tn]||Ze.namespaceURI===Js&&!ll[Tn]?!1:!Bs[Mt]&&(_s[Mt]||!bo[Mt]):!!(ys==="application/xhtml+xml"&&Vr[le.namespaceURI]):!1},ws=function(le){ST(e.removed,{element:le});try{k(le).removeChild(le)}catch{v(le)}},lr=function(le,Ze){try{ST(e.removed,{attribute:Ze.getAttributeNode(le),from:Ze})}catch{ST(e.removed,{attribute:null,from:Ze})}if(Ze.removeAttribute(le),le==="is")if(It||Zt)try{ws(Ze)}catch{}else try{Ze.setAttribute(le,"")}catch{}},Oa=function(le){let Ze=null,Mt=null;if(qt)le=""+le;else{const ms=Pme(le,/^[\r\n\t ]+/);Mt=ms&&ms[0]}ys==="application/xhtml+xml"&&ii===wi&&(le=''+le+"");const Tn=C?C.createHTML(le):le;if(ii===wi)try{Ze=new g().parseFromString(Tn,ys)}catch{}if(!Ze||!Ze.documentElement){Ze=D.createDocument(ii,"template",null);try{Ze.documentElement.innerHTML=Ko?E:Tn}catch{}}const Bn=Ze.body||Ze.documentElement;return le&&Mt&&Bn.insertBefore(t.createTextNode(Mt),Bn.childNodes[0]||null),ii===wi?R.call(Ze,Ve?"html":"body")[0]:Ve?Ze.documentElement:Bn},gc=function(le){return T.call(le.ownerDocument||le,le,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},xa=function(le){return le instanceof h&&(typeof le.nodeName!="string"||typeof le.textContent!="string"||typeof le.removeChild!="function"||!(le.attributes instanceof u)||typeof le.removeAttribute!="function"||typeof le.setAttribute!="function"||typeof le.namespaceURI!="string"||typeof le.insertBefore!="function"||typeof le.hasChildNodes!="function")},Ds=function(le){return typeof a=="function"&&le instanceof a};function yr(qe,le,Ze){CT(qe,Mt=>{Mt.call(e,le,Ze,Ci)})}const Fu=function(le){let Ze=null;if(yr(j.beforeSanitizeElements,le,null),xa(le))return ws(le),!0;const Mt=vn(le.nodeName);if(yr(j.uponSanitizeElement,le,{tagName:Mt,allowedTags:Q}),Ft&&le.hasChildNodes()&&!Ds(le.firstElementChild)&&fl(/<[/\w!]/g,le.innerHTML)&&fl(/<[/\w!]/g,le.textContent)||Ft&&le.namespaceURI===wi&&Mt==="style"&&Ds(le.firstElementChild)||le.nodeType===NT.progressingInstruction||Ft&&le.nodeType===NT.comment&&fl(/<[/\w]/g,le.data))return ws(le),!0;if(Te[Mt]||!(ge.tagCheck instanceof Function&&ge.tagCheck(Mt))&&!Q[Mt]){if(!Te[Mt]&&GC(Mt)&&(he.tagNameCheck instanceof RegExp&&fl(he.tagNameCheck,Mt)||he.tagNameCheck instanceof Function&&he.tagNameCheck(Mt)))return!1;if(Fs&&!mt[Mt]){const Tn=k(le)||le.parentNode,Bn=w(le)||le.childNodes;if(Bn&&Tn){const ms=Bn.length;for(let Ur=ms-1;Ur>=0;--Ur){const $r=x(Bn[Ur],!0);Tn.insertBefore($r,_(le))}}}return ws(le),!0}return le instanceof l&&!Ai(le)||(Mt==="noscript"||Mt==="noembed"||Mt==="noframes")&&fl(/<\/no(script|embed|frames)/i,le.innerHTML)?(ws(le),!0):(Ct&&le.nodeType===NT.text&&(Ze=le.textContent,CT([B,U,$],Tn=>{Ze=jS(Ze,Tn," ")}),le.textContent!==Ze&&(ST(e.removed,{element:le.cloneNode()}),le.textContent=Ze)),yr(j.afterSanitizeElements,le,null),!1)},Dp=function(le,Ze,Mt){if(nt[Ze]||Xi&&(Ze==="id"||Ze==="name")&&(Mt in t||Mt in zr))return!1;if(!($e&&!nt[Ze]&&fl(K,Ze))){if(!(_e&&fl(z,Ze))){if(!(ge.attributeCheck instanceof Function&&ge.attributeCheck(Ze,le))){if(!V[Ze]||nt[Ze]){if(!(GC(le)&&(he.tagNameCheck instanceof RegExp&&fl(he.tagNameCheck,le)||he.tagNameCheck instanceof Function&&he.tagNameCheck(le))&&(he.attributeNameCheck instanceof RegExp&&fl(he.attributeNameCheck,Ze)||he.attributeNameCheck instanceof Function&&he.attributeNameCheck(Ze,le))||Ze==="is"&&he.allowCustomizedBuiltInElements&&(he.tagNameCheck instanceof RegExp&&fl(he.tagNameCheck,Mt)||he.tagNameCheck instanceof Function&&he.tagNameCheck(Mt))))return!1}else if(!vs[Ze]){if(!fl(H,jS(Mt,ne,""))){if(!((Ze==="src"||Ze==="xlink:href"||Ze==="href")&&le!=="script"&&Ome(Mt,"data:")===0&&Ln[le])){if(!(Ke&&!fl(G,jS(Mt,ne,"")))){if(Mt)return!1}}}}}}}return!0},KC=pi({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),GC=function(le){return!KC[x2(le)]&&fl(te,le)},pn=function(le){yr(j.beforeSanitizeAttributes,le,null);const{attributes:Ze}=le;if(!Ze||xa(le))return;const Mt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V,forceKeepAttr:void 0};let Tn=Ze.length;for(;Tn--;){const Bn=Ze[Tn],{name:ms,namespaceURI:Ur,value:$r}=Bn,Ui=vn(ms),tx=$r;let qr=ms==="value"?tx:Hut(tx);if(Mt.attrName=Ui,Mt.attrValue=qr,Mt.keepAttr=!0,Mt.forceKeepAttr=void 0,yr(j.uponSanitizeAttribute,le,Mt),qr=Mt.attrValue,zi&&(Ui==="id"||Ui==="name")&&Ome(qr,Tr)!==0&&(lr(ms,le),qr=Tr+qr),Ft&&fl(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,qr)){lr(ms,le);continue}if(Ui==="attributename"&&Pme(qr,"href")){lr(ms,le);continue}if(Mt.forceKeepAttr)continue;if(!Mt.keepAttr){lr(ms,le);continue}if(!ht&&fl(/\/>/i,qr)){lr(ms,le);continue}Ct&&CT([B,U,$],QP=>{qr=jS(qr,QP," ")});const SD=vn(le.nodeName);if(!Dp(SD,Ui,qr)){lr(ms,le);continue}if(C&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Ur)switch(f.getAttributeType(SD,Ui)){case"TrustedHTML":{qr=C.createHTML(qr);break}case"TrustedScriptURL":{qr=C.createScriptURL(qr);break}}if(qr!==tx)try{Ur?le.setAttributeNS(Ur,ms,qr):le.setAttribute(ms,qr),xa(le)?ws(le):Mme(e.removed)}catch{lr(ms,le)}}yr(j.afterSanitizeAttributes,le,null)},Ce=function(le){let Ze=null;const Mt=gc(le);for(yr(j.beforeSanitizeShadowDOM,le,null);Ze=Mt.nextNode();)yr(j.uponSanitizeShadowNode,Ze,null),Fu(Ze),pn(Ze),Ze.content instanceof r&&Ce(Ze.content);yr(j.afterSanitizeShadowDOM,le,null)};return e.sanitize=function(qe){let le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ze=null,Mt=null,Tn=null,Bn=null;if(Ko=!qe,Ko&&(qe=""),typeof qe!="string"&&!Ds(qe)&&(qe=$ut(qe),typeof qe!="string"))throw P5("dirty is not a string, aborting");if(!e.isSupported)return qe;if(tt||Si(le),e.removed=[],typeof qe=="string"&&(qo=!1),qo){const $r=qe.nodeName;if(typeof $r=="string"){const Ui=vn($r);if(!Q[Ui]||Te[Ui])throw P5("root node is forbidden and cannot be sanitized in-place")}}else if(qe instanceof a)Ze=Oa(""),Mt=Ze.ownerDocument.importNode(qe,!0),Mt.nodeType===NT.element&&Mt.nodeName==="BODY"||Mt.nodeName==="HTML"?Ze=Mt:Ze.appendChild(Mt);else{if(!It&&!Ct&&!Ve&&qe.indexOf("<")===-1)return C&&En?C.createHTML(qe):qe;if(Ze=Oa(qe),!Ze)return It?null:En?E:""}Ze&&qt&&ws(Ze.firstChild);const ms=gc(qo?qe:Ze);for(;Tn=ms.nextNode();)Fu(Tn),pn(Tn),Tn.content instanceof r&&Ce(Tn.content);if(qo)return qe;if(It){if(Ct){Ze.normalize();let $r=Ze.innerHTML;CT([B,U,$],Ui=>{$r=jS($r,Ui," ")}),Ze.innerHTML=$r}if(Zt)for(Bn=I.call(Ze.ownerDocument);Ze.firstChild;)Bn.appendChild(Ze.firstChild);else Bn=Ze;return(V.shadowroot||V.shadowrootmode)&&(Bn=P.call(n,Bn,!0)),Bn}let Ur=Ve?Ze.outerHTML:Ze.innerHTML;return Ve&&Q["!doctype"]&&Ze.ownerDocument&&Ze.ownerDocument.doctype&&Ze.ownerDocument.doctype.name&&fl(WDe,Ze.ownerDocument.doctype.name)&&(Ur="
-`+Ur),Ct&&CT([B,U,$],$r=>{Ur=jS(Ur,$r," ")}),C&&En?C.createHTML(Ur):Ur},e.setConfig=function(){let qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Si(qe),tt=!0},e.clearConfig=function(){Ci=null,tt=!1},e.isValidAttribute=function(qe,le,Ze){Ci||Si({});const Mt=vn(qe),Tn=vn(le);return Dp(Mt,Tn,Ze)},e.addHook=function(qe,le){typeof le=="function"&&ST(j[qe],le)},e.removeHook=function(qe,le){if(le!==void 0){const Ze=Fut(j[qe],le);return Ze===-1?void 0:But(j[qe],Ze,1)[0]}return Mme(j[qe])},e.removeHooks=function(qe){j[qe]=[]},e.removeAllHooks=function(){j=Ume()},e}var rht=VDe();function XG(i){if(!i)return"";const e=i.trim();if(e.startsWith("{")||e.startsWith("["))try{const t=JSON.parse(e);if(t&&typeof t=="object"&&!Array.isArray(t)){const n=[];if(Array.isArray(t.output))for(const s of t.output)typeof s=="string"?n.push(s):s!=null&&s.text&&n.push(String(s.text));if(n.length===0){for(const[s,r]of Object.entries(t))if(s.startsWith("output:text:"))if(typeof r=="string")n.push(r);else if(Array.isArray(r))for(const o of r)typeof o=="string"?n.push(o):o!=null&&o.text&&n.push(String(o.text));else r&&typeof r=="object"&&r.text&&n.push(String(r.text))}if(n.length>0)return n.join(`
-`)}}catch{}return i}function sre(i,e="full"){if(i==null)return"";let t;if(typeof i=="number")t=new Date(i<1e12?i*1e3:i);else if(/^\d+(\.\d+)?$/.test(i)){const n=parseFloat(i);t=new Date(n<1e12?n*1e3:n)}else t=new Date(i);if(isNaN(t.getTime()))return String(i);switch(e){case"date":return t.toLocaleDateString();case"time":return t.toLocaleTimeString();default:return t.toLocaleString()}}const oht={DEBATE:{ARGUMENT:"default",REBUTTAL:"warning"},DEVIL_ADVOCATE:{CHALLENGE:"destructive",DEFENSE:"success"}};function aht(i){return/<[a-z][\s\S]*>/i.test(i)}function lht(i){return/^#{1,6}\s|\*\*|\*[^*]|^\s*[-*+]\s|^\s*\d+\.\s|\[.+\]\(.+\)|^>\s|```/m.test(i)}function cht(i){switch(i){case"SYNTHESIS":return"default";case"ERROR":return"destructive";case"SKIPPED":return"secondary";case"CRITIQUE":case"CHALLENGE":return"warning";case"OPINION":case"REVISION":case"DEFENSE":return"success";default:return"outline"}}const dht=144;function uht({entry:i,isSpeaking:e,allowHtml:t,discussionStyle:n,className:s}){var _;const{t:r}=xe(),o=put[i.type],a=i.type==="SYNTHESIS",l=i.type==="ERROR"||i.type==="SKIPPED",c=n&&((_=oht[n])==null?void 0:_[i.type])||cht(i.type),u=i.content?XG(i.content):null,h=t&&u?aht(u):!1,g=L.useRef(null),[f,m]=L.useState(!1),[x,v]=L.useState(!1);return L.useEffect(()=>{g.current&&m(g.current.scrollHeight>dht)},[u]),d.jsxs("div",{className:be("flex gap-3 rounded-lg p-3 transition-colors",a&&"border-2 border-primary/40 bg-primary/5 shadow-sm",l&&"opacity-60",!a&&!l&&"hover:bg-secondary/30",s),"data-testid":`transcript-entry-${i.speakerAgentId}-${i.phaseIndex}`,children:[d.jsx("div",{className:be("flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-xs font-bold text-white",g7(i.speakerAgentId)),title:i.speakerDisplayName,children:f7(i.speakerDisplayName)}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[d.jsx("span",{className:"text-sm font-semibold text-foreground",children:i.speakerDisplayName}),d.jsx(Fi,{variant:c,className:"text-[10px] px-1.5 py-0",children:o.label}),i.targetAgentId&&d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["→ ",i.targetAgentId.slice(0,8),"…"]}),d.jsx("span",{className:"text-[10px] text-muted-foreground ms-auto",children:sre(i.timestamp,"time")})]}),e?d.jsxs("div",{className:"flex items-center gap-2 py-1",children:[d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary animate-bounce [animation-delay:0ms]"}),d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary animate-bounce [animation-delay:150ms]"}),d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary animate-bounce [animation-delay:300ms]"}),d.jsx("span",{className:"text-xs text-muted-foreground ms-1",children:r("groups.responding","responding…")})]}):u?d.jsxs(d.Fragment,{children:[d.jsxs("div",{ref:g,className:be("relative transition-[max-height] duration-300 ease-in-out overflow-hidden",f&&!x&&"max-h-36"),children:[h?d.jsx("div",{className:"text-sm text-foreground/90 leading-relaxed [&_ul]:ms-4 [&_ul]:list-disc [&_li]:mb-0.5 [&_strong]:font-semibold",dangerouslySetInnerHTML:{__html:rht.sanitize(u)}}):lht(u)?d.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none text-foreground/90 [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-3 [&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs [&_hr]:border-border",children:d.jsx(mse,{remarkPlugins:[_se],rehypePlugins:[Ese],children:u})}):d.jsx("div",{className:"text-sm text-foreground/90 whitespace-pre-wrap leading-relaxed",children:u}),f&&!x&&d.jsx("div",{className:be("absolute bottom-0 inset-x-0 h-10 bg-gradient-to-t pointer-events-none",a?"from-primary/5 to-transparent":"from-card to-transparent")})]}),f&&d.jsx("button",{onClick:()=>v(w=>!w),className:"flex items-center gap-1 mt-1 text-xs font-medium text-primary hover:text-primary/80 transition-colors",children:x?d.jsxs(d.Fragment,{children:[d.jsx(Y_,{className:"h-3 w-3"}),r("common.showLess","Show less")]}):d.jsxs(d.Fragment,{children:[d.jsx(Rn,{className:"h-3 w-3"}),r("common.showMore","Show more")]})})]}):i.errorReason?d.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground italic",children:[d.jsx("span",{className:"text-[10px] rounded-full bg-muted px-2 py-0.5",children:i.type==="SKIPPED"?`⏭️ ${r("groups.skipped","Skipped")}`:`⚠️ ${r("common.error","Error")}`}),d.jsx("span",{className:"text-xs",children:i.errorReason})]}):d.jsx("div",{className:"text-sm text-muted-foreground italic",children:r("groups.noResponse","No response")})]})]})}const Vj={ROUND_TABLE:{accent:"text-amber-500",phaseAccent:"border-amber-500/30 bg-amber-500/5",questionBg:"bg-amber-500/5 border-b-amber-500/20",flowBg:"bg-amber-500/10",flowText:"text-amber-600 dark:text-amber-400",progressBg:"bg-amber-500/5",progressText:"text-amber-600 dark:text-amber-400",progressBorder:"border-amber-500/20"},PEER_REVIEW:{accent:"text-teal-500",phaseAccent:"border-teal-500/30 bg-teal-500/5",questionBg:"bg-teal-500/5 border-b-teal-500/20",flowBg:"bg-teal-500/10",flowText:"text-teal-600 dark:text-teal-400",progressBg:"bg-teal-500/5",progressText:"text-teal-600 dark:text-teal-400",progressBorder:"border-teal-500/20"},DEVIL_ADVOCATE:{accent:"text-rose-500",phaseAccent:"border-rose-500/30 bg-rose-500/5",questionBg:"bg-rose-500/5 border-b-rose-500/20",flowBg:"bg-rose-500/10",flowText:"text-rose-600 dark:text-rose-400",progressBg:"bg-rose-500/5",progressText:"text-rose-600 dark:text-rose-400",progressBorder:"border-rose-500/20"},DELPHI:{accent:"text-violet-500",phaseAccent:"border-violet-500/30 bg-violet-500/5",questionBg:"bg-violet-500/5 border-b-violet-500/20",flowBg:"bg-violet-500/10",flowText:"text-violet-600 dark:text-violet-400",progressBg:"bg-violet-500/5",progressText:"text-violet-600 dark:text-violet-400",progressBorder:"border-violet-500/20"},DEBATE:{accent:"text-indigo-500",phaseAccent:"border-indigo-500/30 bg-indigo-500/5",questionBg:"bg-indigo-500/5 border-b-indigo-500/20",flowBg:"bg-indigo-500/10",flowText:"text-indigo-600 dark:text-indigo-400",progressBg:"bg-indigo-500/5",progressText:"text-indigo-600 dark:text-indigo-400",progressBorder:"border-indigo-500/20"},CUSTOM:{accent:"text-primary",phaseAccent:"border-primary/30 bg-primary/5",questionBg:"bg-card/50",flowBg:"bg-primary/10",flowText:"text-primary",progressBg:"bg-primary/5",progressText:"text-primary",progressBorder:"border-primary/20"}};function hht(i){return{OPINION:"OPINION",CRITIQUE:"CRITIQUE",REVISION:"REVISION",CHALLENGE:"CHALLENGE",DEFENSE:"DEFENSE",ARGUMENT:"ARGUE",REBUTTAL:"REBUTTAL",SYNTHESIS:"SYNTHESIS"}[i]||"OPINION"}function ght(i){const e=[];let t=null;for(const n of i){if(n.type==="QUESTION")continue;const s=n.phaseName||`Phase ${n.phaseIndex}`;(!t||t.phaseIndex!==n.phaseIndex||t.phaseName!==s)&&(t={phaseIndex:n.phaseIndex,phaseName:s,phaseType:hht(n.type),entries:[]},e.push(t)),t.entries.push(n)}return e}const $me={CREATED:{variant:"default"},IN_PROGRESS:{variant:"warning"},SYNTHESIZING:{variant:"warning"},COMPLETED:{variant:"success"},FAILED:{variant:"destructive"}},fht=300;function pht({conversation:i,streamState:e,isLoading:t,discussionStyle:n}){var te,H;const{t:s}=xe(),[r,o]=L.useState(!1),[a,l]=L.useState(!1),[c,u]=L.useState(!1),[h,g]=L.useState(!1),f=L.useRef(null),m=L.useRef(null),x=n||"ROUND_TABLE",v=Vj[x]||Vj.ROUND_TABLE,_=Jl[x],w=!!e&&(e.isStreaming||e.state!=="CREATED"),k=L.useMemo(()=>w?e.transcript:(i==null?void 0:i.transcript)??[],[w,e,i==null?void 0:i.transcript]),C=w?e.state:(i==null?void 0:i.state)??"CREATED",E=w?(te=e.currentPhase)==null?void 0:te.name:i==null?void 0:i.currentPhaseName,D=w?(H=e.currentPhase)==null?void 0:H.index:i==null?void 0:i.currentPhaseIndex,T=w?e.synthesizedAnswer:i==null?void 0:i.synthesizedAnswer,I=L.useMemo(()=>{var Q;return w?((Q=k.find(Y=>Y.type==="QUESTION"))==null?void 0:Q.content)??"":(i==null?void 0:i.originalQuestion)??""},[w,k,i==null?void 0:i.originalQuestion]),R=w?e.startedAt??new Date().toISOString():(i==null?void 0:i.created)??new Date().toISOString(),P=w?e.activeSpeakers:new Set,j=w?e.error:null,B=L.useMemo(()=>ght(k),[k]);if(L.useEffect(()=>{w&&m.current&&m.current.scrollTo({top:m.current.scrollHeight,behavior:"smooth"})},[w,k.length]),L.useEffect(()=>{f.current&&g(f.current.scrollHeight>fht)},[T]),t)return d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsx(bi,{className:"h-16 w-full"}),d.jsx(bi,{className:"h-32 w-full"}),d.jsx(bi,{className:"h-32 w-full"})]});if(!w&&!i)return d.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-8",children:[d.jsx("div",{className:be("flex h-16 w-16 items-center justify-center rounded-2xl mb-4",v.flowBg),children:d.jsx(jSe,{className:be("h-8 w-8",v.accent)})}),d.jsx("p",{className:"text-lg font-semibold text-foreground mb-1",children:s("groups.readyToDiscuss","Ready to discuss")}),d.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:s("groups.selectOrStart","Select a past discussion from the history, or type a question below to start a new one.")}),_&&d.jsxs("div",{className:be("flex items-center gap-2 mt-4 rounded-lg px-3 py-2 border border-border",v.flowBg),children:[d.jsx("span",{className:"text-base",children:_.icon}),d.jsx("span",{className:be("text-sm font-medium",v.flowText),children:_.label}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",_.flow]})]})]});const U=$me[C]||$me.CREATED,K={CREATED:s("groups.stateCreated","Created"),IN_PROGRESS:s("conversations.stateInProgress","In Progress"),SYNTHESIZING:s("groups.stateSynthesizing","Synthesizing…"),COMPLETED:s("groups.stateCompleted","Completed"),FAILED:s("groups.stateFailed","Failed")}[C]??C;function z(){const Q=T?XG(T):null;Q&&(navigator.clipboard.writeText(Q),o(!0),setTimeout(()=>o(!1),2e3))}const G=T?XG(T):null,ne=mht[x]||[];return d.jsxs("div",{className:"flex flex-col h-full",children:[d.jsx("div",{className:be("border-b p-4 shrink-0",v.questionBg),children:d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:be("flex h-8 w-8 items-center justify-center rounded-full text-xs font-bold text-white shrink-0 bg-primary"),children:"Q"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[d.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:s("groups.question","Question")}),d.jsx(Fi,{variant:U.variant,className:"text-[10px]",children:K}),w&&d.jsx(Fi,{variant:"outline",className:be("text-[10px] animate-pulse border-current",v.accent),children:"● LIVE"}),d.jsxs("button",{onClick:()=>l(Q=>!Q),className:be("flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] transition-colors border",a?"bg-primary/10 border-primary/30 text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:bg-secondary/50"),title:s("groups.allowHtmlTooltip","When enabled, renders HTML content (sanitized). Use only with trusted agents."),children:[d.jsx(LSe,{className:"h-3 w-3"}),"HTML"]}),d.jsx("span",{className:"text-[10px] text-muted-foreground ms-auto",children:sre(R,"full")})]}),d.jsx("p",{className:"text-base font-medium text-foreground",children:I})]})]})}),x!=="CUSTOM"&&ne.length>0&&d.jsx("div",{className:be("flex items-center gap-1 px-4 py-1.5 border-b border-border shrink-0",v.flowBg),children:ne.map((Q,Y)=>{const V=E==null?void 0:E.toLowerCase().includes(Q.toLowerCase()),ue=C==="COMPLETED"||D!=null&&Y{var V;return d.jsx(Mut,{name:Q.phaseName,type:Q.phaseType,entryCount:Q.entries.length,isActive:(C==="IN_PROGRESS"||C==="SYNTHESIZING")&&Q.phaseIndex===(w?(V=e.currentPhase)==null?void 0:V.index:i==null?void 0:i.currentPhaseIndex),defaultExpanded:!0,children:Q.entries.map((ue,he)=>d.jsx(uht,{entry:ue,isSpeaking:P.has(ue.speakerAgentId)&&ue.content===null,allowHtml:a,discussionStyle:x},`${ue.speakerAgentId}-${ue.phaseIndex}-${he}`))},`${Q.phaseIndex}-${Q.phaseName}-${Y}`)}),G&&d.jsxs("div",{className:be("rounded-xl border-2 border-primary/40 bg-linear-to-b from-primary/10 to-primary/5 p-4 shadow-sm"),"data-testid":"synthesis-card",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-lg",children:"⭐"}),d.jsx("span",{className:"text-sm font-bold text-primary",children:s("groups.synthesis","Synthesis")})]}),d.jsx("button",{onClick:z,className:"flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-primary/10 hover:text-primary transition-colors",title:s("common.copy","Copy"),children:r?d.jsxs(d.Fragment,{children:[d.jsx(Xl,{className:"h-3 w-3"})," ",s("common.copied","Copied")]}):d.jsxs(d.Fragment,{children:[d.jsx(mo,{className:"h-3 w-3"})," ",s("common.copy","Copy")]})})]}),d.jsxs("div",{ref:f,className:be("relative transition-[max-height] duration-300 ease-in-out overflow-hidden",h&&!c&&"max-h-72"),children:[d.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none text-foreground [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-3 [&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs [&_hr]:border-border",children:d.jsx(mse,{remarkPlugins:[_se],rehypePlugins:[Ese],children:G})}),h&&!c&&d.jsx("div",{className:"absolute bottom-0 inset-x-0 h-12 bg-gradient-to-t from-primary/5 to-transparent pointer-events-none"})]}),h&&d.jsx("button",{onClick:()=>u(Q=>!Q),className:"flex items-center gap-1 mt-2 text-xs font-medium text-primary hover:text-primary/80 transition-colors",children:c?d.jsxs(d.Fragment,{children:[d.jsx(Y_,{className:"h-3 w-3"}),s("common.showLess","Show less")]}):d.jsxs(d.Fragment,{children:[d.jsx(Rn,{className:"h-3 w-3"}),s("common.showMore","Show more")]})})]}),(C==="IN_PROGRESS"||C==="SYNTHESIZING")&&d.jsxs("div",{className:be("flex items-center gap-3 p-3 rounded-lg border",v.progressBg,v.progressBorder),children:[d.jsxs("div",{className:"flex gap-1",children:[d.jsx("span",{className:be("h-2 w-2 rounded-full animate-bounce [animation-delay:0ms]",v.accent.replace("text-","bg-"))}),d.jsx("span",{className:be("h-2 w-2 rounded-full animate-bounce [animation-delay:150ms]",v.accent.replace("text-","bg-"))}),d.jsx("span",{className:be("h-2 w-2 rounded-full animate-bounce [animation-delay:300ms]",v.accent.replace("text-","bg-"))})]}),d.jsx("span",{className:be("text-sm font-medium",v.progressText),children:C==="SYNTHESIZING"?s("groups.synthesizing","Moderator is synthesizing…"):s("groups.discussing","Agents are discussing…")}),E&&d.jsx(Fi,{variant:"outline",className:"text-[10px]",children:E}),w&&P.size>0&&d.jsx("span",{className:"text-[10px] text-muted-foreground",children:s("groups.speakingCount","{{count}} speaking",{count:P.size})})]}),j&&d.jsx("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-destructive/5 border border-destructive/20",children:d.jsxs("span",{className:"text-sm text-destructive font-medium",children:["⚠️ ",j]})})]})]})}const mht={ROUND_TABLE:["Opinion","Discussion","Synthesis"],PEER_REVIEW:["Opinion","Critique","Revision","Synthesis"],DEVIL_ADVOCATE:["Opinion","Challenge","Defense","Synthesis"],DELPHI:["Independent","Anonymous","Revised","Synthesis"],DEBATE:["Pro Opening","Con Opening","Rebuttals","Judgment"]},qme=40,Kme=120;function bht({onSubmit:i,isLoading:e,disabled:t}){const{t:n}=xe(),[s,r]=L.useState(""),[o,a]=L.useState(!1),l=L.useRef(null),c=L.useRef(null),u=L.useCallback(()=>{const f=l.current;f&&(f.style.height="auto",f.style.height=`${Math.min(Math.max(f.scrollHeight,qme),Kme)}px`)},[]);L.useEffect(()=>{u()},[s,u]),L.useEffect(()=>{if(o&&c.current){const f=setTimeout(()=>{var m;return(m=c.current)==null?void 0:m.focus()},50);return()=>clearTimeout(f)}},[o]);function h(f){f==null||f.preventDefault(),s.trim()&&!e&&(i(s.trim()),r(""),a(!1))}const g=s.length;return d.jsxs(d.Fragment,{children:[d.jsxs("form",{onSubmit:h,className:"relative flex items-end gap-2 p-3 pb-5 border-t border-border bg-card/80 backdrop-blur-sm shrink-0",children:[d.jsxs("div",{className:"relative flex-1 min-w-0",children:[d.jsx("textarea",{ref:l,value:s,onChange:f=>r(f.target.value),placeholder:n("groups.askQuestion","Ask a question for the group to discuss…"),className:"w-full resize-none rounded-lg border border-input bg-background px-3 py-2 pe-8 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow",style:{minHeight:qme,maxHeight:Kme},rows:1,disabled:t||e,onKeyDown:f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),h())},"data-testid":"discussion-input"}),d.jsx("button",{type:"button",onClick:()=>a(!0),className:"absolute end-2 top-2 rounded p-0.5 text-muted-foreground hover:text-foreground hover:bg-secondary/50 transition-colors",title:n("groups.expandInput","Expand input"),children:d.jsx(zBe,{className:"h-3.5 w-3.5"})})]}),d.jsxs(Yt,{type:"submit",disabled:!s.trim()||e||t,className:"shrink-0","data-testid":"start-discussion-btn",children:[e?d.jsx(ni,{className:"h-4 w-4 animate-spin"}):d.jsx(mA,{className:"h-4 w-4"}),d.jsx("span",{className:"hidden sm:inline ms-1",children:n("groups.startDiscussion","Discuss")})]}),s.length>0&&d.jsxs("p",{className:"absolute -bottom-4 start-0 text-[10px] text-muted-foreground/60",children:["↵ ",n("groups.enterToSend","Enter to send")," · ⇧↵ ",n("groups.shiftEnter","new line")]})]}),d.jsx(YM,{open:o,onClose:()=>a(!1),title:n("groups.composeQuestion","Compose Question"),maxWidth:"max-w-2xl",testId:"discussion-input-dialog",children:d.jsxs("div",{className:"p-5 space-y-3",children:[d.jsx("textarea",{ref:c,value:s,onChange:f=>r(f.target.value),placeholder:n("groups.askQuestion","Ask a question for the group to discuss…"),className:"w-full resize-y rounded-lg border border-input bg-background px-4 py-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow min-h-[200px]",rows:8,disabled:e,onKeyDown:f=>{f.key==="Enter"&&(f.ctrlKey||f.metaKey)&&(f.preventDefault(),h())},"data-testid":"discussion-input-expanded"}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("p",{className:"text-xs text-muted-foreground",children:n("groups.submitShortcut","Ctrl+Enter to submit")}),g>0&&d.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[g.toLocaleString()," ",n("groups.characters","characters")]})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-2 border-t border-border",children:[d.jsx(Yt,{variant:"outline",onClick:()=>a(!1),children:n("common.cancel","Cancel")}),d.jsxs(Yt,{onClick:()=>h(),disabled:!s.trim()||e,children:[e?d.jsx(ni,{className:"h-4 w-4 animate-spin me-1"}):d.jsx(mA,{className:"h-4 w-4 me-1"}),n("groups.startDiscussion","Discuss")]})]})]})})]})}const Gme={ROUND_TABLE:{bg:"bg-amber-500/10",border:"border-amber-500/30",text:"text-amber-600 dark:text-amber-400"},PEER_REVIEW:{bg:"bg-teal-500/10",border:"border-teal-500/30",text:"text-teal-600 dark:text-teal-400"},DEVIL_ADVOCATE:{bg:"bg-rose-500/10",border:"border-rose-500/30",text:"text-rose-600 dark:text-rose-400"},DELPHI:{bg:"bg-violet-500/10",border:"border-violet-500/30",text:"text-violet-600 dark:text-violet-400"},DEBATE:{bg:"bg-indigo-500/10",border:"border-indigo-500/30",text:"text-indigo-600 dark:text-indigo-400"},CUSTOM:{bg:"bg-secondary/20",border:"border-border",text:"text-foreground"}};function xht({config:i,groupId:e,groupVersion:t,className:n}){const{t:s}=xe(),r=il(),o=Jl[i.style]||Jl.ROUND_TABLE,a=Gme[i.style]||Gme.ROUND_TABLE,[l,c]=L.useState(!1),u=Sut();function h(){!e||t==null||u.mutate({groupId:e,version:t,config:i},{onSuccess:()=>{ze.success(s("groups.deleteWithMembersSuccess","Group and all member agents deleted (soft-delete)")),r("/manage/groups")},onError:()=>ze.error(s("common.error"))})}return d.jsxs("div",{className:be("flex flex-col gap-4 p-4 overflow-y-auto",n),children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold text-foreground",children:i.name}),i.description&&d.jsx("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-3",children:i.description})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:s("groups.discussionStyle","Discussion Style")}),d.jsxs("div",{className:be("rounded-lg border p-2.5",a.border,a.bg),children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx("span",{className:"text-base",children:o.icon}),d.jsx("span",{className:be("text-sm font-semibold",a.text),children:o.label})]}),d.jsx(vht,{flow:o.flow})]})]}),d.jsxs("div",{children:[d.jsxs("h4",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:[d.jsx(ga,{className:"inline h-3 w-3 me-1"}),s("groups.membersCount",{count:i.members.length,defaultValue:"{{count}} Members"})]}),d.jsx("div",{className:"space-y-1",children:i.members.map((g,f)=>d.jsxs("div",{className:"flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-secondary/30 transition-colors",children:[d.jsx("div",{className:be("flex h-6 w-6 items-center justify-center rounded-full text-[10px] font-bold text-white shrink-0",g7(g.agentId||String(f))),children:f7(g.displayName||"?")}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:g.displayName}),g.agentId&&d.jsxs("p",{className:"text-[10px] text-muted-foreground font-mono truncate",children:[g.agentId.slice(0,12),"…"]})]}),d.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[g.role&&d.jsx(Fi,{variant:"outline",className:"text-[9px] px-1 py-0",children:g.role}),g.memberType==="GROUP"&&d.jsxs(Fi,{variant:"secondary",className:"text-[9px] px-1 py-0",children:[d.jsx(ga,{className:"h-2 w-2 me-0.5"})," Group"]}),i.moderatorAgentId===g.agentId&&d.jsx(Fi,{variant:"default",className:"text-[9px] px-1 py-0",children:"⭐ Mod"})]})]},`${g.agentId}-${f}`))})]}),i.protocol&&d.jsxs("div",{children:[d.jsxs("h4",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:[d.jsx(Wie,{className:"inline h-3 w-3 me-1"}),s("groups.protocolSettings","Protocol")]}),d.jsxs("div",{className:"rounded-lg border border-border bg-secondary/30 p-2.5 space-y-1",children:[d.jsx(ET,{label:s("groups.protocolTimeout","Timeout"),value:`${i.protocol.agentTimeoutSeconds}s`}),d.jsx(ET,{label:s("groups.protocolOnFailure","On Failure"),value:i.protocol.onAgentFailure}),d.jsx(ET,{label:s("groups.protocolMaxRetries","Max Retries"),value:String(i.protocol.maxRetries)}),d.jsx(ET,{label:s("groups.protocolUnavailable","Unavailable"),value:i.protocol.onMemberUnavailable}),d.jsx(ET,{label:s("groups.protocolMaxRounds","Max Rounds"),value:String(i.maxRounds)})]})]}),e&&t!=null&&d.jsx("div",{className:"mt-auto pt-4 border-t border-border",children:l?d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-amber-500/30 bg-amber-500/5 p-2",children:[d.jsx(Vi,{className:"h-3.5 w-3.5 text-amber-500 shrink-0 mt-0.5"}),d.jsx("p",{className:"text-[10px] text-muted-foreground leading-relaxed",children:s("groups.deleteWithMembersWarning","This will soft-delete the group and all {{count}} member agents. They can be recovered.",{count:i.members.length})})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Yt,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>c(!1),children:s("common.cancel","Cancel")}),d.jsxs(Yt,{variant:"destructive",size:"sm",className:"flex-1",onClick:h,disabled:u.isPending,children:[u.isPending?d.jsx(xi,{className:"h-3 w-3 animate-spin me-1"}):d.jsx(_n,{className:"h-3 w-3 me-1"}),s("common.confirm","Confirm")]})]})]}):d.jsxs(Yt,{variant:"outline",size:"sm",className:"w-full text-destructive border-destructive/30 hover:bg-destructive/10 hover:text-destructive",onClick:()=>c(!0),children:[d.jsx(_n,{className:"h-3.5 w-3.5 me-1.5"}),s("groups.deleteGroupAndAgents","Delete Group + All Agents")]})})]})}function ET({label:i,value:e}){return d.jsxs("div",{className:"flex items-center justify-between text-xs",children:[d.jsx("span",{className:"text-muted-foreground",children:i}),d.jsx("span",{className:"font-medium text-foreground",children:e})]})}function vht({flow:i}){const e=i.split(" → ");return d.jsx("div",{className:"flex flex-wrap items-center gap-1 mt-1",children:e.map((t,n)=>d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"text-[10px] font-medium text-foreground/80 rounded-md bg-background px-1.5 py-0.5 border border-border",children:t}),ne.get("version")?Number(e.get("version")):1,[e]),{t:n}=xe(),s=cn(),[r,o]=L.useState(null),[a,l]=L.useState(!0),[c,u]=L.useState(!1),[h,g]=L.useState(!1),{data:f,isLoading:m,isError:x,refetch:v}=xut(i||"",t),{data:_,isLoading:w}=yut(i||""),{data:k,isLoading:C}=wut(i||"",r||""),{streamState:E,startStream:D,abortStream:T}=Iut(),I=Cut();L.useEffect(()=>{!r&&!E.isStreaming&&_&&_.length>0&&o(_[0].id)},[_,r,E.isStreaming]);const R=L.useCallback(ne=>{i&&(o(null),D(i,ne),ze.success(n("groups.discussionStarted","Discussion started — streaming live")))},[i,D,n]);L.useEffect(()=>{E.state==="COMPLETED"&&E.conversationId&&!E.isStreaming&&(o(E.conversationId),i&&s.invalidateQueries({queryKey:["groupConversations",i]}))},[E.state,E.conversationId,E.isStreaming,i,s]);function P(ne){i&&I.mutate({groupId:i,conversationId:ne},{onSuccess:()=>{ze.success(n("common.delete")+" ✓"),r===ne&&o(null)}})}function j(ne){E.isStreaming&&T(),o(ne),g(!1)}if(m)return d.jsxs("div",{className:"space-y-4",children:[d.jsx(bi,{className:"h-8 w-1/3"}),d.jsx(bi,{className:"h-[70vh] w-full"})]});if(x||!f)return d.jsxs("div",{className:"space-y-4",children:[d.jsx(EA,{to:"/manage/groups",label:n("groups.backToGroups","Back to Groups")}),d.jsx(ep,{message:n("common.error"),onRetry:()=>v(),retryLabel:n("common.retry")})]});const B=Jl[f.style]??Jl.ROUND_TABLE,U=Vj[f.style]??Vj.ROUND_TABLE,$=f.members?f:{...f,members:[]},K=E.isStreaming||E.state!=="CREATED"&&!r,z=(_==null?void 0:_.length)??0,G=d.jsx(d.Fragment,{children:w?d.jsxs("div",{className:"p-3 space-y-2",children:[d.jsx(bi,{className:"h-12 w-full"}),d.jsx(bi,{className:"h-12 w-full"})]}):z>0?d.jsx("div",{className:"p-1 space-y-0.5",children:_.map(ne=>d.jsxs("button",{onClick:()=>j(ne.id),className:be("w-full text-start rounded-lg px-3 py-2 transition-all group/item",r===ne.id&&!K?"bg-primary/10 border border-primary/30":"hover:bg-secondary/50 border border-transparent"),"data-testid":`discussion-item-${ne.id}`,children:[d.jsx("p",{className:"text-xs font-medium text-foreground line-clamp-2",children:ne.originalQuestion}),d.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[d.jsx("span",{className:be("text-[10px] font-medium",_ht[ne.state]),children:ne.state}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:sre(ne.created,"date")}),d.jsx("button",{onClick:te=>{te.stopPropagation(),P(ne.id)},className:"ms-auto opacity-0 group-hover/item:opacity-100 rounded p-0.5 text-muted-foreground hover:text-destructive transition-all",title:n("common.delete"),children:d.jsx(_n,{className:"h-3 w-3"})})]})]},ne.id))}):d.jsxs("div",{className:"flex flex-col items-center justify-center py-8 px-4 text-center",children:[d.jsx(jSe,{className:"h-8 w-8 text-muted-foreground/20 mb-2"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:n("groups.noDiscussions","No discussions yet")}),d.jsx("p",{className:"text-[10px] text-muted-foreground/50 mt-1",children:n("groups.askBelow","Ask a question below to start")})]})});return d.jsxs("div",{className:be("flex flex-col",c?"fixed inset-0 z-50 bg-background p-4":"h-[calc(100vh-(--spacing(16))-(--spacing(12)))]"),children:[d.jsxs("div",{className:"flex items-center gap-3 pb-3 border-b border-border shrink-0",children:[!c&&d.jsx(EA,{to:"/manage/groups",label:""}),d.jsx(ga,{className:"h-6 w-6 text-primary shrink-0"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h1",{className:"text-xl font-bold text-foreground truncate",children:f.name}),f.description&&d.jsx("p",{className:"text-xs text-muted-foreground truncate",children:f.description})]}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[B&&d.jsxs(Fi,{variant:"outline",className:be("hidden sm:inline-flex",U.flowText),title:B.flow,children:[B.icon," ",B.label]}),d.jsxs(Fi,{variant:"secondary",children:[d.jsx(ga,{className:"me-1 h-3 w-3"}),$.members.length]}),d.jsx(wht,{historyOpen:h,setHistoryOpen:g,conversationCount:z,isFullscreen:c,children:G}),!c&&d.jsx(Yt,{variant:"outline",size:"sm",onClick:()=>l(!a),title:a?n("groups.hideConfig","Hide config panel"):n("groups.showConfig","Show config panel"),className:"max-xl:hidden",children:a?d.jsx(WSe,{className:"h-4 w-4"}):d.jsx(hHe,{className:"h-4 w-4"})}),d.jsx(Yt,{variant:"outline",size:"sm",onClick:()=>u(!c),title:c?n("groups.exitFullscreen","Exit fullscreen"):n("groups.enterFullscreen","Fullscreen"),children:c?d.jsx(BSe,{className:"h-4 w-4"}):d.jsx(jie,{className:"h-4 w-4"})})]})]}),d.jsxs("div",{className:"flex flex-1 min-h-0 mt-2 gap-2",children:[!c&&d.jsxs("div",{className:"w-64 shrink-0 flex flex-col rounded-xl border border-border bg-card overflow-hidden max-lg:hidden",children:[d.jsx("div",{className:"p-3 border-b border-border",children:d.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[d.jsx(Zr,{className:"h-3 w-3"}),n("groups.discussions","Discussions")]})}),d.jsx("div",{className:"flex-1 overflow-y-auto",children:G})]}),d.jsxs("div",{className:"flex-1 min-w-0 rounded-xl border border-border bg-card overflow-hidden flex flex-col",children:[d.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:d.jsx(pht,{conversation:K?null:k??null,streamState:K?E:void 0,isLoading:C&&!!r,discussionStyle:f.style})}),d.jsx(bht,{onSubmit:R,isLoading:E.isStreaming})]}),a&&!c&&d.jsx("div",{className:"w-72 shrink-0 rounded-xl border border-border bg-card overflow-hidden max-xl:hidden",children:d.jsx(xht,{config:$,groupId:i,groupVersion:t})})]})]})}function wht({historyOpen:i,setHistoryOpen:e,conversationCount:t,isFullscreen:n,children:s}){const{t:r}=xe(),o=L.useRef(null);return L.useEffect(()=>{if(!i)return;function a(l){o.current&&!o.current.contains(l.target)&&e(!1)}return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[i,e]),d.jsxs("div",{ref:o,className:be("relative",!n&&"lg:hidden"),children:[d.jsxs(Yt,{variant:"outline",size:"sm",className:"relative",onClick:()=>e(!i),children:[d.jsx(PE,{className:"h-4 w-4"}),t>0&&d.jsx("span",{className:"absolute -top-1 -end-1 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-[9px] font-bold text-primary-foreground",children:t})]}),i&&d.jsxs("div",{className:"absolute end-0 top-full mt-1 z-50 w-72 rounded-xl border border-border bg-card shadow-lg max-h-80 overflow-y-auto animate-in fade-in-0 zoom-in-95 duration-150",children:[d.jsx("div",{className:"p-3 border-b border-border",children:d.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[d.jsx(Zr,{className:"h-3 w-3"}),r("groups.discussions","Discussions")]})}),s]})]})}function zDe(i,e,t){return{agentId:"",displayName:e||"",speakingOrder:i+1,role:t||null,memberType:"AGENT",mode:"new",systemPrompt:"",provider:"anthropic",model:"",apiKey:"",created:!1,creating:!1}}function UDe(){return{agentId:"",displayName:"Moderator",speakingOrder:0,role:"MODERATOR",memberType:"AGENT",mode:"new",systemPrompt:"You are a skilled moderator. Synthesize the group's discussion into a clear, balanced summary that captures key insights, areas of agreement, and remaining disagreements.",provider:"anthropic",model:"",apiKey:"",created:!1,creating:!1}}const Yme={name:"",description:"",style:"ROUND_TABLE",maxRounds:2,members:[],moderator:null},j5=[{id:"template",icon:Ll},{id:"config",icon:Nl},{id:"members",icon:ga},{id:"review",icon:Ih}],zj={ROUND_TABLE:{bg:"bg-amber-500/10",border:"border-amber-500/30",text:"text-amber-600 dark:text-amber-400",accent:"bg-amber-500"},PEER_REVIEW:{bg:"bg-teal-500/10",border:"border-teal-500/30",text:"text-teal-600 dark:text-teal-400",accent:"bg-teal-500"},DEVIL_ADVOCATE:{bg:"bg-rose-500/10",border:"border-rose-500/30",text:"text-rose-600 dark:text-rose-400",accent:"bg-rose-500"},DELPHI:{bg:"bg-violet-500/10",border:"border-violet-500/30",text:"text-violet-600 dark:text-violet-400",accent:"bg-violet-500"},DEBATE:{bg:"bg-indigo-500/10",border:"border-indigo-500/30",text:"text-indigo-600 dark:text-indigo-400",accent:"bg-indigo-500"},CUSTOM:{bg:"bg-secondary/20",border:"border-border",text:"text-foreground",accent:"bg-muted-foreground"}};function Cht(){var T;const{t:i}=xe(),[e,t]=L.useState(0),[n,s]=L.useState(Yme),[r,o]=L.useState(null),[a,l]=L.useState(1),[c,u]=L.useState(null),[h,g]=L.useState(!1),f=jDe(),m=f.isPending||h,x=j5[e],v=L.useCallback(I=>s(R=>({...R,...I})),[]);function _(I){v({name:I.name,description:I.description,style:I.style,maxRounds:I.maxRounds,members:I.roles.map((R,P)=>zDe(P,R.displayName,R.role)),moderator:I.moderatorSuggested?UDe():null}),t(1)}function w(){if(!x)return!1;switch(x.id){case"template":return!0;case"config":return n.name.trim().length>0;case"members":return n.members.length<2?!1:n.members.every(I=>I.displayName.trim()&&(I.agentId||I.mode==="new"));case"review":return!0;default:return!1}}function k(){e0&&t(e-1)}async function E(){var B,U;g(!0);const I=[...n.members];let R=n.moderator?{...n.moderator}:null;const P=I.map(($,K)=>({slot:$,index:K})).filter(({slot:$})=>$.mode==="new"&&!$.created&&!$.agentId);for(const{slot:$,index:K}of P){u(i("groupWizard.creatingSlot",{name:$.displayName}));try{const z=await DA({name:`${n.name} — ${$.displayName}`.trim(),systemPrompt:$.systemPrompt||`You are ${$.displayName}${$.role?`, a ${$.role} expert`:""}. Provide clear, actionable insights.`,provider:$.provider||"anthropic",model:$.model||(((B=np.find(G=>G.id===($.provider||"anthropic")))==null?void 0:B.defaultModel)??"claude-sonnet-4-6"),apiKey:$.apiKey||void 0,deploy:!0});I[K]={...I[K],agentId:z.agentId,created:!0}}catch(z){ze.error(i("groupWizard.agentCreateFailed",{error:z instanceof Error?z.message:String(z)})),g(!1),u(null),s(G=>({...G,members:I}));return}}if(R&&R.mode==="new"&&!R.created&&!R.agentId){u(i("groupWizard.creatingModerator"));try{const $=await DA({name:`${n.name} — Moderator`.trim(),systemPrompt:R.systemPrompt||"You are a skilled moderator. Synthesize the discussion into a clear, balanced summary.",provider:R.provider||"anthropic",model:R.model||(((U=np.find(K=>K.id===(R.provider||"anthropic")))==null?void 0:U.defaultModel)??"claude-sonnet-4-6"),apiKey:R.apiKey||void 0,deploy:!0});R={...R,agentId:$.agentId,created:!0}}catch($){ze.error(i("groupWizard.agentCreateFailed",{error:$ instanceof Error?$.message:String($)})),g(!1),u(null);return}}s($=>({...$,members:I,moderator:R})),u(i("groupWizard.creatingGroup"));const j={name:n.name,description:n.description,members:I.filter($=>$.agentId||$.displayName).map($=>({agentId:$.agentId,displayName:$.displayName,speakingOrder:$.speakingOrder,role:$.role,memberType:$.memberType})),moderatorAgentId:(R==null?void 0:R.agentId)||null,style:n.style,maxRounds:n.maxRounds,phases:null,protocol:{agentTimeoutSeconds:60,onAgentFailure:"SKIP",maxRetries:2,onMemberUnavailable:"SKIP"}};f.mutate(j,{onSuccess:$=>{ze.success(i("groupWizard.success"));let K="new",z=1;try{const G=$==null?void 0:$.location;if(G){const ne=uo(G);K=ne.id,z=ne.version}}catch{K=typeof $=="string"?$:($==null?void 0:$.id)??"new"}o(K),l(z),g(!1),u(null)},onError:()=>{ze.error(i("common.error")),g(!1),u(null)}})}if(r)return d.jsx("div",{className:"mx-auto max-w-2xl space-y-8",children:d.jsxs("div",{className:"rounded-2xl border border-emerald-500/30 bg-card p-8 text-center shadow-lg",children:[d.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-emerald-500/10",children:d.jsx(Xl,{className:"h-8 w-8 text-emerald-500"})}),d.jsx("h2",{className:"text-2xl font-bold text-foreground",children:i("groupWizard.created")}),d.jsxs("p",{className:"mt-2 text-muted-foreground",children:[n.name," — ",n.members.length," ",i("groups.members")," · ",(T=Jl[n.style])==null?void 0:T.label]}),d.jsxs("div",{className:"mt-6 flex items-center justify-center gap-3",children:[d.jsxs(Kn,{to:`/manage/groups/${r}?version=${a}`,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 hover:shadow-md active:scale-[0.98]",children:[i("groupWizard.viewGroup"),d.jsx(To,{className:"h-4 w-4"})]}),d.jsx("button",{onClick:()=>{s(Yme),t(0),o(null),l(1)},className:"inline-flex items-center gap-2 rounded-lg border border-border px-4 py-2.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",children:i("groupWizard.createAnother")})]})]})});const D=zj[n.style]||zj.ROUND_TABLE;return d.jsxs("div",{className:"mx-auto max-w-3xl space-y-8",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Kn,{to:"/manage/groups",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(El,{className:"h-4 w-4"}),i("groupWizard.backToGroups")]}),d.jsxs("h1",{className:"flex items-center gap-3 text-3xl font-bold text-foreground",children:[d.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-primary/10",children:d.jsx(RL,{className:"h-5 w-5 text-primary"})}),i("groupWizard.title")]}),d.jsx("p",{className:"text-muted-foreground",children:i("groupWizard.subtitle")})]}),d.jsx("div",{className:"flex items-center gap-2","data-testid":"group-wizard-steps",children:j5.map((I,R)=>{const P=I.icon,j=R===e,B=RRe,className:be("flex h-10 w-10 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-300",j&&"border-primary bg-primary text-primary-foreground shadow-md shadow-primary/25 scale-110",B&&"border-emerald-500 bg-emerald-500 text-white",!j&&!B&&"border-border bg-card text-muted-foreground"),children:B?d.jsx(Ns,{className:"h-4 w-4"}):d.jsx(P,{className:"h-4 w-4"})}),Rt(1)}),(x==null?void 0:x.id)==="config"&&d.jsx(kht,{state:n,onChange:v}),(x==null?void 0:x.id)==="members"&&d.jsx(Nht,{state:n,onChange:v,styleColors:D}),(x==null?void 0:x.id)==="review"&&d.jsx(Dht,{state:n})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("button",{onClick:C,disabled:e===0,className:be("inline-flex items-center gap-2 rounded-lg px-4 py-2.5 text-sm font-medium transition-colors",e===0?"invisible":"text-muted-foreground hover:bg-secondary hover:text-foreground"),"data-testid":"group-wizard-back",children:[d.jsx(El,{className:"h-4 w-4"}),i("common.back","Back")]}),(x==null?void 0:x.id)!=="review"?d.jsxs("button",{onClick:k,disabled:!w(),className:"inline-flex items-center gap-2 rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50 active:scale-[0.98]","data-testid":"group-wizard-next",children:[i("common.next","Next"),d.jsx(wg,{className:"h-4 w-4"})]}):d.jsx("button",{onClick:()=>E(),disabled:m,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50 active:scale-[0.98]","data-testid":"group-wizard-create",children:m?d.jsxs(d.Fragment,{children:[d.jsx(xi,{className:"h-4 w-4 animate-spin"}),c||i("groupWizard.createGroup")]}):d.jsxs(d.Fragment,{children:[d.jsx(Ih,{className:"h-4 w-4"}),i("groupWizard.createGroup")]})})]})]})}function Sht({onSelect:i,onSkip:e}){const{t}=xe();return d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-semibold text-foreground",children:t("groupWizard.templateTitle")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t("groupWizard.templateDesc")}),d.jsxs("div",{className:"mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2","data-testid":"template-grid",children:[FDe(t).map(n=>{const s=Jl[n.style];return d.jsxs("button",{onClick:()=>i(n),className:"group relative flex flex-col items-start gap-3 rounded-xl border-2 border-border p-5 text-start transition-all duration-200 hover:border-primary/40 hover:shadow-md","data-testid":`template-${n.key}`,children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-xl bg-primary/10 text-2xl",children:n.icon}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-semibold text-foreground",children:n.name}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:[s==null?void 0:s.icon," ",s==null?void 0:s.label]})]})]}),d.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),d.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[n.roles.slice(0,4).map((r,o)=>d.jsx(Fi,{variant:"secondary",className:"text-[10px]",children:r.role},o)),n.roles.length>4&&d.jsxs(Fi,{variant:"outline",className:"text-[10px]",children:["+",n.roles.length-4]})]})]},n.key)}),d.jsxs("button",{onClick:e,className:"flex flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed border-border p-5 text-center transition-all duration-200 hover:border-primary/40 hover:shadow-md","data-testid":"template-blank",children:[d.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-xl bg-muted text-muted-foreground",children:d.jsx(Gt,{className:"h-6 w-6"})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-semibold text-foreground",children:t("groupWizard.startBlank")}),d.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t("groupWizard.blankDesc")})]})]})]})]})}function kht({state:i,onChange:e}){const{t}=xe();return d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-semibold text-foreground",children:t("groupWizard.configTitle")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t("groupWizard.configDesc")}),d.jsxs("div",{className:"mt-6 space-y-5",children:[d.jsxs("div",{children:[d.jsxs("label",{htmlFor:"gw-name",className:"mb-1.5 block text-sm font-medium text-foreground",children:[t("common.name","Name")," *"]}),d.jsx("input",{id:"gw-name",type:"text",value:i.name,onChange:n=>e({name:n.target.value}),placeholder:t("groupWizard.namePlaceholder"),className:"w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow","data-testid":"gw-name",autoFocus:!0})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"gw-desc",className:"mb-1.5 block text-sm font-medium text-foreground",children:t("common.description","Description")}),d.jsx("textarea",{id:"gw-desc",value:i.description,onChange:n=>e({description:n.target.value}),placeholder:t("groupWizard.descPlaceholder"),rows:2,className:"w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-y transition-shadow","data-testid":"gw-description"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1.5 block text-sm font-medium text-foreground",children:t("groups.discussionStyle","Discussion Style")}),d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:MDe.filter(n=>n!=="CUSTOM").map(n=>{const s=Jl[n],r=zj[n],o=i.style===n;return d.jsxs("button",{onClick:()=>e({style:n}),className:be("group relative flex flex-col items-start rounded-lg border-2 p-3 text-start transition-all",o?`${r.border} ${r.bg} shadow-sm`:"border-border hover:border-primary/30"),"data-testid":`gw-style-${n}`,children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-lg",children:s==null?void 0:s.icon}),d.jsx("span",{className:be("text-xs font-semibold",o?r.text:"text-foreground"),children:s==null?void 0:s.label})]}),d.jsx("p",{className:"mt-1 text-[10px] text-muted-foreground leading-snug line-clamp-2",children:s==null?void 0:s.flow}),o&&d.jsx("div",{className:be("absolute inset-e-1.5 top-1.5 flex h-5 w-5 items-center justify-center rounded-full text-white",r.accent),children:d.jsx(Ns,{className:"h-3 w-3"})})]},n)})})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"gw-rounds",className:"mb-1.5 block text-sm font-medium text-foreground",children:t("groups.maxRounds","Max Rounds")}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("input",{id:"gw-rounds",type:"range",min:1,max:10,value:i.maxRounds,onChange:n=>e({maxRounds:parseInt(n.target.value)}),className:"flex-1 accent-primary"}),d.jsx("span",{className:"w-8 text-center text-sm font-bold text-foreground",children:i.maxRounds})]})]})]})]})}function Nht({state:i,onChange:e,styleColors:t}){const{t:n}=xe(),{data:s,refetch:r}=e0(100),o=s?Cg(s):[];function a(){e({members:[...i.members,zDe(i.members.length)]})}function l(g){e({members:i.members.filter((f,m)=>m!==g)})}function c(g,f){e({members:i.members.map((m,x)=>x===g?{...m,...f}:m)})}async function u(g){var x;const f=i.members[g];if(!f||!f.displayName.trim())return;c(g,{creating:!0});const m={name:`${i.name} — ${f.displayName}`.trim(),systemPrompt:f.systemPrompt||`You are ${f.displayName}${f.role?`, a ${f.role} expert`:""}. Provide clear, actionable insights from your domain perspective.`,provider:f.provider||"anthropic",model:f.model||(((x=np.find(v=>v.id===(f.provider||"anthropic")))==null?void 0:x.defaultModel)??"claude-sonnet-4-6"),apiKey:f.apiKey||void 0,deploy:!0};try{const v=await DA(m);c(g,{agentId:v.agentId,created:!0,creating:!1}),ze.success(n("groupWizard.agentCreated",{name:f.displayName}))}catch(v){c(g,{creating:!1}),ze.error(n("groupWizard.agentCreateFailed",{error:v instanceof Error?v.message:String(v)}))}}async function h(){var m;const g=i.moderator;if(!g)return;e({moderator:{...g,creating:!0}});const f={name:`${i.name} — Moderator`.trim(),systemPrompt:g.systemPrompt||"You are a skilled moderator. Synthesize the group's discussion into a clear, balanced summary that captures key insights, areas of agreement, and remaining disagreements.",provider:g.provider||"anthropic",model:g.model||(((m=np.find(x=>x.id===(g.provider||"anthropic")))==null?void 0:m.defaultModel)??"claude-sonnet-4-6"),apiKey:g.apiKey||void 0,deploy:!0};try{const x=await DA(f);e({moderator:{...g,agentId:x.agentId,created:!0,creating:!1}}),ze.success(n("groupWizard.moderatorCreated"))}catch(x){e({moderator:{...g,creating:!1}}),ze.error(n("groupWizard.agentCreateFailed",{error:x instanceof Error?x.message:String(x)}))}}return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("h2",{className:"text-xl font-semibold text-foreground",children:n("groupWizard.membersTitle")}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>r(),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors",title:n("groupWizard.refreshAgents"),children:d.jsx(xi,{className:"h-3 w-3"})}),d.jsxs(Fi,{variant:"secondary",className:"text-xs",children:[o.length," ",n("groupWizard.existingAgents")]})]})]}),d.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:n("groupWizard.membersDesc")}),d.jsx("div",{className:"space-y-3 max-h-[500px] overflow-y-auto pe-1",children:i.members.map((g,f)=>d.jsx(Eht,{member:g,index:f,agents:o,styleColors:t,onUpdate:m=>c(f,m),onRemove:()=>l(f),onCreateAgent:()=>u(f),t:n},f))}),d.jsxs("button",{onClick:a,className:"flex w-full items-center justify-center gap-2 rounded-lg border-2 border-dashed border-border p-3 mt-3 text-sm font-medium text-muted-foreground hover:border-primary/40 hover:text-primary transition-colors","data-testid":"gw-add-member",children:[d.jsx(Gt,{className:"h-4 w-4"}),n("groupWizard.addMember")]}),d.jsxs("div",{className:be("mt-5 rounded-xl border-2 p-4",t.border,t.bg),children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(yj,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"text-sm font-semibold text-foreground",children:n("groupWizard.moderator")}),d.jsx("span",{className:"text-xs text-muted-foreground",children:n("groupWizard.moderatorHint")})]}),i.moderator?d.jsx("button",{onClick:()=>e({moderator:null}),className:"rounded-md p-1 text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",title:n("groupWizard.removeModerator"),children:d.jsx(_n,{className:"h-3.5 w-3.5"})}):d.jsxs("button",{onClick:()=>e({moderator:UDe()}),className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2.5 py-1 text-xs font-medium text-primary hover:bg-primary/20 transition-colors",children:[d.jsx(lWe,{className:"h-3 w-3"}),n("groupWizard.addModerator")]})]}),i.moderator&&d.jsx(Lht,{moderator:i.moderator,agents:o,onChange:g=>e({moderator:{...i.moderator,...g}}),onCreateAgent:h,t:n})]}),i.members.length<2&&d.jsxs("p",{className:"mt-3 text-xs text-amber-500 font-medium flex items-center gap-1.5",children:[d.jsx(Vi,{className:"h-3.5 w-3.5"}),n("groupWizard.needMembers")]})]})}function Eht({member:i,index:e,agents:t,styleColors:n,onUpdate:s,onRemove:r,onCreateAgent:o,t:a}){const l=np.find(c=>c.id===i.provider);return d.jsxs("div",{className:be("rounded-xl border bg-card overflow-hidden transition-all",i.created?"border-emerald-500/40":i.mode==="new"?n.border:"border-border"),"data-testid":`member-card-${e}`,children:[d.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 bg-secondary/20",children:[d.jsx("div",{className:be("flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-xs font-bold text-white shadow-sm",i.created?"bg-emerald-500":g7(i.agentId||String(e))),children:i.created?d.jsx(Ns,{className:"h-4 w-4"}):f7(i.displayName||"?")}),d.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[d.jsxs("div",{className:be("flex items-center gap-1.5 rounded-md border px-2 py-0.5 transition-colors",i.displayName.trim()?"border-border/60 focus-within:border-primary/50":"border-amber-500/50 bg-amber-500/5"),children:[d.jsx(VSe,{className:"h-3 w-3 shrink-0 text-muted-foreground/50"}),d.jsx("input",{value:i.displayName,onChange:c=>s({displayName:c.target.value}),className:"w-full bg-transparent text-sm font-semibold text-foreground focus:outline-none placeholder:text-muted-foreground/60",placeholder:a("groupWizard.displayNamePlaceholder"),autoFocus:!i.displayName&&!i.created})]}),d.jsx("input",{value:i.role??"",onChange:c=>s({role:c.target.value||null}),className:"w-full bg-transparent text-xs text-muted-foreground ps-2.5 focus:outline-none placeholder:text-muted-foreground/50",placeholder:a("groupWizard.rolePlaceholder")})]}),d.jsxs("div",{className:"flex items-center rounded-md border border-border bg-background overflow-hidden shrink-0",children:[d.jsx("button",{onClick:()=>s({memberType:"AGENT"}),className:be("px-2.5 py-1 text-[10px] font-medium transition-colors",i.memberType==="AGENT"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:"Agent"}),d.jsxs("button",{onClick:()=>s({memberType:"GROUP"}),className:be("px-2.5 py-1 text-[10px] font-medium transition-colors",i.memberType==="GROUP"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[d.jsx(ga,{className:"inline h-2.5 w-2.5 me-0.5"}),"Group"]})]}),d.jsx("button",{onClick:r,className:"shrink-0 rounded-md p-1.5 text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",title:a("common.delete"),children:d.jsx(_n,{className:"h-3.5 w-3.5"})})]}),!i.created&&d.jsx("div",{className:"px-4 py-3 space-y-3",children:i.memberType==="GROUP"?d.jsx(Tht,{agentId:i.agentId,onUpdate:s,t:a}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("button",{onClick:()=>s({mode:"existing",agentId:""}),className:be("flex-1 flex items-center justify-center gap-2 rounded-lg border-2 py-2 text-xs font-medium transition-all",i.mode==="existing"?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-primary/30"),children:[d.jsx(Dw,{className:"h-3.5 w-3.5"}),a("groupWizard.useExisting")]}),d.jsxs("button",{onClick:()=>s({mode:"new",agentId:""}),className:be("flex-1 flex items-center justify-center gap-2 rounded-lg border-2 py-2 text-xs font-medium transition-all",i.mode==="new"?`${n.border} ${n.bg} ${n.text}`:"border-border text-muted-foreground hover:border-primary/30"),children:[d.jsx(Ll,{className:"h-3.5 w-3.5"}),a("groupWizard.createNew")]})]}),i.mode==="existing"&&d.jsxs("div",{className:"relative",children:[d.jsxs("select",{value:i.agentId,onChange:c=>s({agentId:c.target.value}),className:be("w-full appearance-none rounded-lg border bg-background px-3 py-2 pe-8 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",i.agentId?"border-input":"border-amber-400/50"),children:[d.jsx("option",{value:"",children:a("groupWizard.selectAgent")}),t.map(c=>d.jsx("option",{value:c.id,children:c.name||c.id.slice(0,12)},c.id))]}),d.jsx(Rn,{className:"pointer-events-none absolute inset-e-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"})]}),i.mode==="new"&&d.jsxs("div",{className:"space-y-2.5",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:a("groupWizard.systemPrompt")}),d.jsx("textarea",{value:i.systemPrompt,onChange:c=>s({systemPrompt:c.target.value}),placeholder:`You are ${i.displayName}${i.role?`, a ${i.role} expert`:""}. Provide insightful analysis from your domain perspective.`,rows:2,className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring resize-y"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:a("groupWizard.provider")}),d.jsxs("div",{className:"relative",children:[d.jsx("select",{value:i.provider,onChange:c=>{s({provider:c.target.value,model:""})},className:"w-full appearance-none rounded-lg border border-input bg-background px-3 py-1.5 pe-7 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:np.map(c=>d.jsx("option",{value:c.id,children:c.name},c.id))}),d.jsx(Rn,{className:"pointer-events-none absolute inset-e-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:a("groupWizard.model")}),d.jsx("input",{value:i.model,onChange:c=>s({model:c.target.value}),className:"w-full rounded-lg border border-input bg-background px-3 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",placeholder:`e.g. ${(l==null?void 0:l.defaultModel)??""}`})]})]}),(l==null?void 0:l.needsKey)&&d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:a("groupWizard.apiKey")}),d.jsx(Rd,{value:i.apiKey,onChange:c=>s({apiKey:c}),placeholder:a("groupWizard.apiKeyPlaceholder"),testId:`gw-apikey-${e}`})]}),d.jsxs("button",{onClick:o,disabled:i.creating||!i.displayName.trim(),className:"w-full inline-flex items-center justify-center gap-2 rounded-lg bg-primary/10 px-4 py-2 text-xs font-medium text-primary hover:bg-primary/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[i.creating?d.jsx(xi,{className:"h-3 w-3 animate-spin"}):d.jsx(RL,{className:"h-3 w-3"}),i.creating?a("groupWizard.creatingAgent"):a("groupWizard.createThisAgent")]})]})]})}),i.created&&d.jsxs("div",{className:"px-4 py-2 bg-emerald-500/5 border-t border-emerald-500/20 flex items-center gap-2",children:[d.jsx(Xl,{className:"h-3.5 w-3.5 text-emerald-500"}),d.jsx("span",{className:"text-xs text-emerald-600 dark:text-emerald-400 font-medium",children:a("groupWizard.agentReady")}),d.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono ms-auto",children:[i.agentId.slice(0,12),"…"]})]})]})}function Lht({moderator:i,agents:e,onChange:t,onCreateAgent:n,t:s}){const r=np.find(o=>o.id===i.provider);return i.created?d.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-emerald-500/5 border border-emerald-500/20 p-2.5",children:[d.jsx(Xl,{className:"h-3.5 w-3.5 text-emerald-500 shrink-0"}),d.jsx("span",{className:"text-xs text-emerald-600 dark:text-emerald-400 font-medium flex-1",children:s("groupWizard.moderatorReady")}),d.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[i.agentId.slice(0,12),"…"]})]}):d.jsxs("div",{className:"space-y-2.5",children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("button",{onClick:()=>t({mode:"existing",agentId:""}),className:be("flex-1 flex items-center justify-center gap-2 rounded-lg border-2 py-2 text-xs font-medium transition-all",i.mode==="existing"?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-primary/30"),children:[d.jsx(Dw,{className:"h-3.5 w-3.5"}),s("groupWizard.useExisting")]}),d.jsxs("button",{onClick:()=>t({mode:"new",agentId:""}),className:be("flex-1 flex items-center justify-center gap-2 rounded-lg border-2 py-2 text-xs font-medium transition-all",i.mode==="new"?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-primary/30"),children:[d.jsx(Ll,{className:"h-3.5 w-3.5"}),s("groupWizard.createNew")]})]}),i.mode==="existing"?d.jsxs("div",{className:"relative",children:[d.jsxs("select",{value:i.agentId,onChange:o=>t({agentId:o.target.value}),className:"w-full appearance-none rounded-lg border border-input bg-background px-3 py-2 pe-8 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",children:[d.jsx("option",{value:"",children:s("groupWizard.selectAgent")}),e.map(o=>d.jsx("option",{value:o.id,children:o.name||o.id.slice(0,12)},o.id))]}),d.jsx(Rn,{className:"pointer-events-none absolute inset-e-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsx("textarea",{value:i.systemPrompt,onChange:o=>t({systemPrompt:o.target.value}),placeholder:"You are a skilled moderator. Synthesize the group's discussion into a clear, balanced summary…",rows:2,className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring resize-y"}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsxs("div",{className:"relative",children:[d.jsx("select",{value:i.provider,onChange:o=>{t({provider:o.target.value,model:""})},className:"w-full appearance-none rounded-lg border border-input bg-background px-3 py-1.5 pe-7 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:np.map(o=>d.jsx("option",{value:o.id,children:o.name},o.id))}),d.jsx(Rn,{className:"pointer-events-none absolute inset-e-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"})]}),d.jsx("input",{value:i.model,onChange:o=>t({model:o.target.value}),className:"rounded-lg border border-input bg-background px-3 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",placeholder:`e.g. ${(r==null?void 0:r.defaultModel)??""}`})]}),(r==null?void 0:r.needsKey)&&d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:s("groupWizard.apiKey")}),d.jsx(Rd,{value:i.apiKey,onChange:o=>t({apiKey:o}),placeholder:s("groupWizard.apiKeyPlaceholder"),testId:"gw-moderator-apikey"})]}),d.jsxs("button",{onClick:n,disabled:i.creating,className:"w-full inline-flex items-center justify-center gap-2 rounded-lg bg-primary/10 px-4 py-2 text-xs font-medium text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[i.creating?d.jsx(xi,{className:"h-3 w-3 animate-spin"}):d.jsx(RL,{className:"h-3 w-3"}),i.creating?s("groupWizard.creatingAgent"):s("groupWizard.createModerator")]})]})]})}function Dht({state:i}){const{t:e}=xe(),t=Jl[i.style],n=zj[i.style],s=i.members.filter(a=>a.mode==="new"&&!a.created&&!a.agentId).length+(i.moderator&&i.moderator.mode==="new"&&!i.moderator.created&&!i.moderator.agentId?1:0),r=i.members.filter(a=>a.mode==="existing"&&!a.agentId).length,o=i.members.filter(a=>a.created).length;return d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-semibold text-foreground",children:e("groupWizard.reviewTitle")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:e("groupWizard.reviewDesc")}),d.jsxs("div",{className:"mt-6 space-y-5",children:[d.jsxs("div",{className:be("rounded-xl border-2 p-5 space-y-3",n.border,n.bg),children:[d.jsx("h3",{className:"text-lg font-bold text-foreground",children:i.name}),i.description&&d.jsx("p",{className:"text-sm text-muted-foreground",children:i.description}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsxs(Fi,{variant:"outline",className:be("text-xs",n.text),children:[t==null?void 0:t.icon," ",t==null?void 0:t.label]}),d.jsxs(Fi,{variant:"secondary",className:"text-xs",children:[d.jsx(ga,{className:"me-1 h-3 w-3"}),i.members.length," members"]}),d.jsxs(Fi,{variant:"secondary",className:"text-xs",children:[i.maxRounds," rounds"]}),i.moderator&&d.jsxs(Fi,{variant:"default",className:"text-xs",children:[d.jsx(yj,{className:"me-1 h-3 w-3"})," Moderator"]})]})]}),s>0&&d.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-primary/30 bg-primary/5 p-3","data-testid":"auto-create-notice",children:[d.jsx(Ll,{className:"h-4 w-4 text-primary shrink-0 mt-0.5"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-primary",children:e("groupWizard.autoCreateNotice",{count:s})}),d.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:e("groupWizard.autoCreateHint")})]})]}),r>0&&d.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-amber-500/30 bg-amber-500/5 p-3",children:[d.jsx(Vi,{className:"h-4 w-4 text-amber-500 shrink-0 mt-0.5"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:e("groupWizard.unassignedWarning",{count:r})}),d.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:e("groupWizard.unassignedHint")})]})]}),d.jsxs("div",{children:[d.jsxs("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:[e("groupWizard.reviewMembers"),o>0&&d.jsxs("span",{className:"ms-2 font-normal normal-case text-emerald-500",children:["(",o," newly created)"]})]}),d.jsxs("div",{className:"space-y-1",children:[i.members.map((a,l)=>d.jsxs("div",{className:"flex items-center gap-3 rounded-lg px-3 py-2 hover:bg-secondary/30 transition-colors",children:[d.jsx("div",{className:be("flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-[10px] font-bold text-white",a.created?"bg-emerald-500":g7(a.agentId||String(l))),children:a.created?d.jsx(Ns,{className:"h-3 w-3"}):f7(a.displayName||"?")}),d.jsx("span",{className:"text-sm font-medium text-foreground flex-1",children:a.displayName}),a.role&&d.jsx(Fi,{variant:"outline",className:"text-[10px]",children:a.role}),a.memberType==="GROUP"&&d.jsxs(Fi,{variant:"secondary",className:"text-[10px]",children:[d.jsx(ga,{className:"h-2.5 w-2.5 me-0.5"})," Group"]}),a.created&&d.jsx(Fi,{variant:"success",className:"text-[10px]",children:"✓ new"}),d.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:a.agentId?a.agentId.slice(0,8)+"…":"unassigned"})]},l)),i.moderator&&d.jsxs("div",{className:"flex items-center gap-3 rounded-lg px-3 py-2 bg-primary/5 border border-primary/20",children:[d.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground text-[10px] font-bold",children:d.jsx(yj,{className:"h-3 w-3"})}),d.jsx("span",{className:"text-sm font-medium text-foreground flex-1",children:"Moderator"}),d.jsx(Fi,{variant:"default",className:"text-[10px]",children:"⭐ Synthesis"}),d.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:i.moderator.agentId?i.moderator.agentId.slice(0,8)+"…":"unassigned"})]})]})]}),t&&d.jsxs("div",{className:be("rounded-lg border p-3",n.border,n.bg),children:[d.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1",children:e("groupWizard.flowPreview")}),d.jsx("p",{className:be("text-xs font-medium",n.text),children:t.flow})]})]})]})}function Tht({agentId:i,onUpdate:e,t}){const{data:n,isLoading:s}=ire(100),r=n&&n.length>0;return d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:t("groupWizard.selectGroup","Select existing group")}),s?d.jsx("div",{className:"rounded-lg border border-input bg-background px-3 py-2 text-xs text-muted-foreground animate-pulse",children:t("common.loading","Loading…")}):r?d.jsxs("div",{className:"relative",children:[d.jsxs("select",{value:i,onChange:o=>e({agentId:o.target.value,mode:"existing"}),className:be("w-full appearance-none rounded-lg border bg-background px-3 py-2 pe-8 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",i?"border-input":"border-amber-400/50"),children:[d.jsx("option",{value:"",children:t("groupWizard.selectGroup","Select existing group…")}),n.map(o=>d.jsxs("option",{value:o.id,children:[o.name||o.id.slice(0,12)," (",o.memberCount," members)"]},o.id))]}),d.jsx(Rn,{className:"pointer-events-none absolute inset-e-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"})]}):d.jsxs("div",{className:"rounded-lg border border-dashed border-amber-400/50 bg-amber-400/5 px-3 py-3 text-center",children:[d.jsx(ga,{className:"h-4 w-4 text-amber-500 mx-auto mb-1"}),d.jsx("p",{className:"text-xs font-medium text-amber-600 dark:text-amber-400",children:t("groupWizard.noGroupsYet","No groups available")}),d.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:t("groupWizard.noGroupsHint","Create a group first, then add it as a nested sub-group member.")})]}),r&&d.jsx("p",{className:"mt-1 text-[10px] text-muted-foreground",children:t("groupWizard.groupMemberHint","This group will participate as a nested sub-group in the discussion.")})]})}function Qme({workflowSteps:i,selectedIndex:e,onSelectStage:t}){const{t:n}=xe(),s=bu(o=>o.currentTurnEvents),r=L.useMemo(()=>{const o=new Map;for(const a of s)a.type==="task_start"?o.set(a.index,"running"):a.type==="task_complete"&&o.set(a.index,"complete");return o},[s]);return d.jsxs("div",{className:"flex flex-col gap-0 py-4 px-3","data-testid":"pipeline-railroad",children:[i.map((o,a)=>{var _,w;const l=VE(o.type),c=o.type.replace("eddi://ai.labs.",""),u=n(`studio.type.${c}`,c.charAt(0).toUpperCase()+c.slice(1)),h=ULe(o.type),g=r.get(a)??"idle",f=e===a,m=a===i.length-1,v=((w=(((_=o.config)==null?void 0:_.uri)??"").split("/").pop())==null?void 0:w.split("?")[0])??"";return d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>t(a),"aria-current":f?"true":void 0,className:be("group flex w-full items-center gap-2.5 rounded-lg px-3 py-2.5 text-start transition-all",f?"bg-primary/10 border border-primary/30":"hover:bg-muted/50 border border-transparent"),"data-testid":`stage-${a}`,children:[d.jsxs("div",{className:"relative shrink-0",children:[d.jsx("div",{className:be("flex h-9 w-9 items-center justify-center rounded-lg transition-colors",g==="running"&&"bg-amber-500/10 animate-pulse",g==="complete"&&"bg-emerald-500/10",g==="idle"&&"bg-muted/50",f&&"bg-primary/15"),children:d.jsx(l,{className:be("h-4 w-4",h)})}),g==="running"&&d.jsx(RE,{className:"absolute -inset-e-0.5 -top-0.5 h-2.5 w-2.5 fill-amber-500 text-amber-500 animate-pulse"}),g==="complete"&&d.jsx(RE,{className:"absolute -inset-e-0.5 -top-0.5 h-2.5 w-2.5 fill-emerald-500 text-emerald-500"})]}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:u}),v&&d.jsx("p",{className:"text-[10px] text-muted-foreground truncate font-mono",children:v})]}),d.jsx(hs,{className:be("h-4 w-4 shrink-0 transition-colors",f?"text-primary":"text-muted-foreground/30 group-hover:text-muted-foreground")})]}),!m&&d.jsx("div",{className:"flex justify-center py-0.5",children:d.jsx("div",{className:be("w-0.5 h-4 rounded-full transition-colors",r.has(a)?"bg-emerald-500/40":"bg-border")})})]},a)}),i.length===0&&d.jsxs("div",{className:"text-center py-8",children:[d.jsx(Ed,{className:"mx-auto h-8 w-8 text-muted-foreground/30"}),d.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:n("studio.noPipeline","No pipeline stages")})]})]})}function Xme({workflowStep:i,agentId:e,agentVersion:t,workflowId:n,workflowVersion:s}){var $;const{t:r}=xe(),o=dct[i.type]??"",a=KL(o),l=(($=i.config)==null?void 0:$.uri)??"",{resourceId:c,resourceVersion:u}=L.useMemo(()=>{if(!l)return{resourceId:"",resourceVersion:1};try{const K=uo(l);return{resourceId:K.id,resourceVersion:K.version}}catch{return{resourceId:"",resourceVersion:1}}},[l]),[h,g]=L.useState(u);L.useEffect(()=>{g(u)},[u]);const{data:f,isLoading:m,isError:x,refetch:v}=nDe(o,c,h),{data:_}=iDe(o,c),{data:w}=SDe(o||void 0),k=oDe(o),[C,E]=L.useState(!1);L.useEffect(()=>{if(C){const K=setTimeout(()=>E(!1),3e3);return()=>clearTimeout(K)}},[C]);const D=_?_.map(K=>{var G;const z=(G=K.resource)==null?void 0:G.match(/\?version=(\d+)/);return{version:z?parseInt(z[1]??"1",10):1,lastModifiedOn:K.lastModifiedOn}}):[{version:h}],[T,I]=L.useState(s),[R,P]=L.useState(t);L.useEffect(()=>{I(s),P(t)},[s,t]);const j=L.useMemo(()=>({workflowId:n,workflowVersion:T,agentId:e,agentVersion:R}),[n,T,e,R]),B=L.useCallback(K=>{try{const z=JSON.parse(K);k.mutate({id:c,version:h,body:z,context:j},{onSuccess:G=>{ze.success(r("editor.saved","Saved successfully")),E(!0),g(G.newResourceVersion),G.newWorkflowVersion&&I(G.newWorkflowVersion),G.newAgentVersion&&P(G.newAgentVersion)},onError:G=>{ze.error(Vs(G))}})}catch{ze.error(r("editor.invalidJson","Invalid JSON"))}},[c,h,k,j,r]);if(!l||!a)return d.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center p-6 text-center",children:[d.jsx(Vi,{className:"h-10 w-10 text-muted-foreground/30 mb-3"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:l?r("studio.unsupportedType","Editor not available for this extension type"):r("studio.noConfig","This pipeline stage has no configuration URI")}),d.jsx("p",{className:"mt-1 text-xs text-muted-foreground/60 font-mono",children:i.type})]});if(m)return d.jsxs("div",{className:"flex-1 p-6 space-y-4",children:[d.jsxs("div",{className:"flex gap-3",children:[d.jsx(bi,{className:"h-8 w-24"}),d.jsx(bi,{className:"h-8 w-24"})]}),d.jsx(bi,{className:"h-[400px] w-full rounded-xl"})]});if(x)return d.jsx("div",{className:"flex-1 p-6",children:d.jsx(ep,{message:r("common.error","An error occurred"),onRetry:()=>v(),retryLabel:r("common.retry","Retry")})});const U=r(`${a.labelKey}.name`,o);return d.jsx("div",{className:"flex-1 overflow-y-auto p-4","data-testid":"studio-editor-panel",children:d.jsx(fDe,{typeName:U,resourceId:c,data:JSON.stringify(f,null,2),versions:D,currentVersion:h,onVersionChange:g,onSave:B,isSaving:k.isPending,saveSuccess:C,saveError:k.isError?r("editor.saveError","Failed to save"):void 0,renderFormEditor:CDe[o],jsonSchema:w})})}function Zme(){const{t:i}=xe();return d.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center p-6 text-center",children:[d.jsx(Uf,{className:"h-16 w-16 text-muted-foreground/15 mb-4"}),d.jsx("p",{className:"text-sm font-medium text-foreground",children:i("studio.selectStage","Click a pipeline stage to open its editor")}),d.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground max-w-xs",children:i("studio.selectStageHint","Select any extension in the pipeline to view and edit its configuration inline")})]})}function Iht(){var C,E,D;const{t:i}=xe(),{agentId:e}=K_(),[t,n]=L.useState(null),[s,r]=L.useState(!0),[o,a]=L.useState("pipeline"),{data:l}=hn({queryKey:["studio","descriptors",e],queryFn:()=>OL(10,0,e??""),enabled:!!e,staleTime:6e4}),c=L.useMemo(()=>!l||!e?null:l.find(T=>{const{id:I}=uo(T.resource);return I===e})??null,[l,e]),u=L.useMemo(()=>c?uo(c.resource).version:1,[c]),{data:h,isLoading:g}=hn({queryKey:["studio","agent",e,u],queryFn:()=>vC(e,u),enabled:!!e&&!!c,staleTime:3e4}),f=(C=h==null?void 0:h.workflows)==null?void 0:C[0],{workflowId:m,workflowVersion:x}=L.useMemo(()=>{if(!f)return{workflowId:null,workflowVersion:1};const T=uo(f);return{workflowId:T.id,workflowVersion:T.version}},[f]),{data:v}=hn({queryKey:["studio","workflow",m],queryFn:()=>qM(m,x),enabled:!!m,staleTime:3e4}),_=(v==null?void 0:v.workflowSteps)??[],w=L.useCallback(T=>{n(T),a("editor")},[]);if(!e)return d.jsx("div",{className:"flex h-full items-center justify-center",children:d.jsx("p",{className:"text-muted-foreground",children:i("studio.notFound","Agent not found")})});if(g)return d.jsxs("div",{className:"flex h-full items-center justify-center",children:[d.jsx(ni,{className:"h-6 w-6 animate-spin text-muted-foreground"}),d.jsx("p",{className:"ms-2 text-sm text-muted-foreground",children:i("studio.loading","Loading agent...")})]});const k=t!==null?_[t]:null;return d.jsxs("div",{className:"flex h-screen flex-col bg-background","data-testid":"agent-studio",children:[d.jsxs("div",{className:"flex items-center gap-3 border-b border-border px-4 py-2.5 shrink-0",children:[d.jsx(Kn,{to:`/manage/agentview/${e}`,className:"flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-foreground","data-testid":"studio-back","aria-label":i("studio.backToAgent","Back to agent detail"),children:d.jsx(El,{className:"h-4 w-4"})}),d.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[d.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-primary/10 shrink-0",children:d.jsx(ai,{className:"h-4 w-4 text-primary"})}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("h1",{className:"text-sm font-semibold text-foreground truncate",children:(c==null?void 0:c.name)??e}),d.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("studio.title","Agent Studio")})]})]}),d.jsx("button",{onClick:()=>r(!s),className:"flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-foreground",title:s?i("studio.hideChat","Hide chat"):i("studio.showChat","Show chat"),"data-testid":"toggle-right-panel",children:s?d.jsx(WSe,{className:"h-4 w-4"}):d.jsx(fHe,{className:"h-4 w-4"})})]}),d.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[d.jsxs("div",{className:"w-64 shrink-0 border-e border-border overflow-y-auto bg-card/30 hidden lg:block",children:[d.jsx("div",{className:"px-3 pt-3 pb-1",children:d.jsx("h2",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:i("studio.pipeline","Pipeline")})}),d.jsx(Qme,{workflowSteps:_,selectedIndex:t,onSelectStage:w})]}),d.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d.jsx("div",{className:"hidden lg:flex lg:flex-1 lg:flex-col lg:overflow-hidden",children:k&&m?d.jsx(Xme,{workflowStep:k,agentId:e,agentVersion:u,workflowId:m,workflowVersion:x},`${t}-${(E=k.config)==null?void 0:E.uri}`):d.jsx(Zme,{})}),d.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden lg:hidden",children:[o==="pipeline"&&d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[d.jsx("div",{className:"px-3 pt-3 pb-1",children:d.jsx("h2",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:i("studio.pipeline","Pipeline")})}),d.jsx(Qme,{workflowSteps:_,selectedIndex:t,onSelectStage:w})]}),o==="editor"&&d.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:k&&m?d.jsx(Xme,{workflowStep:k,agentId:e,agentVersion:u,workflowId:m,workflowVersion:x},`mobile-${t}-${(D=k.config)==null?void 0:D.uri}`):d.jsx(Zme,{})}),o==="chat"&&d.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:d.jsx(KG,{})})]})]}),s&&d.jsx("div",{className:"w-96 shrink-0 border-s border-border overflow-hidden hidden md:flex md:flex-col",children:d.jsx(KG,{})})]}),d.jsx("div",{className:"flex border-t border-border lg:hidden",children:[{id:"pipeline",icon:d.jsx(Vb,{className:"h-4 w-4"}),label:i("studio.pipeline","Pipeline")},{id:"editor",icon:d.jsx(Uf,{className:"h-4 w-4"}),label:i("studio.editor","Editor")},{id:"chat",icon:d.jsx(Jf,{className:"h-4 w-4"}),label:i("studio.chat","Chat")}].map(T=>d.jsxs("button",{onClick:()=>a(T.id),className:be("flex flex-1 flex-col items-center gap-0.5 py-2 text-[10px] font-medium transition-colors",o===T.id?"text-primary border-t-2 border-primary -mt-[2px]":"text-muted-foreground hover:text-foreground"),"data-testid":`mobile-tab-${T.id}`,children:[T.icon,T.label]},T.id))})]})}var Jme=1,Aht=.9,Rht=.8,Mht=.17,YU=.1,QU=.999,Pht=.9999,Oht=.99,jht=/[\\\/_+.#"@\[\(\{&]/,Fht=/[\\\/_+.#"@\[\(\{&]/g,Bht=/[\s-]/,$De=/[\s-]/g;function ZG(i,e,t,n,s,r,o){if(r===e.length)return s===i.length?Jme:Oht;var a=`${s},${r}`;if(o[a]!==void 0)return o[a];for(var l=n.charAt(r),c=t.indexOf(l,s),u=0,h,g,f,m;c>=0;)h=ZG(i,e,t,n,c+1,r+1,o),h>u&&(c===s?h*=Jme:jht.test(i.charAt(c-1))?(h*=Rht,f=i.slice(s,c-1).match(Fht),f&&s>0&&(h*=Math.pow(QU,f.length))):Bht.test(i.charAt(c-1))?(h*=Aht,m=i.slice(s,c-1).match($De),m&&s>0&&(h*=Math.pow(QU,m.length))):(h*=Mht,s>0&&(h*=Math.pow(QU,c-s))),i.charAt(c)!==e.charAt(r)&&(h*=Pht)),(hh&&(h=g*YU)),h>u&&(u=h),c=t.indexOf(l,c+1);return o[a]=u,u}function ebe(i){return i.toLowerCase().replace($De," ")}function Hht(i,e,t){return i=t&&t.length>0?`${i+" "+t.join(" ")}`:i,ZG(i,e,ebe(i),ebe(e),0,0,{})}var LT='[cmdk-group=""]',XU='[cmdk-group-items=""]',Wht='[cmdk-group-heading=""]',qDe='[cmdk-item=""]',tbe=`${qDe}:not([aria-disabled="true"])`,JG="cmdk-item-select",bk="data-value",Vht=(i,e,t)=>Hht(i,e,t),KDe=L.createContext(void 0),rP=()=>L.useContext(KDe),GDe=L.createContext(void 0),rre=()=>L.useContext(GDe),YDe=L.createContext(void 0),QDe=L.forwardRef((i,e)=>{let t=xk(()=>{var Y,V;return{search:"",value:(V=(Y=i.value)!=null?Y:i.defaultValue)!=null?V:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=xk(()=>new Set),s=xk(()=>new Map),r=xk(()=>new Map),o=xk(()=>new Set),a=XDe(i),{label:l,children:c,value:u,onValueChange:h,filter:g,shouldFilter:f,loop:m,disablePointerSelection:x=!1,vimBindings:v=!0,..._}=i,w=ob(),k=ob(),C=ob(),E=L.useRef(null),D=Jht();Mw(()=>{if(u!==void 0){let Y=u.trim();t.current.value=Y,T.emit()}},[u]),Mw(()=>{D(6,U)},[]);let T=L.useMemo(()=>({subscribe:Y=>(o.current.add(Y),()=>o.current.delete(Y)),snapshot:()=>t.current,setState:(Y,V,ue)=>{var he,Te,nt,ge;if(!Object.is(t.current[Y],V)){if(t.current[Y]=V,Y==="search")B(),P(),D(1,j);else if(Y==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let _e=document.getElementById(C);_e?_e.focus():(he=document.getElementById(w))==null||he.focus()}if(D(7,()=>{var _e;t.current.selectedItemId=(_e=$())==null?void 0:_e.id,T.emit()}),ue||D(5,U),((Te=a.current)==null?void 0:Te.value)!==void 0){let _e=V??"";(ge=(nt=a.current).onValueChange)==null||ge.call(nt,_e);return}}T.emit()}},emit:()=>{o.current.forEach(Y=>Y())}}),[]),I=L.useMemo(()=>({value:(Y,V,ue)=>{var he;V!==((he=r.current.get(Y))==null?void 0:he.value)&&(r.current.set(Y,{value:V,keywords:ue}),t.current.filtered.items.set(Y,R(V,ue)),D(2,()=>{P(),T.emit()}))},item:(Y,V)=>(n.current.add(Y),V&&(s.current.has(V)?s.current.get(V).add(Y):s.current.set(V,new Set([Y]))),D(3,()=>{B(),P(),t.current.value||j(),T.emit()}),()=>{r.current.delete(Y),n.current.delete(Y),t.current.filtered.items.delete(Y);let ue=$();D(4,()=>{B(),(ue==null?void 0:ue.getAttribute("id"))===Y&&j(),T.emit()})}),group:Y=>(s.current.has(Y)||s.current.set(Y,new Set),()=>{r.current.delete(Y),s.current.delete(Y)}),filter:()=>a.current.shouldFilter,label:l||i["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:C,labelId:k,listInnerRef:E}),[]);function R(Y,V){var ue,he;let Te=(he=(ue=a.current)==null?void 0:ue.filter)!=null?he:Vht;return Y?Te(Y,t.current.search,V):0}function P(){if(!t.current.search||a.current.shouldFilter===!1)return;let Y=t.current.filtered.items,V=[];t.current.filtered.groups.forEach(he=>{let Te=s.current.get(he),nt=0;Te.forEach(ge=>{let _e=Y.get(ge);nt=Math.max(_e,nt)}),V.push([he,nt])});let ue=E.current;K().sort((he,Te)=>{var nt,ge;let _e=he.getAttribute("id"),$e=Te.getAttribute("id");return((nt=Y.get($e))!=null?nt:0)-((ge=Y.get(_e))!=null?ge:0)}).forEach(he=>{let Te=he.closest(XU);Te?Te.appendChild(he.parentElement===Te?he:he.closest(`${XU} > *`)):ue.appendChild(he.parentElement===ue?he:he.closest(`${XU} > *`))}),V.sort((he,Te)=>Te[1]-he[1]).forEach(he=>{var Te;let nt=(Te=E.current)==null?void 0:Te.querySelector(`${LT}[${bk}="${encodeURIComponent(he[0])}"]`);nt==null||nt.parentElement.appendChild(nt)})}function j(){let Y=K().find(ue=>ue.getAttribute("aria-disabled")!=="true"),V=Y==null?void 0:Y.getAttribute(bk);T.setState("value",V||void 0)}function B(){var Y,V,ue,he;if(!t.current.search||a.current.shouldFilter===!1){t.current.filtered.count=n.current.size;return}t.current.filtered.groups=new Set;let Te=0;for(let nt of n.current){let ge=(V=(Y=r.current.get(nt))==null?void 0:Y.value)!=null?V:"",_e=(he=(ue=r.current.get(nt))==null?void 0:ue.keywords)!=null?he:[],$e=R(ge,_e);t.current.filtered.items.set(nt,$e),$e>0&&Te++}for(let[nt,ge]of s.current)for(let _e of ge)if(t.current.filtered.items.get(_e)>0){t.current.filtered.groups.add(nt);break}t.current.filtered.count=Te}function U(){var Y,V,ue;let he=$();he&&(((Y=he.parentElement)==null?void 0:Y.firstChild)===he&&((ue=(V=he.closest(LT))==null?void 0:V.querySelector(Wht))==null||ue.scrollIntoView({block:"nearest"})),he.scrollIntoView({block:"nearest"}))}function $(){var Y;return(Y=E.current)==null?void 0:Y.querySelector(`${qDe}[aria-selected="true"]`)}function K(){var Y;return Array.from(((Y=E.current)==null?void 0:Y.querySelectorAll(tbe))||[])}function z(Y){let V=K()[Y];V&&T.setState("value",V.getAttribute(bk))}function G(Y){var V;let ue=$(),he=K(),Te=he.findIndex(ge=>ge===ue),nt=he[Te+Y];(V=a.current)!=null&&V.loop&&(nt=Te+Y<0?he[he.length-1]:Te+Y===he.length?he[0]:he[Te+Y]),nt&&T.setState("value",nt.getAttribute(bk))}function ne(Y){let V=$(),ue=V==null?void 0:V.closest(LT),he;for(;ue&&!he;)ue=Y>0?Xht(ue,LT):Zht(ue,LT),he=ue==null?void 0:ue.querySelector(tbe);he?T.setState("value",he.getAttribute(bk)):G(Y)}let te=()=>z(K().length-1),H=Y=>{Y.preventDefault(),Y.metaKey?te():Y.altKey?ne(1):G(1)},Q=Y=>{Y.preventDefault(),Y.metaKey?z(0):Y.altKey?ne(-1):G(-1)};return L.createElement(Rl.div,{ref:e,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:Y=>{var V;(V=_.onKeyDown)==null||V.call(_,Y);let ue=Y.nativeEvent.isComposing||Y.keyCode===229;if(!(Y.defaultPrevented||ue))switch(Y.key){case"n":case"j":{v&&Y.ctrlKey&&H(Y);break}case"ArrowDown":{H(Y);break}case"p":case"k":{v&&Y.ctrlKey&&Q(Y);break}case"ArrowUp":{Q(Y);break}case"Home":{Y.preventDefault(),z(0);break}case"End":{Y.preventDefault(),te();break}case"Enter":{Y.preventDefault();let he=$();if(he){let Te=new Event(JG);he.dispatchEvent(Te)}}}}},L.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:tgt},l),q7(i,Y=>L.createElement(GDe.Provider,{value:T},L.createElement(KDe.Provider,{value:I},Y))))}),zht=L.forwardRef((i,e)=>{var t,n;let s=ob(),r=L.useRef(null),o=L.useContext(YDe),a=rP(),l=XDe(i),c=(n=(t=l.current)==null?void 0:t.forceMount)!=null?n:o==null?void 0:o.forceMount;Mw(()=>{if(!c)return a.item(s,o==null?void 0:o.id)},[c]);let u=ZDe(s,r,[i.value,i.children,r],i.keywords),h=rre(),g=E_(D=>D.value&&D.value===u.current),f=E_(D=>c||a.filter()===!1?!0:D.search?D.filtered.items.get(s)>0:!0);L.useEffect(()=>{let D=r.current;if(!(!D||i.disabled))return D.addEventListener(JG,m),()=>D.removeEventListener(JG,m)},[f,i.onSelect,i.disabled]);function m(){var D,T;x(),(T=(D=l.current).onSelect)==null||T.call(D,u.current)}function x(){h.setState("value",u.current,!0)}if(!f)return null;let{disabled:v,value:_,onSelect:w,forceMount:k,keywords:C,...E}=i;return L.createElement(Rl.div,{ref:yb(r,e),...E,id:s,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!g,"data-disabled":!!v,"data-selected":!!g,onPointerMove:v||a.getDisablePointerSelection()?void 0:x,onClick:v?void 0:m},i.children)}),Uht=L.forwardRef((i,e)=>{let{heading:t,children:n,forceMount:s,...r}=i,o=ob(),a=L.useRef(null),l=L.useRef(null),c=ob(),u=rP(),h=E_(f=>s||u.filter()===!1?!0:f.search?f.filtered.groups.has(o):!0);Mw(()=>u.group(o),[]),ZDe(o,a,[i.value,i.heading,l]);let g=L.useMemo(()=>({id:o,forceMount:s}),[s]);return L.createElement(Rl.div,{ref:yb(a,e),...r,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},t&&L.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},t),q7(i,f=>L.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?c:void 0},L.createElement(YDe.Provider,{value:g},f))))}),$ht=L.forwardRef((i,e)=>{let{alwaysRender:t,...n}=i,s=L.useRef(null),r=E_(o=>!o.search);return!t&&!r?null:L.createElement(Rl.div,{ref:yb(s,e),...n,"cmdk-separator":"",role:"separator"})}),qht=L.forwardRef((i,e)=>{let{onValueChange:t,...n}=i,s=i.value!=null,r=rre(),o=E_(c=>c.search),a=E_(c=>c.selectedItemId),l=rP();return L.useEffect(()=>{i.value!=null&&r.setState("search",i.value)},[i.value]),L.createElement(Rl.input,{ref:e,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":a,id:l.inputId,type:"text",value:s?i.value:o,onChange:c=>{s||r.setState("search",c.target.value),t==null||t(c.target.value)}})}),Kht=L.forwardRef((i,e)=>{let{children:t,label:n="Suggestions",...s}=i,r=L.useRef(null),o=L.useRef(null),a=E_(c=>c.selectedItemId),l=rP();return L.useEffect(()=>{if(o.current&&r.current){let c=o.current,u=r.current,h,g=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let f=c.offsetHeight;u.style.setProperty("--cmdk-list-height",f.toFixed(1)+"px")})});return g.observe(c),()=>{cancelAnimationFrame(h),g.unobserve(c)}}},[]),L.createElement(Rl.div,{ref:yb(r,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":n,id:l.listId},q7(i,c=>L.createElement("div",{ref:yb(o,l.listInnerRef),"cmdk-list-sizer":""},c)))}),Ght=L.forwardRef((i,e)=>{let{open:t,onOpenChange:n,overlayClassName:s,contentClassName:r,container:o,...a}=i;return L.createElement(Ose,{open:t,onOpenChange:n},L.createElement(jse,{container:o},L.createElement(Fse,{"cmdk-overlay":"",className:s}),L.createElement(Bse,{"aria-label":i.label,"cmdk-dialog":"",className:r},L.createElement(QDe,{ref:e,...a}))))}),Yht=L.forwardRef((i,e)=>E_(t=>t.filtered.count===0)?L.createElement(Rl.div,{ref:e,...i,"cmdk-empty":"",role:"presentation"}):null),Qht=L.forwardRef((i,e)=>{let{progress:t,children:n,label:s="Loading...",...r}=i;return L.createElement(Rl.div,{ref:e,...r,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},q7(i,o=>L.createElement("div",{"aria-hidden":!0},o)))}),Qd=Object.assign(QDe,{List:Kht,Item:zht,Input:qht,Group:Uht,Separator:$ht,Dialog:Ght,Empty:Yht,Loading:Qht});function Xht(i,e){let t=i.nextElementSibling;for(;t;){if(t.matches(e))return t;t=t.nextElementSibling}}function Zht(i,e){let t=i.previousElementSibling;for(;t;){if(t.matches(e))return t;t=t.previousElementSibling}}function XDe(i){let e=L.useRef(i);return Mw(()=>{e.current=i}),e}var Mw=typeof window>"u"?L.useEffect:L.useLayoutEffect;function xk(i){let e=L.useRef();return e.current===void 0&&(e.current=i()),e}function E_(i){let e=rre(),t=()=>i(e.snapshot());return L.useSyncExternalStore(e.subscribe,t,t)}function ZDe(i,e,t,n=[]){let s=L.useRef(),r=rP();return Mw(()=>{var o;let a=(()=>{var c;for(let u of t){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():s.current}})(),l=n.map(c=>c.trim());r.value(i,a,l),(o=e.current)==null||o.setAttribute(bk,a),s.current=a}),s}var Jht=()=>{let[i,e]=L.useState(),t=xk(()=>new Map);return Mw(()=>{t.current.forEach(n=>n()),t.current=new Map},[i]),(n,s)=>{t.current.set(n,s),e({})}};function egt(i){let e=i.type;return typeof e=="function"?e(i.props):"render"in e?e.render(i.props):i}function q7({asChild:i,children:e},t){return i&&L.isValidElement(e)?L.cloneElement(egt(e),{ref:e.ref},t(e.props.children)):t(e)}var tgt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ngt=5;function igt(){try{const i=localStorage.getItem("eddi-recent-pages");if(i)return JSON.parse(i)}catch{}return[]}function sgt(i){try{localStorage.setItem("eddi-recent-pages",JSON.stringify(i))}catch{}}const rgt=ML(i=>({isOpen:!1,recentPages:igt(),open:()=>i({isOpen:!0}),close:()=>i({isOpen:!1}),toggle:()=>i(e=>({isOpen:!e.isOpen})),addRecentPage:(e,t)=>i(n=>{const s=n.recentPages.filter(o=>o.path!==e),r=[{path:e,label:t},...s].slice(0,ngt);return sgt(r),{recentPages:r}})}));function ogt(){const{t:i}=xe(),e=il(),{isOpen:t,close:n,toggle:s,recentPages:r,addRecentPage:o}=rgt(),{data:a}=e0(),l=[{path:"/manage",label:i("nav.dashboard","Dashboard"),icon:_j,section:"pages"},{path:"/manage/agents",label:i("nav.agents","Agents"),icon:ai,section:"pages"},{path:"/manage/workflows",label:i("nav.packages","Workflows"),icon:Ed,section:"pages"},{path:"/manage/groups",label:i("nav.groups","Groups"),icon:pA,section:"pages"},{path:"/manage/resources",label:i("nav.resources","Resources"),icon:bp,section:"pages"},{path:"/manage/chat",label:i("nav.chat","Chat"),icon:Jf,section:"pages"},{path:"/manage/conversations",label:i("nav.conversations","Conversations"),icon:FSe,section:"pages"},{path:"/manage/logs",label:i("nav.logs","Logs"),icon:$v,section:"pages"},{path:"/manage/audit",label:i("nav.audit","Audit Trail"),icon:bh,section:"pages"},{path:"/manage/userdata",label:i("userData.title","User Data"),icon:ga,section:"pages"}];L.useEffect(()=>{const u=h=>{(h.metaKey||h.ctrlKey)&&h.key==="k"&&(h.preventDefault(),s()),h.key==="Escape"&&t&&n()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[s,n,t]);const c=L.useCallback((u,h)=>{n(),o(u,h),e(u)},[n,o,e]);return t?d.jsxs("div",{className:"fixed inset-0 z-[100]",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm animate-in fade-in duration-150",onClick:n,"aria-hidden":"true"}),d.jsx("div",{className:"absolute inset-x-0 top-[15%] mx-auto w-full max-w-[580px] animate-in fade-in slide-in-from-top-2 duration-200",children:d.jsxs(Qd,{className:"rounded-xl border border-border bg-popover shadow-2xl overflow-hidden",label:i("commandPalette.placeholder","Search pages, agents, actions…"),children:[d.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-4",children:[d.jsx(br,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),d.jsx(Qd.Input,{placeholder:i("commandPalette.placeholder","Search pages, agents, actions…"),className:"h-12 flex-1 bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground",autoFocus:!0}),d.jsx("kbd",{className:"hidden shrink-0 rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground sm:inline",children:"Esc"})]}),d.jsxs(Qd.List,{className:"max-h-[360px] overflow-y-auto p-2",children:[d.jsx(Qd.Empty,{className:"py-8 text-center text-sm text-muted-foreground",children:i("commandPalette.noResults","No results found.")}),r.length>0&&d.jsx(Qd.Group,{heading:d.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70",children:[d.jsx(Zr,{className:"h-3 w-3"}),i("commandPalette.recent","Recent")]}),children:r.map(u=>{const h=l.find(f=>f.path===u.path),g=(h==null?void 0:h.icon)??Zr;return d.jsxs(Qd.Item,{value:`recent ${u.label} ${u.path}`,onSelect:()=>c(u.path,u.label),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm text-foreground transition-colors data-[selected=true]:bg-primary/10 data-[selected=true]:text-primary",children:[d.jsx(g,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),d.jsx("span",{children:u.label})]},`recent-${u.path}`)})}),d.jsx(Qd.Group,{heading:d.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70",children:[d.jsx(_j,{className:"h-3 w-3"}),i("commandPalette.navigate","Navigate")]}),children:l.map(u=>d.jsxs(Qd.Item,{value:`navigate ${u.label} ${u.path}`,onSelect:()=>c(u.path,u.label),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm text-foreground transition-colors data-[selected=true]:bg-primary/10 data-[selected=true]:text-primary",children:[d.jsx(u.icon,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),d.jsx("span",{children:u.label}),d.jsx("span",{className:"ms-auto text-[10px] text-muted-foreground/50 font-mono",children:u.path.replace("/manage","")})]},u.path))}),a&&a.length>0&&d.jsx(Qd.Group,{heading:d.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70",children:[d.jsx(ai,{className:"h-3 w-3"}),i("commandPalette.agents","Agents")]}),children:a.slice(0,10).map(u=>d.jsxs(Qd.Item,{value:`agent ${u.name} ${u.description??""}`,onSelect:()=>c(`/manage/agents/${encodeURIComponent(u.resource)}`,u.name),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm text-foreground transition-colors data-[selected=true]:bg-primary/10 data-[selected=true]:text-primary",children:[d.jsx(ai,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"truncate font-medium",children:u.name}),u.description&&d.jsx("p",{className:"truncate text-xs text-muted-foreground",children:u.description})]})]},u.resource))}),d.jsxs(Qd.Group,{heading:d.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70",children:[d.jsx(Ll,{className:"h-3 w-3"}),i("commandPalette.actions","Quick Actions")]}),children:[d.jsxs(Qd.Item,{value:"action new agent create",onSelect:()=>c("/manage/agents?action=create","Create Agent"),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm text-foreground transition-colors data-[selected=true]:bg-primary/10 data-[selected=true]:text-primary",children:[d.jsx(ai,{className:"h-4 w-4 shrink-0 text-emerald-500"}),d.jsx("span",{children:i("commandPalette.createAgent","Create New Agent")})]}),d.jsxs(Qd.Item,{value:"action open chat start conversation",onSelect:()=>c("/manage/chat","Open Chat"),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm text-foreground transition-colors data-[selected=true]:bg-primary/10 data-[selected=true]:text-primary",children:[d.jsx(Jf,{className:"h-4 w-4 shrink-0 text-blue-500"}),d.jsx("span",{children:i("commandPalette.openChat","Open Chat")})]})]})]}),d.jsxs("div",{className:"flex items-center justify-between border-t border-border px-4 py-2 text-[10px] text-muted-foreground/60",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(w7e,{className:"h-3 w-3"}),d.jsx("kbd",{className:"rounded border border-border/50 px-1 font-mono",children:"↑↓"}),i("commandPalette.kbdNavigate","navigate")]}),d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx("kbd",{className:"rounded border border-border/50 px-1 font-mono",children:"Enter"}),i("commandPalette.kbdSelect","select")]}),d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx("kbd",{className:"rounded border border-border/50 px-1 font-mono",children:"Esc"}),i("commandPalette.kbdClose","close")]})]}),d.jsx("span",{className:"font-mono",children:"Ctrl+K"})]})]})})]}):null}const oP="/admin/gdpr";async function agt(i){return Oe.delete(`${oP}/${encodeURIComponent(i)}`)}async function lgt(i){return Oe.get(`${oP}/${encodeURIComponent(i)}/export`)}async function cgt(i){return Oe.post(`${oP}/${encodeURIComponent(i)}/restrict`)}async function dgt(i){return Oe.delete(`${oP}/${encodeURIComponent(i)}/restrict`)}async function ugt(i){return Oe.get(`${oP}/${encodeURIComponent(i)}/restrict`)}function hgt(){return Kt({mutationFn:i=>agt(i)})}function ggt(){return Kt({mutationFn:i=>lgt(i)})}function fgt(){return Kt({mutationFn:i=>cgt(i)})}function pgt(){return Kt({mutationFn:i=>dgt(i)})}function mgt(i){return hn({queryKey:["gdpr","restricted",i],queryFn:()=>ugt(i),enabled:!!i.trim()})}function bgt(){const{t:i}=xe(),e=cn(),[t,n]=L.useState(""),[s,r]=L.useState(!1),[o,a]=L.useState(null),l=hgt(),c=ggt(),u=fgt(),h=pgt(),{data:g,isLoading:f}=mgt(t.trim()),m=L.useCallback(()=>{t.trim()&&c.mutate(t.trim(),{onSuccess:w=>{const k=new Blob([JSON.stringify(w,null,2)],{type:"application/json"}),C=URL.createObjectURL(k),E=document.createElement("a");E.href=C,E.download=`user-data-${t.trim()}.json`,E.click(),URL.revokeObjectURL(C),ze.success(i("gdpr.exportSuccess","User data exported successfully"))},onError:w=>{ze.error(w.message)}})},[t,c,i]),x=L.useCallback(()=>{t.trim()&&l.mutate(t.trim(),{onSuccess:w=>{a(w),r(!1),ze.success(i("gdpr.deleteSuccess","User data deleted successfully"))},onError:w=>{r(!1),ze.error(w.message)}})},[t,l,i]),v=L.useCallback(()=>{if(!t.trim())return;const w=t.trim();g?h.mutate(w,{onSuccess:()=>{e.invalidateQueries({queryKey:["gdpr","restricted",w]}),ze.success(i("gdpr.restrictionLifted","Processing restriction removed"))},onError:k=>ze.error(k.message)}):u.mutate(w,{onSuccess:()=>{e.invalidateQueries({queryKey:["gdpr","restricted",w]}),ze.success(i("gdpr.restrictionApplied","Processing restricted for user"))},onError:k=>ze.error(k.message)})},[t,g,u,h,e,i]),_=u.isPending||h.isPending;return d.jsxs("div",{className:"space-y-8","data-testid":"gdpr-page",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-3 text-2xl font-bold text-foreground",children:[d.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-red-500/10",children:d.jsx(h7,{className:"h-5 w-5 text-red-500"})}),i("gdpr.title","Privacy & Compliance")]}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i("gdpr.subtitle","GDPR-compliant user data management — erasure (Art. 17), portability (Art. 15/20), and processing restriction (Art. 18)")})]}),d.jsx("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/5 p-4 space-y-2",children:d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx(Vi,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-500"}),d.jsxs("div",{className:"space-y-1 text-xs text-foreground",children:[d.jsx("p",{className:"font-semibold",children:i("gdpr.legalNotice","Data Protection Notice")}),d.jsx("p",{className:"text-muted-foreground",children:i("gdpr.legalDesc","Data export (Art. 15/20) provides a JSON file containing all stored data for a user. Deletion (Art. 17) permanently removes all memories and conversation data, pseudonymizes audit entries, and cannot be undone.")})]})]})}),d.jsxs("div",{className:"rounded-xl border border-border bg-card p-6 space-y-5",children:[d.jsxs("h2",{className:"flex items-center gap-2 text-base font-semibold text-foreground",children:[d.jsx(i7e,{className:"h-4 w-4 text-primary"}),i("gdpr.userLookup","User Lookup")]}),d.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end",children:[d.jsxs("div",{className:"flex-1",children:[d.jsx("label",{htmlFor:"gdpr-user-id",className:"mb-1 block text-xs font-medium text-muted-foreground",children:i("gdpr.userId","User ID")}),d.jsx("input",{id:"gdpr-user-id",type:"text",value:t,onChange:w=>{n(w.target.value),a(null)},placeholder:i("gdpr.userIdPlaceholder","Enter user ID..."),className:"h-10 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"gdpr-user-id"})]}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsxs(Yt,{variant:"secondary",onClick:m,disabled:!t.trim()||c.isPending,className:"gap-2","data-testid":"gdpr-export-btn",children:[d.jsx(Q_,{className:"h-4 w-4"}),c.isPending?i("gdpr.exporting","Exporting..."):i("gdpr.export","Export Data")]}),d.jsxs(Yt,{variant:"destructive",onClick:()=>r(!0),disabled:!t.trim()||l.isPending,className:"gap-2","data-testid":"gdpr-delete-btn",children:[d.jsx(_n,{className:"h-4 w-4"}),l.isPending?i("gdpr.deleting","Deleting..."):i("gdpr.delete","Delete All Data")]})]})]})]}),d.jsxs("div",{className:"rounded-xl border border-border bg-card p-6 space-y-4","data-testid":"gdpr-restriction-section",children:[d.jsxs("h2",{className:"flex items-center gap-2 text-base font-semibold text-foreground",children:[d.jsx(tU,{className:"h-4 w-4 text-amber-500"}),i("gdpr.restrictionTitle","Processing Restriction (Art. 18)")]}),d.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:i("gdpr.restrictionDesc","Restrict processing when a user disputes data accuracy or objects to processing. While restricted, the user's data is preserved but no new conversations can be processed. This is reversible.")}),d.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[d.jsx("div",{className:"flex items-center gap-2",children:t.trim()?f?d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-muted px-3 py-1 text-xs font-medium text-muted-foreground",children:[d.jsx("div",{className:"h-3 w-3 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent"}),i("gdpr.checkingStatus","Checking...")]}):g?d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-amber-500/10 px-3 py-1 text-xs font-semibold text-amber-600 dark:text-amber-400","data-testid":"restriction-badge-restricted",children:[d.jsx(tU,{className:"h-3 w-3"}),i("gdpr.statusRestricted","Processing Restricted")]}):d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-emerald-500/10 px-3 py-1 text-xs font-semibold text-emerald-600 dark:text-emerald-400","data-testid":"restriction-badge-active",children:[d.jsx(bh,{className:"h-3 w-3"}),i("gdpr.statusActive","Processing Active")]}):d.jsx("span",{className:"text-xs text-muted-foreground italic",children:i("gdpr.enterUserIdFirst","Enter a user ID above to check status")})}),d.jsx(Yt,{variant:g?"secondary":"destructive",size:"sm",onClick:v,disabled:!t.trim()||_||f,className:"gap-2","data-testid":"gdpr-restrict-toggle",children:g?d.jsxs(d.Fragment,{children:[d.jsx(bh,{className:"h-4 w-4"}),_?i("gdpr.liftingRestriction","Lifting..."):i("gdpr.liftRestriction","Lift Restriction")]}):d.jsxs(d.Fragment,{children:[d.jsx(tU,{className:"h-4 w-4"}),_?i("gdpr.restricting","Restricting..."):i("gdpr.restrictProcessing","Restrict Processing")]})})]})]}),o&&d.jsxs("div",{className:"rounded-xl border border-emerald-500/20 bg-emerald-500/5 p-6 space-y-4","data-testid":"gdpr-results",children:[d.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-emerald-600 dark:text-emerald-400",children:[d.jsx(Xl,{className:"h-4 w-4"}),i("gdpr.resultsTitle","Erasure Complete")]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[d.jsx(F5,{label:i("gdpr.memoriesDeleted","Memories Deleted"),value:o.memoriesDeleted}),d.jsx(F5,{label:i("gdpr.conversationsDeleted","Conversations Deleted"),value:o.conversationsDeleted}),d.jsx(F5,{label:i("gdpr.auditPseudonymized","Audit Pseudonymized"),value:o.auditEntriesPseudonymized}),d.jsx(F5,{label:i("gdpr.logsPseudonymized","Logs Pseudonymized"),value:o.logEntriesPseudonymized})]})]}),d.jsx(sl,{open:s,onOpenChange:r,title:i("gdpr.confirmTitle","Confirm Data Deletion"),description:i("gdpr.confirmDesc",'This will permanently delete ALL data for user "{{userId}}". This action cannot be undone.',{userId:t.trim()}),confirmLabel:i("gdpr.confirmDelete","Yes, Delete All Data"),variant:"destructive",onConfirm:x,isPending:l.isPending})]})}function F5({label:i,value:e}){return d.jsxs("div",{className:"rounded-lg border border-border bg-background p-3 text-center",children:[d.jsx("p",{className:"text-2xl font-bold text-foreground",children:e}),d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:i})]})}function zE(i,e=400){const[t,n]=L.useState(i);return L.useEffect(()=>{const s=setTimeout(()=>n(i),e);return()=>clearTimeout(s)},[i,e]),t}const ore="/usermemorystore/memories";async function xgt(i){return Oe.get(`${ore}/${encodeURIComponent(i)}`)}async function vgt(i){return Oe.delete(`${ore}/entry/${encodeURIComponent(i)}`)}async function _gt(i){return Oe.delete(`${ore}/${encodeURIComponent(i)}`)}function ygt(i){return hn({queryKey:["user-memories",i],queryFn:()=>xgt(i),enabled:!!i.trim()})}function wgt(){const i=cn();return Kt({mutationFn:e=>vgt(e),onSuccess:()=>{i.invalidateQueries({queryKey:["user-memories"]})}})}function Cgt(){const i=cn();return Kt({mutationFn:e=>_gt(e),onSuccess:()=>{i.invalidateQueries({queryKey:["user-memories"]})}})}const Sgt=["all","preference","fact","context"],kgt={preference:"bg-purple-500/10 text-purple-600 dark:text-purple-400",fact:"bg-sky-500/10 text-sky-600 dark:text-sky-400",context:"bg-amber-500/10 text-amber-600 dark:text-amber-400"},Ngt={self:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",global:"bg-violet-500/10 text-violet-600 dark:text-violet-400",group:"bg-orange-500/10 text-orange-600 dark:text-orange-400"};function Egt({embedded:i}={}){const{t:e}=xe(),[t,n]=L.useState(""),[s,r]=L.useState(""),[o,a]=L.useState("all"),[l,c]=L.useState(!1),u=zE(t.trim(),500),{data:h,isLoading:g,isError:f,refetch:m}=ygt(u),x=wgt(),v=Cgt(),_=L.useMemo(()=>{if(!h)return[];let D=h;if(o!=="all"&&(D=D.filter(T=>T.category===o)),s.trim()){const T=s.trim().toLowerCase();D=D.filter(I=>I.key.toLowerCase().includes(T)||String(I.value).toLowerCase().includes(T))}return D},[h,o,s]),w=L.useMemo(()=>h?h.reduce((D,T)=>(D.all++,T.category==="preference"?D.preference++:T.category==="fact"?D.fact++:T.category==="context"&&D.context++,D),{all:0,preference:0,fact:0,context:0}):{all:0,preference:0,fact:0,context:0},[h]),k=L.useMemo(()=>(h??[]).filter(D=>D.conflicted).length,[h]),C=L.useCallback(D=>{x.mutate(D,{onSuccess:()=>ze.success(e("memories.entryDeleted","Memory entry deleted")),onError:T=>ze.error(T.message)})},[x,e]),E=L.useCallback(()=>{v.mutate(u,{onSuccess:()=>{ze.success(e("memories.allDeleted","All memories deleted for user")),c(!1)},onError:D=>ze.error(D.message)})},[v,u,e]);return d.jsxs("div",{className:"space-y-6","data-testid":"user-memory-page",children:[!i&&d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-3 text-2xl font-bold text-foreground",children:[d.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-teal-500/10",children:d.jsx(Nl,{className:"h-5 w-5 text-teal-500"})}),e("memories.title","User Memory")]}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:e("memories.subtitle","Browse, search, and manage persistent user memories stored by agents")})]}),d.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[d.jsx("div",{className:"flex-1",children:d.jsx("input",{type:"text",value:t,onChange:D=>n(D.target.value),placeholder:e("memories.userIdPlaceholder","Enter User ID..."),className:"h-10 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"memory-user-id"})}),d.jsxs("div",{className:"relative flex-1",children:[d.jsx(br,{className:"absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:s,onChange:D=>r(D.target.value),placeholder:e("memories.searchPlaceholder","Search memories..."),className:"h-10 w-full rounded-lg border border-input bg-background ps-9 pe-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"memory-search"})]})]}),u&&h&&d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4","data-testid":"memory-stats",children:[d.jsx(B5,{label:e("memories.totalEntries","Total Entries"),value:w.all,icon:Zf}),d.jsx(B5,{label:e("memories.preferences","Preferences"),value:w.preference,icon:Nl,color:"text-purple-500"}),d.jsx(B5,{label:e("memories.facts","Facts"),value:w.fact,icon:IL,color:"text-sky-500"}),d.jsx(B5,{label:e("memories.conflicts","Conflicted"),value:k,icon:Vi,color:k>0?"text-amber-500":"text-muted-foreground"})]}),u&&h&&d.jsxs("div",{className:"flex flex-wrap gap-1.5 border-b border-border pb-2",children:[Sgt.map(D=>d.jsxs("button",{onClick:()=>a(D),className:be("inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-xs font-medium transition-colors",o===D?"bg-primary text-primary-foreground":"bg-secondary/50 text-muted-foreground hover:bg-secondary hover:text-foreground"),"data-testid":`category-${D}`,children:[e(`memories.cat_${D}`,D.charAt(0).toUpperCase()+D.slice(1)),d.jsx("span",{className:"rounded-full bg-background/20 px-1.5 text-[10px]",children:w[D]})]},D)),d.jsx("span",{className:"flex-1"}),d.jsxs(Yt,{variant:"destructive",size:"sm",onClick:()=>c(!0),disabled:!h.length||v.isPending,className:"gap-1.5 text-xs","data-testid":"delete-all-memories",children:[d.jsx(_n,{className:"h-3.5 w-3.5"}),e("memories.deleteAll","Delete All")]})]}),!u&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-dashed py-20 text-muted-foreground",children:[d.jsx(Nl,{className:"h-12 w-12 opacity-30"}),d.jsx("p",{className:"mt-4 text-sm",children:e("memories.enterUserId","Enter a User ID to browse their memories")})]}),u&&g&&d.jsx("div",{className:"flex items-center justify-center py-16",children:d.jsx(xi,{className:"h-8 w-8 animate-spin text-primary"})}),u&&f&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-destructive/30 bg-destructive/5 py-12",children:[d.jsx(Lo,{className:"h-10 w-10 text-destructive"}),d.jsx("p",{className:"mt-3 text-sm text-destructive",children:e("common.error")}),d.jsx("button",{onClick:()=>m(),className:"mt-3 text-xs text-primary hover:underline",children:e("common.retry")})]}),u&&!g&&!f&&h&&d.jsx("div",{className:"space-y-2","data-testid":"memory-list",children:_.length===0?d.jsx("div",{className:"rounded-xl border border-dashed py-12 text-center text-sm text-muted-foreground",children:e("memories.noResults","No memory entries found")}):_.map(D=>d.jsx(Lgt,{entry:D,onDelete:C,isDeleting:x.isPending},D.id??D.key))}),d.jsx(sl,{open:l,onOpenChange:c,title:e("memories.deleteAllTitle","Delete All Memories"),description:e("memories.deleteAllDesc","This will permanently delete ALL memory entries for this user. This action cannot be undone."),confirmLabel:e("memories.deleteAllConfirm","Delete All"),variant:"destructive",onConfirm:E,isPending:v.isPending})]})}function B5({label:i,value:e,icon:t,color:n}){return d.jsxs("div",{className:"rounded-xl border border-border bg-card p-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(t,{className:be("h-4 w-4",n??"text-primary")}),d.jsx("span",{className:"text-xs text-muted-foreground",children:i})]}),d.jsx("p",{className:"mt-1 text-2xl font-bold text-foreground",children:e})]})}function Lgt({entry:i,onDelete:e,isDeleting:t}){const{t:n}=xe(),[s,r]=L.useState(!1),o=L.useMemo(()=>i.value===null||i.value===void 0?"—":typeof i.value=="object"?JSON.stringify(i.value).slice(0,100):String(i.value).slice(0,100),[i.value]);return d.jsxs("div",{className:be("rounded-xl border bg-card transition-colors",i.conflicted&&"border-amber-500/30 bg-amber-500/5"),"data-testid":`memory-entry-${i.id??i.key}`,children:[d.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 cursor-pointer",onClick:()=>r(!s),children:[d.jsx("button",{type:"button",className:"shrink-0 text-muted-foreground",children:s?d.jsx(Rn,{className:"h-4 w-4"}):d.jsx(hs,{className:"h-4 w-4"})}),d.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:i.key}),d.jsx("span",{className:be("shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold",kgt[i.category]??"bg-muted text-muted-foreground"),children:i.category}),d.jsx("span",{className:be("shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold",Ngt[i.visibility]??"bg-muted text-muted-foreground"),children:i.visibility}),i.conflicted&&d.jsx("span",{title:n("memories.conflicted","Conflicted"),children:d.jsx(Vi,{className:"h-3.5 w-3.5 shrink-0 text-amber-500"})}),d.jsx("span",{className:"hidden text-xs text-muted-foreground sm:block max-w-48 truncate",children:o}),d.jsx("button",{type:"button",onClick:a=>{a.stopPropagation(),i.id&&e(i.id)},disabled:t||!i.id,className:"shrink-0 rounded p-1.5 text-muted-foreground hover:text-destructive transition-colors disabled:opacity-50",title:n("common.delete"),"data-testid":`delete-memory-${i.id}`,children:d.jsx(_n,{className:"h-3.5 w-3.5"})})]}),s&&d.jsxs("div",{className:"border-t border-border px-4 py-3 space-y-2",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("memories.value","Value")}),d.jsx("pre",{className:"mt-0.5 rounded-lg bg-muted/50 p-3 text-xs text-foreground overflow-x-auto max-h-48 whitespace-pre-wrap break-all",children:typeof i.value=="object"?JSON.stringify(i.value,null,2):String(i.value??"—")})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 text-xs",children:[d.jsxs("div",{children:[d.jsxs("span",{className:"text-[10px] text-muted-foreground flex items-center gap-1",children:[d.jsx(ai,{className:"h-3 w-3"})," ",n("memories.sourceAgent","Source Agent")]}),d.jsx("p",{className:"font-mono text-foreground truncate",children:i.sourceAgentId??"—"})]}),d.jsxs("div",{children:[d.jsxs("span",{className:"text-[10px] text-muted-foreground flex items-center gap-1",children:[d.jsx(Zf,{className:"h-3 w-3"})," ",n("memories.accessCount","Access Count")]}),d.jsx("p",{className:"text-foreground",children:i.accessCount??0})]}),d.jsxs("div",{children:[d.jsxs("span",{className:"text-[10px] text-muted-foreground flex items-center gap-1",children:[d.jsx(Zr,{className:"h-3 w-3"})," ",n("memories.created","Created")]}),d.jsx("p",{className:"text-foreground",children:i.createdAt?new Date(i.createdAt).toLocaleString():"—"})]}),d.jsxs("div",{children:[d.jsxs("span",{className:"text-[10px] text-muted-foreground flex items-center gap-1",children:[d.jsx(Zr,{className:"h-3 w-3"})," ",n("memories.updated","Updated")]}),d.jsx("p",{className:"text-foreground",children:i.updatedAt?new Date(i.updatedAt).toLocaleString():"—"})]})]}),i.sourceConversationId&&d.jsxs("div",{className:"text-xs",children:[d.jsx("span",{className:"text-[10px] text-muted-foreground",children:n("memories.sourceConversation","Source Conversation")}),d.jsx("p",{className:"font-mono text-foreground",children:i.sourceConversationId})]})]})]})}const JDe="/propertiesstore/properties";async function Dgt(i){return Oe.get(`${JDe}/${encodeURIComponent(i)}`)}async function Tgt(i){return Oe.delete(`${JDe}/${encodeURIComponent(i)}`)}function Igt(i){return hn({queryKey:["user-properties",i],queryFn:()=>Dgt(i),enabled:!!i.trim()})}function Agt(){const i=cn();return Kt({mutationFn:e=>Tgt(e),onSuccess:()=>{i.invalidateQueries({queryKey:["user-properties"]})}})}function Rgt(i){return i.valueString!=null?{type:"string",value:String(i.valueString),icon:$ge}:i.valueInt!=null?{type:"number",value:String(i.valueInt),icon:Zf}:i.valueFloat!=null?{type:"number",value:String(i.valueFloat),icon:Zf}:i.valueBoolean!=null?{type:"boolean",value:String(i.valueBoolean),icon:zie}:i.valueList!=null?{type:"array",value:JSON.stringify(i.valueList),icon:MSe}:i.valueObject!=null?{type:"object",value:JSON.stringify(i.valueObject),icon:rBe}:{type:"null",value:"—",icon:$ge}}const Mgt={string:"text-emerald-600 bg-emerald-500/10 dark:text-emerald-400",number:"text-sky-600 bg-sky-500/10 dark:text-sky-400",boolean:"text-violet-600 bg-violet-500/10 dark:text-violet-400",array:"text-amber-600 bg-amber-500/10 dark:text-amber-400",object:"text-rose-600 bg-rose-500/10 dark:text-rose-400",null:"text-muted-foreground bg-muted"};function Pgt({embedded:i}={}){const{t:e}=xe(),[t,n]=L.useState(""),[s,r]=L.useState(""),[o,a]=L.useState(!1),l=zE(t.trim(),500),{data:c,isLoading:u,isError:h,refetch:g}=Igt(l),f=Agt(),m=c&&Object.keys(c).length>0,x=L.useMemo(()=>{if(!c)return[];const v=Object.entries(c).map(([_,w])=>{const k=Rgt(w);return{key:_,prop:w,...k}});if(s.trim()){const _=s.trim().toLowerCase();return v.filter(w=>w.key.toLowerCase().includes(_)||w.value.toLowerCase().includes(_))}return v},[c,s]);return d.jsxs("div",{className:"space-y-6","data-testid":"properties-page",children:[!i&&d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-3 text-2xl font-bold text-foreground",children:[d.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-indigo-500/10",children:d.jsx(C_,{className:"h-5 w-5 text-indigo-500"})}),e("properties.title","User Properties")]}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:e("properties.subtitle","Browse and manage longTerm slot-filling properties stored per user")})]}),d.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[d.jsx("div",{className:"flex-1",children:d.jsx("input",{type:"text",value:t,onChange:v=>n(v.target.value),placeholder:e("properties.userIdPlaceholder","Enter User ID..."),className:"h-10 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"properties-user-id"})}),d.jsxs("div",{className:"relative flex-1",children:[d.jsx(br,{className:"absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:s,onChange:v=>r(v.target.value),placeholder:e("properties.searchPlaceholder","Filter properties..."),className:"h-10 w-full rounded-lg border border-input bg-background ps-9 pe-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"properties-search"})]}),m&&d.jsxs(Yt,{variant:"destructive",size:"sm",onClick:()=>a(!0),disabled:f.isPending,className:"gap-1.5 self-end","data-testid":"delete-all-props",children:[d.jsx(_n,{className:"h-3.5 w-3.5"}),e("properties.deleteAll","Delete All")]})]}),!l&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-dashed py-20 text-muted-foreground",children:[d.jsx(C_,{className:"h-12 w-12 opacity-30"}),d.jsx("p",{className:"mt-4 text-sm",children:e("properties.enterUserId","Enter a User ID to view their properties")})]}),l&&u&&d.jsx("div",{className:"flex items-center justify-center py-16",children:d.jsx(xi,{className:"h-8 w-8 animate-spin text-primary"})}),l&&h&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-destructive/30 bg-destructive/5 py-12",children:[d.jsx(Lo,{className:"h-10 w-10 text-destructive"}),d.jsx("p",{className:"mt-3 text-sm text-destructive",children:e("common.error")}),d.jsx("button",{onClick:()=>g(),className:"mt-3 text-xs text-primary hover:underline",children:e("common.retry")})]}),l&&!u&&!h&&c&&d.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden","data-testid":"properties-table",children:[x.length===0?d.jsx("div",{className:"py-12 text-center text-sm text-muted-foreground",children:e("properties.noResults","No properties found")}):d.jsxs("div",{className:"divide-y divide-border",children:[d.jsxs("div",{className:"hidden sm:grid sm:grid-cols-12 gap-3 px-4 py-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/30",children:[d.jsx("span",{className:"col-span-4",children:e("properties.key","Key")}),d.jsx("span",{className:"col-span-1",children:e("properties.type","Type")}),d.jsx("span",{className:"col-span-7",children:e("properties.value","Value")})]}),x.map(v=>d.jsxs("div",{className:"grid grid-cols-1 gap-1 px-4 py-3 sm:grid-cols-12 sm:gap-3 sm:items-center hover:bg-secondary/30 transition-colors","data-testid":`property-${v.key}`,children:[d.jsx("span",{className:"col-span-4 text-sm font-medium text-foreground font-mono truncate",children:v.key}),d.jsx("span",{className:be("col-span-1 inline-flex w-fit rounded-full px-2 py-0.5 text-[10px] font-semibold",Mgt[v.type]),children:v.type}),d.jsx("span",{className:"col-span-7 text-xs text-muted-foreground font-mono truncate",title:v.value,children:v.value.length>200?v.value.slice(0,200)+"…":v.value})]},v.key))]}),d.jsx("div",{className:"border-t border-border px-4 py-2 text-xs text-muted-foreground bg-muted/20",children:e("properties.showingCount","{{count}} properties",{count:x.length})})]}),d.jsx(sl,{open:o,onOpenChange:a,title:e("properties.deleteAllTitle","Delete All Properties"),description:e("properties.deleteAllDesc","This will permanently delete ALL properties for this user."),confirmLabel:e("common.delete"),variant:"destructive",onConfirm:()=>{f.mutate(l,{onSuccess:()=>{ze.success(e("properties.deleted","Properties deleted")),a(!1)},onError:v=>ze.error(v.message)})},isPending:f.isPending})]})}const are="/userconversationstore/userconversations";async function Ogt(i,e){return Oe.get(`${are}/${encodeURIComponent(i)}/${encodeURIComponent(e)}`)}async function jgt(i,e,t){return Oe.post(`${are}/${encodeURIComponent(i)}/${encodeURIComponent(e)}`,t)}async function Fgt(i,e){return Oe.delete(`${are}/${encodeURIComponent(i)}/${encodeURIComponent(e)}`)}const lre=["userConversations"];function Bgt(i,e){return hn({queryKey:[...lre,i,e],queryFn:()=>Ogt(i,e),enabled:!!i.trim()&&!!e.trim(),retry:!1})}function Hgt(){const i=cn();return Kt({mutationFn:({intent:e,userId:t,data:n})=>jgt(e,t,n),onSuccess:()=>i.invalidateQueries({queryKey:lre})})}function Wgt(){const i=cn();return Kt({mutationFn:({intent:e,userId:t})=>Fgt(e,t),onSuccess:()=>i.invalidateQueries({queryKey:lre})})}function Vgt({embedded:i}={}){const{t:e}=xe(),[t,n]=L.useState(""),[s,r]=L.useState(""),o=zE(t,400),a=zE(s,400),{data:l,isLoading:c,isError:u,error:h}=Bgt(o,a),g=Wgt(),[f,m]=L.useState(!1),[x,v]=L.useState(null),_=t.trim().length>0&&s.trim().length>0;return d.jsxs("div",{className:"space-y-6","data-testid":"user-conversations-page",children:[!i&&d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-3 text-2xl font-bold text-foreground",children:[d.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-blue-500/10",children:d.jsx(Dw,{className:"h-5 w-5 text-blue-500"})}),e("userConversations.title","User Conversations")]}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:e("userConversations.subtitle","Lookup and manage intent → user → conversation bindings used by managed agents")})]}),d.jsxs(Yt,{onClick:()=>m(!0),className:"gap-2","data-testid":"create-user-conv-btn",children:[d.jsx(Gt,{className:"h-4 w-4"}),e("userConversations.create","Create Binding")]})]}),i&&d.jsx("div",{className:"flex justify-end",children:d.jsxs(Yt,{onClick:()=>m(!0),className:"gap-2","data-testid":"create-user-conv-btn-embedded",children:[d.jsx(Gt,{className:"h-4 w-4"}),e("userConversations.create","Create Binding")]})}),d.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[d.jsxs("h2",{className:"mb-4 text-sm font-semibold text-foreground",children:[d.jsx(br,{className:"me-2 inline h-4 w-4 text-primary"}),e("userConversations.lookup","Lookup")]}),d.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:e("userConversations.intent","Intent")}),d.jsx("input",{type:"text",value:t,onChange:w=>n(w.target.value),placeholder:"e.g. booking_request",className:"h-10 w-full rounded-lg border border-input bg-background px-3 font-mono text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"uc-intent-input"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:e("userConversations.userId","User ID")}),d.jsx("input",{type:"text",value:s,onChange:w=>r(w.target.value),placeholder:"e.g. user-123",className:"h-10 w-full rounded-lg border border-input bg-background px-3 font-mono text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"uc-userid-input"})]})]})]}),!_&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-dashed py-20 text-muted-foreground",children:[d.jsx(br,{className:"h-12 w-12 opacity-30"}),d.jsx("p",{className:"mt-4 text-sm",children:e("userConversations.enterBoth","Enter both intent and user ID to search")})]}),_&&c&&d.jsx("div",{className:"flex items-center justify-center py-16",children:d.jsx(xi,{className:"h-8 w-8 animate-spin text-primary"})}),_&&u&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-dashed py-20 text-muted-foreground",children:[d.jsx(Lo,{className:"h-10 w-10 opacity-30"}),d.jsx("p",{className:"mt-4 text-sm",children:(h==null?void 0:h.status)===404?e("userConversations.notFound","No binding found for this intent + user"):e("common.error")})]}),_&&!c&&!u&&l&&d.jsxs("div",{className:"rounded-xl border border-border bg-card","data-testid":"uc-result-card",children:[d.jsx("div",{className:"border-b border-border px-5 py-4",children:d.jsx("h3",{className:"text-sm font-semibold text-foreground",children:e("userConversations.binding","Active Binding")})}),d.jsxs("div",{className:"space-y-3 px-5 py-4",children:[d.jsxs("div",{className:"cq-stat-grid",children:[d.jsx(H5,{icon:d.jsx(Dw,{className:"h-3.5 w-3.5"}),label:e("userConversations.intent","Intent"),value:l.intent}),d.jsx(H5,{icon:d.jsx(br,{className:"h-3.5 w-3.5"}),label:e("userConversations.userId","User ID"),value:l.userId}),d.jsx(H5,{icon:d.jsx(ai,{className:"h-3.5 w-3.5"}),label:e("userConversations.agentId","Agent ID"),value:l.agentId}),d.jsx(H5,{icon:d.jsx(rb,{className:"h-3.5 w-3.5"}),label:e("userConversations.environment","Environment"),value:l.environment})]}),d.jsxs("div",{className:"flex items-center gap-3 rounded-lg bg-secondary/30 px-4 py-3",children:[d.jsx(Zl,{className:"h-4 w-4 text-primary shrink-0"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-xs text-muted-foreground",children:e("userConversations.conversationId","Conversation ID")}),d.jsx(Kn,{to:`/manage/conversationview/${l.conversationId}`,className:"block truncate font-mono text-sm text-primary hover:underline",children:l.conversationId})]}),d.jsxs(Yt,{variant:"destructive",size:"sm",onClick:()=>v({intent:l.intent,userId:l.userId}),"data-testid":"uc-delete-btn",children:[d.jsx(_n,{className:"h-3.5 w-3.5 me-1.5"}),e("common.delete")]})]})]})]}),f&&d.jsx(zgt,{onClose:()=>m(!1)}),d.jsx(sl,{open:!!x,onOpenChange:()=>v(null),title:e("userConversations.deleteTitle","Delete Binding"),description:e("userConversations.deleteDesc",'Remove the conversation binding for intent "{{intent}}" and user "{{userId}}"?',{intent:(x==null?void 0:x.intent)??"",userId:(x==null?void 0:x.userId)??""}),confirmLabel:e("common.delete"),variant:"destructive",onConfirm:()=>{x&&g.mutate(x,{onSuccess:()=>{ze.success(e("userConversations.deleted","Binding deleted")),v(null)},onError:w=>ze.error(w.message)})},isPending:g.isPending})]})}function H5({icon:i,label:e,value:t}){return d.jsxs("div",{className:"rounded-lg border border-border/50 bg-muted/30 px-3 py-2.5",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[i,e]}),d.jsx("p",{className:"mt-1 truncate font-mono text-sm text-foreground",title:t,children:t})]})}function zgt({onClose:i}){const{t:e}=xe(),t=Hgt(),[n,s]=L.useState(""),[r,o]=L.useState(""),[a,l]=L.useState(""),[c,u]=L.useState(""),[h,g]=L.useState("production");L.useEffect(()=>{const x=v=>{v.key==="Escape"&&i()};return document.addEventListener("keydown",x),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",x),document.body.style.overflow=""}},[i]);const f=n.trim()&&r.trim()&&a.trim()&&c.trim(),m=L.useCallback(()=>{f&&t.mutate({intent:n.trim(),userId:r.trim(),data:{intent:n.trim(),userId:r.trim(),agentId:a.trim(),conversationId:c.trim(),environment:h}},{onSuccess:()=>{ze.success(e("userConversations.created","Binding created")),i()},onError:x=>ze.error(x.message)})},[f,n,r,a,c,h,t,e,i]);return d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:i,role:"dialog","aria-modal":"true","aria-label":e("userConversations.createTitle","Create Binding"),children:d.jsxs("div",{className:"w-full max-w-lg rounded-xl border border-border bg-card p-6 shadow-xl space-y-4 mx-4",onClick:x=>x.stopPropagation(),"data-testid":"uc-create-dialog",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-lg font-semibold text-foreground",children:e("userConversations.createTitle","Create Binding")}),d.jsx("button",{onClick:i,className:"text-muted-foreground hover:text-foreground","aria-label":e("common.close"),children:d.jsx(An,{className:"h-5 w-5"})})]}),d.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:e("userConversations.intent","Intent")}),d.jsx("input",{type:"text",value:n,onChange:x=>s(x.target.value),placeholder:"booking_request",className:"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-ring",autoFocus:!0})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:e("userConversations.userId","User ID")}),d.jsx("input",{type:"text",value:r,onChange:x=>o(x.target.value),placeholder:"user-123",className:"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:e("userConversations.agentId","Agent ID")}),d.jsx("input",{type:"text",value:a,onChange:x=>l(x.target.value),placeholder:"abc123",className:"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:e("userConversations.environment","Environment")}),d.jsx("select",{value:h,onChange:x=>g(x.target.value),className:"h-9 w-full rounded-md border border-input bg-background px-2 text-sm focus:outline-none focus:ring-1 focus:ring-ring",children:Sj.map(x=>d.jsx("option",{value:x,children:x},x))})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:e("userConversations.conversationId","Conversation ID")}),d.jsx("input",{type:"text",value:c,onChange:x=>u(x.target.value),placeholder:"conv-xyz-789",className:"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-ring"})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[d.jsx(Yt,{variant:"secondary",onClick:i,size:"sm",children:e("common.cancel")}),d.jsx(Yt,{onClick:m,disabled:!f||t.isPending,size:"sm","data-testid":"uc-save-btn",children:t.isPending?e("common.saving","Saving..."):e("common.save")})]})]})})}const nbe=["memories","properties","conversations"],Ugt={memories:Nl,properties:C_,conversations:Dw},$gt={memories:"text-teal-500",properties:"text-indigo-500",conversations:"text-blue-500"};function qgt(){const{t:i}=xe(),[e,t]=G_(),n=e.get("tab")||"memories",[s,r]=L.useState(nbe.includes(n)?n:"memories"),o=l=>{r(l),t({tab:l},{replace:!0})},a={memories:i("memories.title","Memories"),properties:i("properties.title","Properties"),conversations:i("userConversations.title","Conversations")};return d.jsxs("div",{className:"space-y-6","data-testid":"user-data-page",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-3 text-2xl font-bold text-foreground",children:[d.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-violet-500/10",children:d.jsx(ga,{className:"h-5 w-5 text-violet-500"})}),i("userData.title","User Data")]}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i("userData.subtitle","Manage per-user memories, properties, and conversation bindings")})]}),d.jsx("div",{className:"flex gap-1 rounded-xl border border-border bg-card p-1",role:"tablist","aria-label":i("userData.tabs","User data sections"),children:nbe.map(l=>{const c=Ugt[l],u=s===l;return d.jsxs("button",{role:"tab","aria-selected":u,"aria-controls":`panel-${l}`,onClick:()=>o(l),className:be("flex flex-1 items-center justify-center gap-2 rounded-lg px-4 py-2.5 text-sm font-medium transition-all",u?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground hover:bg-background/50"),"data-testid":`tab-${l}`,children:[d.jsx(c,{className:be("h-4 w-4",u?$gt[l]:"")}),d.jsx("span",{className:"hidden sm:inline",children:a[l]})]},l)})}),d.jsxs("div",{role:"tabpanel",id:`panel-${s}`,"aria-labelledby":`tab-${s}`,children:[s==="memories"&&d.jsx(Egt,{embedded:!0}),s==="properties"&&d.jsx(Pgt,{embedded:!0}),s==="conversations"&&d.jsx(Vgt,{embedded:!0})]})]})}const K7="/AgentTriggerStore/agenttriggers";async function Kgt(){return await Oe.get(K7)||[]}async function Ggt(i){return Oe.post(K7,i)}async function Ygt(i,e){return Oe.put(`${K7}/${encodeURIComponent(i)}`,e)}async function Qgt(i){return Oe.delete(`${K7}/${encodeURIComponent(i)}`)}function Xgt(){return hn({queryKey:["triggers"],queryFn:Kgt})}function Zgt(){const i=cn();return Kt({mutationFn:e=>Ggt(e),onSuccess:()=>{i.invalidateQueries({queryKey:["triggers"]})}})}function Jgt(){const i=cn();return Kt({mutationFn:({intent:e,config:t})=>Ygt(e,t),onSuccess:()=>{i.invalidateQueries({queryKey:["triggers"]})}})}function eft(){const i=cn();return Kt({mutationFn:e=>Qgt(e),onSuccess:()=>{i.invalidateQueries({queryKey:["triggers"]})}})}function tft({value:i,onChange:e,placeholder:t,readOnly:n}){var P;const{t:s}=xe(),[r,o]=L.useState(!1),[a,l]=L.useState(""),c=zE(a,300),[u,h]=L.useState(-1),g=L.useRef(null),f=L.useRef(null),m=L.useRef(null),{data:x,isLoading:v}=bEe(i),_=(P=x==null?void 0:x[0])==null?void 0:P.name,{data:w,isLoading:k}=e0(50,0,c),C=L.useMemo(()=>w?Cg(w):[],[w]),E=L.useCallback(()=>{n||(l(""),h(-1),o(!0))},[n]),D=L.useCallback(()=>{o(!1),l(""),h(-1)},[]),T=L.useCallback(j=>{e(j),D()},[e,D]),I=L.useCallback(()=>{n||e("")},[n,e]),R=L.useCallback(j=>{if(!r){j.key==="ArrowDown"&&(j.preventDefault(),E());return}j.key==="Escape"?(j.preventDefault(),D()):j.key==="ArrowDown"?(j.preventDefault(),h(B=>BB>0?B-1:C.length-1)):j.key==="Enter"&&(j.preventDefault(),u>=0&&u{if(!r)return;const j=B=>{g.current&&!g.current.contains(B.target)&&D()};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[r,D]),L.useEffect(()=>{var B;if(u<0||!m.current)return;(B=m.current.querySelectorAll("[data-agent-item]")[u])==null||B.scrollIntoView({block:"nearest"})},[u]),i?d.jsx("div",{ref:g,className:"relative flex-1",children:d.jsxs("div",{className:`flex h-9 items-center gap-2 rounded-md border px-3 ${n?"border-primary/20 bg-primary/5":"border-primary/40 bg-primary/10"}`,title:_?`${i} — ${_}`:i,children:[v?d.jsx(ni,{className:"h-4 w-4 shrink-0 animate-spin text-primary"}):d.jsx(ai,{className:"h-4 w-4 shrink-0 text-primary"}),d.jsxs("div",{className:"flex flex-1 flex-col justify-center min-w-0",children:[_&&d.jsx("span",{className:"truncate text-xs font-semibold text-foreground leading-tight pt-0.5",children:_}),d.jsx("span",{className:`truncate font-mono font-medium ${_?"text-[10px] text-muted-foreground leading-tight":"text-xs text-foreground"} pb-0.5`,children:i})]}),!n&&d.jsx("button",{type:"button",onClick:I,className:"rounded p-0.5 text-muted-foreground opacity-70 transition-colors hover:bg-background/50 hover:text-foreground hover:opacity-100","aria-label":s("common.clear","Clear selection"),children:d.jsx(An,{className:"h-3.5 w-3.5"})})]})}):d.jsxs("div",{ref:g,className:"relative flex-1",children:[d.jsxs("div",{className:"flex w-full items-stretch h-9",children:[d.jsx("input",{ref:f,type:"text",value:a,onChange:j=>{l(j.target.value),h(-1),r||o(!0)},onFocus:E,onKeyDown:R,placeholder:t||s("agents.selectAgent","Select Agent"),className:"h-full flex-1 rounded-s-md border border-e-0 border-input bg-background ps-3 pe-2 text-xs text-foreground font-mono placeholder:font-sans focus:outline-none focus:ring-1 focus:ring-ring",autoComplete:"off"}),d.jsxs("button",{type:"button",onClick:()=>r?D():E(),className:`flex h-full items-center justify-center border border-s-0 border-input px-2 text-xs transition-colors ${r?"rounded-e-md bg-primary/10 text-primary":"rounded-e-md bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,tabIndex:-1,children:[d.jsx(ai,{className:"h-3.5 w-3.5 mr-1"}),d.jsx(Rn,{className:`h-3 w-3 transition-transform ${r?"rotate-180":""}`})]})]}),r&&d.jsx("div",{className:"absolute inset-x-0 top-full z-50 mt-1 overflow-hidden rounded-lg border border-border bg-popover shadow-xl animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-150",children:d.jsx("div",{ref:m,className:"max-h-56 overflow-y-auto py-1",children:k?d.jsxs("div",{className:"flex items-center justify-center gap-2 py-4 text-xs text-muted-foreground",children:[d.jsx(ni,{className:"h-3.5 w-3.5 animate-spin"}),s("common.loading","Loading...")]}):C.length===0?d.jsx("div",{className:"px-3 py-3 text-center text-xs text-muted-foreground",children:a.trim()?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"block",children:s("common.noResults","No results found.")}),d.jsxs("span",{className:"mt-1 block text-[10px]",children:['Press Enter to use "',a,'" as ID.']})]}):s("agents.empty","No agents found")}):C.map((j,B)=>d.jsxs("button",{type:"button","data-agent-item":!0,onClick:()=>T(j.id),className:`flex w-full items-start gap-2 px-3 py-2 text-start text-xs transition-colors ${B===u?"bg-primary/10 text-foreground":"text-foreground hover:bg-secondary/50"}`,children:[d.jsx(ai,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-primary"}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("span",{className:"block truncate font-medium",children:j.name}),d.jsx("span",{className:"block truncate font-mono text-[10px] text-muted-foreground mt-0.5",children:j.id})]})]},j.id))})})]})}function nft(){const{t:i}=xe(),{data:e,isLoading:t,isError:n,refetch:s}=Xgt(),{data:r}=e0(1e3),o=Zgt(),a=Jgt(),l=eft(),[c,u]=L.useState(!1),[h,g]=L.useState(null),[f,m]=L.useState(null),[x,v]=L.useState(""),_=L.useMemo(()=>{const k=new Map;return r&&r.forEach(C=>{C.name&&k.set(uo(C.resource).id,C.name.toLowerCase())}),k},[r]),w=L.useMemo(()=>{if(!e)return[];if(!x.trim())return e;const k=x.trim().toLowerCase();return e.filter(C=>C.intent.toLowerCase().includes(k)?!0:C.agentDeployments.some(E=>{if(E.agentId.toLowerCase().includes(k))return!0;const D=_.get(E.agentId);return!!(D&&D.includes(k))}))},[e,x,_]);return d.jsxs("div",{className:"space-y-6","data-testid":"triggers-page",children:[d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-3 text-2xl font-bold text-foreground",children:[d.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-amber-500/10",children:d.jsx(nc,{className:"h-5 w-5 text-amber-500"})}),i("triggers.title","Agent Triggers")]}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i("triggers.subtitle","Map intents to agent deployments for automatic routing")})]}),d.jsxs(Yt,{onClick:()=>u(!0),className:"gap-2","data-testid":"create-trigger-btn",children:[d.jsx(Gt,{className:"h-4 w-4"}),i("triggers.create","New Trigger")]})]}),e&&e.length>0&&d.jsxs("div",{className:"relative",children:[d.jsx(br,{className:"absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:x,onChange:k=>v(k.target.value),placeholder:i("triggers.searchPlaceholder","Filter by intent or agent ID..."),className:"h-10 w-full rounded-lg border border-input bg-background ps-9 pe-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"trigger-search"})]}),t&&d.jsx("div",{className:"flex items-center justify-center py-16",children:d.jsx(xi,{className:"h-8 w-8 animate-spin text-primary"})}),n&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-destructive/30 bg-destructive/5 py-12",children:[d.jsx(Lo,{className:"h-10 w-10 text-destructive"}),d.jsx("p",{className:"mt-3 text-sm text-destructive",children:i("common.error")}),d.jsx("button",{onClick:()=>s(),className:"mt-3 text-xs text-primary hover:underline",children:i("common.retry")})]}),!t&&!n&&e&&d.jsx("div",{className:"space-y-3","data-testid":"trigger-list",children:w.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-dashed py-20 text-muted-foreground",children:[d.jsx(nc,{className:"h-12 w-12 opacity-30"}),d.jsx("p",{className:"mt-4 text-sm",children:x.trim()?i("common.noResults"):i("triggers.empty","No triggers configured yet")})]}):w.map(k=>d.jsx(ift,{trigger:k,onEdit:()=>g(k),onDelete:()=>m(k.intent)},k.intent))}),(c||h)&&d.jsx(sft,{initial:h,onClose:()=>{u(!1),g(null)},onSave:k=>{h?a.mutate({intent:h.intent,config:k},{onSuccess:()=>{ze.success(i("triggers.updated","Trigger updated")),g(null)},onError:C=>ze.error(C.message)}):o.mutate(k,{onSuccess:()=>{ze.success(i("triggers.created","Trigger created")),u(!1)},onError:C=>ze.error(C.message)})},isPending:o.isPending||a.isPending}),d.jsx(sl,{open:!!f,onOpenChange:()=>m(null),title:i("triggers.deleteTitle","Delete Trigger"),description:i("triggers.deleteDesc",'Permanently delete the trigger for intent "{{intent}}"?',{intent:f??""}),confirmLabel:i("common.delete"),variant:"destructive",onConfirm:()=>{f&&l.mutate(f,{onSuccess:()=>{ze.success(i("triggers.deleted","Trigger deleted")),m(null)},onError:k=>ze.error(k.message)})},isPending:l.isPending})]})}function ift({trigger:i,onEdit:e,onDelete:t}){const{t:n}=xe(),[s,r]=L.useState(!1);return d.jsxs("div",{className:"rounded-xl border border-border bg-card","data-testid":`trigger-${i.intent}`,children:[d.jsxs("div",{className:"flex items-center gap-3 px-5 py-4",children:[d.jsxs("button",{type:"button",className:"flex flex-1 items-center gap-3 cursor-pointer text-start",onClick:()=>r(!s),"aria-expanded":s,"aria-controls":`trigger-content-${i.intent}`,children:[d.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:s?d.jsx(Rn,{className:"h-4 w-4"}):d.jsx(hs,{className:"h-4 w-4"})}),d.jsx(nc,{className:"h-4 w-4 text-amber-500 shrink-0","aria-hidden":"true"}),d.jsx("span",{className:"flex-1 font-semibold text-sm text-foreground font-mono",children:i.intent}),d.jsxs("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary",children:[i.agentDeployments.length," ",n("triggers.agents","agents")]})]}),d.jsx("button",{type:"button",onClick:()=>e(),className:"rounded p-1.5 text-muted-foreground hover:text-foreground transition-colors",title:n("common.edit"),"aria-label":n("common.edit"),children:d.jsx(vHe,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),d.jsx("button",{type:"button",onClick:()=>t(),className:"rounded p-1.5 text-muted-foreground hover:text-destructive transition-colors",title:n("common.delete"),"aria-label":n("common.delete"),children:d.jsx(_n,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]}),s&&d.jsx("div",{id:`trigger-content-${i.intent}`,className:"border-t border-border px-5 py-3 space-y-2",children:i.agentDeployments.map((o,a)=>d.jsxs("div",{className:"flex items-center gap-3 rounded-lg bg-secondary/30 px-3 py-2",children:[d.jsx(ai,{className:"h-3.5 w-3.5 text-primary shrink-0","aria-hidden":"true"}),d.jsx("span",{className:"flex-1 text-xs font-mono text-foreground truncate",children:o.agentId}),d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:[d.jsx(rb,{className:"h-3 w-3","aria-hidden":"true"}),o.environment]})]},a))})]})}function sft({initial:i,onClose:e,onSave:t,isPending:n}){const{t:s}=xe(),[r,o]=L.useState((i==null?void 0:i.intent)??""),[a,l]=L.useState((i==null?void 0:i.agentDeployments)??[{environment:"production",agentId:""}]),c=L.useCallback(()=>{if(!r.trim())return;const h=a.filter(g=>g.agentId.trim());h.length!==0&&t({intent:r.trim(),agentDeployments:h})},[r,a,t]),u=i?s("triggers.editTitle","Edit Trigger"):s("triggers.createTitle","Create Trigger");return d.jsx(YM,{open:!0,onClose:e,title:u,testId:"trigger-dialog",maxWidth:"max-w-lg",children:d.jsxs("div",{className:"space-y-4 p-6",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"trigger-intent",className:"mb-1 block text-xs font-medium text-muted-foreground",children:s("triggers.intent","Intent")}),d.jsx("input",{id:"trigger-intent",type:"text",value:r,onChange:h=>o(h.target.value),readOnly:!!i,placeholder:"e.g. booking_request",className:"h-10 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground font-mono placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"trigger-intent-input",autoFocus:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:s("triggers.deployments","Agent Deployments")}),a.map((h,g)=>d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx(tft,{value:h.agentId,onChange:f=>{const m=[...a];m[g]={...h,agentId:f},l(m)},placeholder:s("triggers.agentId","Agent ID")}),d.jsx("select",{value:h.environment,onChange:f=>{const m=[...a];m[g]={...h,environment:f.target.value},l(m)},"aria-label":`${s("triggers.environment","Environment")} ${g+1}`,className:"h-9 rounded-md border border-input bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:Sj.map(f=>d.jsx("option",{value:f,children:f},f))}),d.jsx("button",{type:"button",onClick:()=>l(a.filter((f,m)=>m!==g)),className:"text-muted-foreground hover:text-destructive","aria-label":s("common.delete"),children:d.jsx(An,{className:"h-4 w-4","aria-hidden":"true"})})]},g)),d.jsxs("button",{type:"button",onClick:()=>l([...a,{environment:"production",agentId:""}]),className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[d.jsx(Gt,{className:"h-3 w-3","aria-hidden":"true"}),s("triggers.addDeployment","Add Agent")]})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[d.jsx(Yt,{variant:"secondary",onClick:e,size:"sm",children:s("common.cancel")}),d.jsx(Yt,{onClick:c,disabled:n||!r.trim(),size:"sm","data-testid":"trigger-save-btn",children:n?s("common.saving","Saving..."):s("common.save")})]})]})})}const DT=pke;function rft(){const{t:i}=xe(),[e,t]=L.useState(""),[n,s]=L.useState(""),[r,o]=L.useState("highest_confidence"),[a,l]=L.useState(null),c=zE(e.trim(),400),u=n||c,{data:h,isLoading:g,isError:f,refetch:m}=Hse(),{data:x,isLoading:v,isError:_,refetch:w}=fit(u,r),{registry:k,isLoading:C,isError:E,refetchMatches:D}=pit(),T=L.useMemo(()=>{if(!h)return[];if(!e.trim())return h;const R=e.trim().toLowerCase();return h.filter(P=>P.toLowerCase().includes(R))},[h,e]),I=L.useMemo(()=>{if(!e.trim())return k;const R=e.trim().toLowerCase();return k.filter(P=>P.skill.toLowerCase().includes(R))},[k,e]);return d.jsxs("div",{className:"space-y-6","data-testid":"capabilities-page",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"flex items-center gap-3 text-2xl font-bold text-foreground",children:[d.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-violet-500/10",children:d.jsx(Uf,{className:"h-5 w-5 text-violet-500"})}),i("capabilities.title","Capability Registry")]}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i("capabilities.subtitle","Discover agents by their declared skills and capabilities")})]}),d.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx(br,{className:"absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:e,onChange:R=>{t(R.target.value),s("")},placeholder:i("capabilities.searchPlaceholder","Search skills..."),className:"h-10 w-full rounded-lg border border-input bg-background ps-9 pe-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"capability-search"})]}),d.jsxs("select",{value:r,onChange:R=>o(R.target.value),className:"h-10 rounded-lg border border-input bg-background px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"capability-strategy",children:[d.jsx("option",{value:"highest_confidence",children:i("capabilities.strategyHighest","Highest Confidence")}),d.jsx("option",{value:"all",children:i("capabilities.strategyAll","All Matches")})]})]}),d.jsxs("section",{children:[d.jsxs("h2",{className:"mb-3 flex items-center gap-2 text-sm font-semibold text-foreground",children:[d.jsx(Uf,{className:"h-4 w-4 text-violet-500"}),i("capabilities.registryOverview","Registry Overview"),h&&d.jsxs("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-[10px] text-primary",children:[h.length," ",i("capabilities.skills","skills")]})]}),(g||C)&&d.jsx("div",{className:"flex items-center justify-center py-12",children:d.jsx(xi,{className:"h-6 w-6 animate-spin text-primary"})}),f&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-destructive/30 bg-destructive/5 py-8",children:[d.jsx(Lo,{className:"h-8 w-8 text-destructive"}),d.jsx("p",{className:"mt-2 text-sm text-destructive",children:i("common.error")}),d.jsx("button",{onClick:()=>m(),className:"mt-2 text-xs text-primary hover:underline",children:i("common.retry")})]}),!f&&E&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-amber-500/30 bg-amber-500/5 py-4",children:[d.jsx(Lo,{className:"h-6 w-6 text-amber-500"}),d.jsx("p",{className:"mt-1.5 text-xs text-amber-700 dark:text-amber-300",children:i("capabilities.partialError","Some skill queries failed")}),d.jsx("button",{onClick:()=>D(),className:"mt-1.5 text-xs text-primary hover:underline",children:i("common.retry")})]}),!g&&!C&&!f&&I.length>0&&d.jsxs("div",{className:"overflow-hidden rounded-xl border border-border","data-testid":"registry-table",children:[d.jsxs("div",{className:"grid grid-cols-[1fr_100px_120px] gap-2 border-b border-border bg-muted/50 px-4 py-2.5",children:[d.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("capabilities.skillName","Skill")}),d.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground text-center",children:i("capabilities.agentCount","Agents")}),d.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground text-center",children:i("capabilities.confidence","Confidence")})]}),I.map(R=>{const P=a===R.skill,j=R.matches.filter($=>$.confidence==="high").length,B=R.matches.filter($=>$.confidence==="medium").length,U=R.matches.filter($=>$.confidence==="low").length;return d.jsxs("div",{children:[d.jsxs("button",{type:"button",onClick:()=>l(P?null:R.skill),className:"grid w-full grid-cols-[1fr_100px_120px] gap-2 px-4 py-3 text-start transition-colors hover:bg-secondary/50","data-testid":`registry-row-${R.skill}`,children:[d.jsxs("div",{className:"flex items-center gap-2",children:[P?d.jsx(Rn,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):d.jsx(hs,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),d.jsx("span",{className:"text-xs font-medium text-foreground",children:R.skill})]}),d.jsx("div",{className:"flex items-center justify-center",children:d.jsx("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-[11px] font-semibold text-primary",children:R.matches.length})}),d.jsxs("div",{className:"flex items-center justify-center gap-1",children:[j>0&&d.jsxs("span",{className:be("rounded-full border px-1.5 py-0.5 text-[9px] font-semibold",DT.high),children:[j,"H"]}),B>0&&d.jsxs("span",{className:be("rounded-full border px-1.5 py-0.5 text-[9px] font-semibold",DT.medium),children:[B,"M"]}),U>0&&d.jsxs("span",{className:be("rounded-full border px-1.5 py-0.5 text-[9px] font-semibold",DT.low),children:[U,"L"]})]})]}),P&&d.jsx("div",{className:"border-t border-border bg-muted/30 px-4 py-3 space-y-2","data-testid":`registry-expanded-${R.skill}`,children:R.matches.length===0?d.jsx("p",{className:"text-xs text-muted-foreground",children:i("capabilities.noMatches","No agents found for this skill")}):R.matches.map(($,K)=>d.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-card p-2.5",children:[d.jsx(ai,{className:"h-4 w-4 text-primary shrink-0"}),d.jsxs(Kn,{to:`/manage/agentview/${$.agentId}`,className:"text-xs font-medium text-foreground hover:text-primary transition-colors flex items-center gap-1",children:[$.agentId,d.jsx(To,{className:"h-3 w-3 opacity-40"})]}),d.jsx("span",{className:be("rounded-full border px-2 py-0.5 text-[10px] font-semibold ms-auto",DT[$.confidence]??"bg-muted text-muted-foreground"),children:$.confidence}),$.attributes&&Object.keys($.attributes).length>0&&d.jsx("div",{className:"flex flex-wrap gap-1",children:Object.entries($.attributes).map(([z,G])=>d.jsxs("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:[z,"=",G]},z))})]},`${$.agentId}-${K}`))})]},R.skill)})]}),!g&&!C&&!f&&I.length===0&&e.trim()&&d.jsx("p",{className:"text-sm text-muted-foreground py-4",children:i("capabilities.noSkills","No skills found")})]}),d.jsxs("div",{children:[d.jsxs("h2",{className:"mb-3 flex items-center gap-2 text-sm font-semibold text-foreground",children:[d.jsx(KSe,{className:"h-4 w-4 text-primary"}),i("capabilities.registeredSkills","Registered Skills"),h&&d.jsx("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-[10px] text-primary",children:h.length})]}),!g&&!f&&h&&d.jsx("div",{className:"flex flex-wrap gap-2","data-testid":"skills-grid",children:T.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:i("capabilities.noSkills","No skills found")}):T.map(R=>d.jsx("button",{onClick:()=>{s(R),t(R)},className:be("rounded-full border px-3 py-1.5 text-xs font-medium transition-all",n===R?"border-primary bg-primary text-primary-foreground":"border-border bg-card text-foreground hover:border-primary/30 hover:bg-primary/5"),"data-testid":`skill-${R}`,children:R},R))})]}),u&&d.jsxs("div",{children:[d.jsxs("h2",{className:"mb-3 flex items-center gap-2 text-sm font-semibold text-foreground",children:[d.jsx(ai,{className:"h-4 w-4 text-primary"}),i("capabilities.matchingAgents","Matching Agents"),x&&d.jsx("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-[10px] text-primary",children:x.length})]}),v&&d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx(xi,{className:"h-6 w-6 animate-spin text-primary"})}),_&&d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-destructive/30 bg-destructive/5 py-8",children:[d.jsx(Lo,{className:"h-8 w-8 text-destructive"}),d.jsx("p",{className:"mt-2 text-sm text-destructive",children:i("common.error")}),d.jsx("button",{onClick:()=>w(),className:"mt-2 text-xs text-primary hover:underline",children:i("common.retry")})]}),!v&&!_&&x&&d.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"capability-results",children:x.length===0?d.jsx("p",{className:"col-span-full text-center py-8 text-sm text-muted-foreground",children:i("capabilities.noMatches","No agents found for this skill")}):x.map((R,P)=>d.jsxs("div",{className:"rounded-xl border border-border bg-card p-4 space-y-3 transition-colors hover:border-primary/20","data-testid":`match-${R.agentId}`,children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ai,{className:"h-4 w-4 text-primary"}),d.jsxs(Kn,{to:`/manage/agentview/${R.agentId}`,className:"text-sm font-medium text-foreground hover:text-primary transition-colors truncate flex items-center gap-1",children:[R.agentId,d.jsx(To,{className:"h-3 w-3 opacity-40"})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Uf,{className:"h-3.5 w-3.5 text-violet-500"}),d.jsx("span",{className:"text-xs text-foreground",children:R.skill})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Oie,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsx("span",{className:be("rounded-full border px-2 py-0.5 text-[10px] font-semibold",DT[R.confidence]??"bg-muted text-muted-foreground"),children:R.confidence})]}),R.attributes&&Object.keys(R.attributes).length>0&&d.jsx("div",{className:"flex flex-wrap gap-1",children:Object.entries(R.attributes).map(([j,B])=>d.jsxs("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:[j,"=",B]},j))})]},`${R.agentId}-${P}`))})]})]})}function oft(){var C;const{t:i}=xe(),[e,t]=L.useState(""),[n,s]=L.useState(""),[r,o]=L.useState([]),[a,l]=L.useState(null),{data:c}=I7(),u=L.useMemo(()=>Cg((c==null?void 0:c.pages.flat())??[]),[c]),h=Jet(),g=ttt();function f(E){const D=E.map(T=>{const{id:I,version:R}=w4(T.resource),P=u.find(j=>{var B,U;return((B=j.name)==null?void 0:B.toLowerCase())===((U=T.name)==null?void 0:U.toLowerCase())});return{remoteAgent:T,remoteId:I,remoteVersion:R,localTargetId:(P==null?void 0:P.id)||null,autoMatched:!!P,checked:!0,preview:null}});o(D),l(null)}function m(E,D){o(T=>T.map((I,R)=>R===E?{...I,...D}:I))}function x(){const E=r.filter(T=>T.checked);if(E.length===0)return;const D=E.map(T=>({sourceAgentId:T.remoteId,sourceAgentVersion:T.remoteVersion,targetAgentId:T.localTargetId}));h.mutate({sourceUrl:e,mappings:D,sourceAuth:n},{onSuccess:T=>{o(I=>I.map(R=>{if(!R.checked)return R;const P=T.find(j=>j.sourceAgentId===R.remoteId);return P?{...R,preview:P}:R}))}})}function v(){const E=r.filter(T=>T.checked&&T.preview);if(E.length===0)return;const D=E.map(T=>({sourceAgentId:T.remoteId,sourceAgentVersion:T.remoteVersion,targetAgentId:T.localTargetId,selectedResources:null,workflowOrder:null}));g.mutate({sourceUrl:e,requests:D,sourceAuth:n},{onSuccess:()=>{o(T=>T.map(I=>({...I,preview:null})))}})}const _=r.filter(E=>E.checked).length,w=r.some(E=>E.checked&&E.preview),k=r.filter(E=>E.checked&&E.preview).reduce((E,D)=>{var T;return E+(((T=D.preview)==null?void 0:T.resources.length)??0)},0);return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold text-foreground",children:i("syncPage.title","Agent Sync")}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i("syncPage.subtitle","Synchronize agents between EDDI instances")})]}),d.jsxs("section",{className:"rounded-xl border bg-card p-5 shadow-sm",children:[d.jsxs("h2",{className:"text-lg font-semibold text-foreground mb-4 flex items-center gap-2",children:[d.jsx(fN,{className:"h-5 w-5 text-primary"}),i("syncPage.connection","Source Instance")]}),d.jsx(TEe,{url:e,auth:n,onUrlChange:t,onAuthChange:s,onConnected:f})]}),r.length>0&&d.jsxs("section",{className:"rounded-xl border bg-card shadow-sm",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border p-5",children:[d.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[d.jsx(xi,{className:"h-5 w-5 text-primary"}),i("syncPage.agentMapping","Agent Mapping"),d.jsx("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:r.length})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(Yt,{variant:"secondary",onClick:x,disabled:h.isPending||_===0,"data-testid":"sync-preview-all",children:[h.isPending&&d.jsx(ni,{className:"h-4 w-4 animate-spin"}),i("syncPage.previewAll","Preview All")]}),d.jsxs(Yt,{onClick:v,disabled:g.isPending||!w,"data-testid":"sync-execute-btn",title:w?"":i("syncPage.previewFirst","Preview changes before syncing"),children:[g.isPending&&d.jsx(ni,{className:"h-4 w-4 animate-spin"}),i("syncPage.syncSelected","Sync Selected")]})]})]}),d.jsx("div",{className:"divide-y divide-border",children:r.map((E,D)=>d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-4 px-5 py-3",children:[d.jsx("input",{type:"checkbox",checked:E.checked,onChange:()=>m(D,{checked:!E.checked}),className:"accent-primary"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:E.remoteAgent.name||E.remoteId}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:[i("syncPage.remote","Remote"),E.remoteVersion!=null&&` · v${E.remoteVersion}`,E.autoMatched&&d.jsxs("span",{className:"inline-flex items-center gap-0.5 ms-1.5 text-amber-500",children:[d.jsx(Ll,{className:"h-3 w-3"}),i("syncPage.autoMatched","auto-matched")]})]})]}),d.jsx(fN,{className:"h-4 w-4 text-muted-foreground shrink-0"}),d.jsx("div",{className:"flex-1",children:d.jsxs("select",{value:E.localTargetId||"",onChange:T=>m(D,{localTargetId:T.target.value||null,preview:null}),className:"w-full rounded-lg border border-input bg-background px-2 py-1.5 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",children:[d.jsx("option",{value:"",children:i("syncPage.createNew","Create new")}),u.map(T=>d.jsxs("option",{value:T.id,children:[T.name||T.id," (v",T.version,")"]},T.id))]})}),d.jsx("div",{className:"shrink-0 w-24 text-end",children:E.preview&&d.jsxs("button",{onClick:()=>l(a===E.remoteId?null:E.remoteId),className:"inline-flex items-center gap-1 text-xs text-primary hover:text-primary/80",children:[E.preview.resources.filter(T=>T.action!=="SKIP").length," ",i("syncPage.changes","changes"),a===E.remoteId?d.jsx(Rn,{className:"h-3 w-3"}):d.jsx(hs,{className:"h-3 w-3"})]})})]}),a===E.remoteId&&E.preview&&d.jsx(aft,{preview:E.preview})]},E.remoteId))}),d.jsxs("div",{className:"border-t border-border px-5 py-3 flex items-center justify-between text-xs text-muted-foreground",children:[d.jsxs("span",{children:[_," ",i("syncPage.agentsSelected","agents selected")," ·"," ",k," ",i("syncPage.totalResources","resources")]}),g.isSuccess&&d.jsxs("span",{className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400",children:[d.jsx(Rie,{className:"h-3.5 w-3.5"}),i("syncPage.syncSuccess","Sync complete")]}),g.isError&&d.jsxs("span",{className:"inline-flex items-center gap-1 text-destructive",children:[d.jsx(Lo,{className:"h-3.5 w-3.5"}),((C=g.error)==null?void 0:C.message)||i("syncPage.syncError","Sync failed")]})]})]}),r.length===0&&d.jsxs("section",{className:"rounded-xl border bg-card p-12 text-center shadow-sm",children:[d.jsx(fN,{className:"h-12 w-12 text-muted-foreground/50 mx-auto"}),d.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:i("syncPage.empty","Connect to a source instance to begin syncing agents.")})]})]})}function aft({preview:i}){const{t:e}=xe(),[t,n]=L.useState(null);return d.jsx("div",{className:"bg-secondary/20 px-5 pb-4",children:d.jsx("div",{className:"overflow-auto rounded-lg border max-h-64",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"sticky top-0 bg-secondary/80 backdrop-blur-sm",children:d.jsxs("tr",{children:[d.jsx("th",{className:"px-3 py-1.5 text-start text-xs font-medium text-muted-foreground uppercase",children:e("importDialog.resource","Resource")}),d.jsx("th",{className:"px-3 py-1.5 text-start text-xs font-medium text-muted-foreground uppercase",children:e("importDialog.type","Type")}),d.jsx("th",{className:"px-3 py-1.5 text-start text-xs font-medium text-muted-foreground uppercase",children:e("importDialog.action","Action")}),d.jsx("th",{className:"px-3 py-1.5 w-8"})]})}),d.jsx("tbody",{className:"divide-y divide-border",children:i.resources.map(s=>{const r=s.action==="UPDATE"&&(s.sourceContent||s.targetContent),o=t===s.sourceId;return d.jsxs(L.Fragment,{children:[d.jsxs("tr",{className:"group",children:[d.jsx("td",{className:"px-3 py-1.5 font-medium text-foreground",children:d.jsx("span",{className:s.action==="SKIP"?"opacity-50":"",children:s.name||s.sourceId.substring(0,12)})}),d.jsx("td",{className:"px-3 py-1.5",children:d.jsx(Ase,{type:s.resourceType})}),d.jsx("td",{className:"px-3 py-1.5",children:d.jsx(IEe,{action:s.action})}),d.jsx("td",{className:"px-3 py-1.5",children:r&&d.jsx("button",{onClick:()=>n(o?null:s.sourceId),className:"rounded p-0.5 text-muted-foreground hover:text-foreground",children:o?d.jsx(Rn,{className:"h-4 w-4"}):d.jsx(hs,{className:"h-4 w-4"})})})]}),o&&r&&d.jsx("tr",{children:d.jsx("td",{colSpan:4,className:"px-3 py-2",children:d.jsx(AEe,{sourceContent:s.sourceContent,targetContent:s.targetContent})})})]},s.sourceId)})})]})})})}const $f=L.forwardRef(({className:i,type:e,...t},n)=>d.jsx("input",{type:e,className:be("flex h-10 w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground ring-offset-background transition-shadow","placeholder:text-muted-foreground","focus:outline-none focus:ring-2 focus:ring-primary/50 focus:ring-offset-0","disabled:cursor-not-allowed disabled:opacity-50","file:border-0 file:bg-transparent file:text-sm file:font-medium",i),ref:n,...t}));$f.displayName="Input";function lft({className:i}){return d.jsx("svg",{className:i,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:d.jsx("path",{d:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.163 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.163 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.163 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1-2.52-2.523 2.527 2.527 0 0 1 2.52-2.52h6.315A2.528 2.528 0 0 1 24 15.163a2.528 2.528 0 0 1-2.522 2.523h-6.315z"})})}const ZU={slack:d.jsx(lft,{className:"h-4 w-4"})},cft={slack:"bg-[#4A154B]/10 text-[#4A154B] dark:bg-[#E01E5A]/10 dark:text-[#E01E5A]"};function dft({channel:i,onDelete:e,onDuplicate:t}){const{t:n}=xe(),s=il(),r=i.channelType?i.channelType.charAt(0).toUpperCase()+i.channelType.slice(1):"Unknown";return d.jsxs("div",{"data-testid":`channel-card-${i.id}`,className:"group relative flex flex-col gap-3 rounded-xl border border-border/50 bg-card p-5 transition-all hover:border-primary/30 hover:shadow-lg hover:shadow-primary/5 cursor-pointer",onClick:()=>s(`/manage/channels/${i.id}?version=${i.version}`),role:"button",tabIndex:0,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),s(`/manage/channels/${i.id}?version=${i.version}`))},children:[d.jsxs("div",{className:"flex items-start justify-between gap-2",children:[d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:ZU[i.channelType]??d.jsx(vb,{className:"h-5 w-5"})}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("h3",{className:"font-semibold text-foreground truncate leading-tight",children:i.name||n("channels.unnamed","Unnamed Channel")}),i.channelId&&d.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground mt-0.5",children:[d.jsx(Zf,{className:"h-3 w-3"}),d.jsx("span",{className:"font-mono truncate",children:i.channelId})]})]})]}),d.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[d.jsx(Yt,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o=>{o.stopPropagation(),t(i.id,i.version)},title:n("common.duplicate"),children:d.jsx(mo,{className:"h-3.5 w-3.5"})}),d.jsx(Yt,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:o=>{o.stopPropagation(),e(i.id,i.version)},title:n("common.delete"),children:d.jsx(_n,{className:"h-3.5 w-3.5"})})]})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[d.jsxs(Fi,{variant:"outline",className:`text-xs ${cft[i.channelType]??""}`,children:[ZU[i.channelType]&&d.jsx("span",{className:"me-1 inline-flex",children:ZU[i.channelType]}),r]}),d.jsxs(Fi,{variant:"secondary",className:"text-xs gap-1",children:[d.jsx(ai,{className:"h-3 w-3"}),i.targetCount," ",i.targetCount===1?n("channels.target","target"):n("channels.targets","targets")]})]}),d.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground pt-1 border-t border-border/30",children:[d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(ga,{className:"h-3 w-3"}),"v",i.version]}),d.jsx("span",{children:new Date(i.lastModifiedOn).toLocaleDateString()})]})]})}const eTe=["slack"];function uft(i=20,e=0,t=""){const n=new URLSearchParams({limit:String(i),index:String(e)});return t&&n.set("filter",t),Oe.get(`/channelstore/channels/descriptors?${n.toString()}`)}function tTe(i,e){const t=e!==void 0?`?version=${e}`:"";return Oe.get(`/channelstore/channels/${i}${t}`)}function hft(i){return Oe.post("/channelstore/channels",i)}function gft(i,e,t){return Oe.put(`/channelstore/channels/${i}?version=${e}`,t)}function fft(i,e,t=!0){const n=new URLSearchParams({version:String(e),permanent:String(t)});return Oe.delete(`/channelstore/channels/${i}?${n}`)}function pft(i,e){return Oe.post(`/channelstore/channels/${i}?version=${e}`)}function nTe(i){const e=i.startsWith("eddi://")?i.replace("eddi://","http://"):i,t=new URL(e,"http://dummy"),n=t.pathname.split("/").filter(Boolean),s=n[n.length-1]??i,r=parseInt(t.searchParams.get("version")||"1",10),o=isNaN(r)?1:r;return{id:s,version:o}}async function mft(i=20,e=0,t=""){const n=await uft(i,e,t),s=new Map;for(const r of n){const{id:o,version:a}=nTe(r.resource),l=s.get(o);(!l||a>l.version)&&s.set(o,{...r,id:o,version:a})}return Promise.all(Array.from(s.values()).sort((r,o)=>o.lastModifiedOn-r.lastModifiedOn).map(async r=>{var o,a;try{const l=await tTe(r.id,r.version);return{...r,name:l.name||r.name,channelType:l.channelType,targetCount:((o=l.targets)==null?void 0:o.length)??0,channelId:(a=l.platformConfig)==null?void 0:a.channelId}}catch{return{...r,channelType:"unknown",targetCount:0}}}))}function bft(i=""){return{name:"default",type:"AGENT",targetId:i,triggers:[],observeMode:!1,observeConfig:null}}const YL=["channels"];function xft(i=20,e=0,t=""){return hn({queryKey:[...YL,"enriched",{limit:i,index:e,filter:t}],queryFn:()=>mft(i,e,t)})}function vft(i,e){return hn({queryKey:[...YL,i,e],queryFn:()=>tTe(i,e),enabled:!!i})}function _ft(){const i=cn();return Kt({mutationFn:e=>hft(e),onSuccess:()=>{i.invalidateQueries({queryKey:YL})}})}function yft(){const i=cn();return Kt({mutationFn:({id:e,version:t,config:n})=>gft(e,t,n),onSuccess:()=>{i.invalidateQueries({queryKey:YL})}})}function iTe(){const i=cn();return Kt({mutationFn:({id:e,version:t,permanent:n})=>fft(e,t,n),onSuccess:()=>{i.invalidateQueries({queryKey:YL})}})}function wft(){const i=cn();return Kt({mutationFn:({id:e,version:t})=>pft(e,t),onSuccess:()=>{i.invalidateQueries({queryKey:YL})}})}const FS=["type","credentials","target"];function Cft({open:i,onOpenChange:e,onCreated:t,defaultAgentId:n}){const{t:s}=xe(),r=_ft(),[o,a]=L.useState("type"),[l,c]=L.useState(""),[u,h]=L.useState("slack"),[g,f]=L.useState(""),[m,x]=L.useState(""),[v,_]=L.useState(""),[w,k]=L.useState(n??""),C=L.useCallback(()=>{a("type"),c(""),h("slack"),f(""),x(""),_(""),k(n??"")},[n]),E=FS.indexOf(o),D=E===0,T=E===FS.length-1,I=()=>{switch(o){case"type":return l.trim().length>0;case"credentials":return g.trim().length>0;case"target":return w.trim().length>0}},R=()=>{T||a(FS[E+1])},P=()=>{D||a(FS[E-1])},j=async()=>{const B={name:l.trim(),channelType:u,platformConfig:{channelId:g.trim(),botToken:m.trim(),signingSecret:v.trim()},targets:[bft(w.trim())],defaultTargetName:"default"};try{const U=await r.mutateAsync(B),K=((U==null?void 0:U.location)??"").match(/channels\/([^?]+)/),z=(K==null?void 0:K[1])??"";t==null||t(z),e(!1),C()}catch(U){ze.error(Vs(U))}};return i?d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",onKeyDown:B=>{B.key==="Escape"&&(C(),e(!1))},children:[d.jsx("div",{className:"fixed inset-0 bg-black/50",onClick:()=>{C(),e(!1)}}),d.jsxs("div",{className:"relative z-50 w-full max-w-lg rounded-2xl border border-border bg-card p-6 shadow-2xl mx-4",role:"dialog","aria-modal":"true",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[d.jsx(vb,{className:"h-5 w-5 text-primary"}),d.jsx("h2",{className:"text-lg font-semibold",children:s("channels.createTitle","Create Channel Integration")})]}),d.jsx("div",{className:"flex items-center justify-center gap-2 py-2 mb-4",children:FS.map((B,U)=>d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:`h-2 w-2 rounded-full transition-colors ${U<=E?"bg-primary":"bg-muted"}`}),Uc(B.target.value),placeholder:s("channels.namePlaceholder","e.g. Engineering AI Hub"),autoFocus:!0})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-foreground",children:s("channels.channelType","Channel Type")}),d.jsx("select",{"data-testid":"create-channel-type",className:"flex h-9 w-full rounded-lg border border-border bg-background px-3 py-1 text-sm text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary",value:u,onChange:B=>h(B.target.value),children:eTe.map(B=>d.jsx("option",{value:B,children:B.charAt(0).toUpperCase()+B.slice(1)},B))})]})]}),o==="credentials"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-foreground",htmlFor:"create-channel-id",children:s("channels.channelId","Slack Channel ID")}),d.jsx($f,{id:"create-channel-id","data-testid":"create-channel-id",value:g,onChange:B=>f(B.target.value),placeholder:"C0123ABCDEF",autoFocus:!0}),d.jsx("p",{className:"text-xs text-muted-foreground",children:s("channels.channelIdHint","Right-click a Slack channel → View channel details → copy the Channel ID")})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-foreground",children:s("channels.botToken","Bot Token")}),d.jsx(Rd,{value:m,onChange:x,placeholder:s("channels.botTokenPlaceholder","xoxb-… or ${vault:slack-bot-token}")}),d.jsx("p",{className:"text-xs text-muted-foreground",children:s("channels.botTokenHint","Bot User OAuth Token. Use a vault reference for security.")})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-foreground",children:s("channels.signingSecret","Signing Secret")}),d.jsx(Rd,{value:v,onChange:_,placeholder:s("channels.signingSecretPlaceholder","Hex string or ${vault:slack-signing-secret}")}),d.jsx("p",{className:"text-xs text-muted-foreground",children:s("channels.signingSecretHint","From your Slack App's Basic Information page.")})]})]}),o==="target"&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 dark:border-amber-800 dark:bg-amber-950/30",children:d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx(Lo,{className:"h-4 w-4 text-amber-600 dark:text-amber-400 mt-0.5 shrink-0"}),d.jsx("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:s("channels.defaultTargetHint","The default target handles all messages that don't match a trigger keyword. You can add more targets after creation.")})]})}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-foreground",htmlFor:"create-target-agent",children:s("channels.defaultAgentId","Default Agent ID")}),d.jsx($f,{id:"create-target-agent","data-testid":"create-target-agent",value:w,onChange:B=>k(B.target.value),placeholder:s("channels.agentIdPlaceholder","Agent ID to handle messages"),autoFocus:!0})]})]})]}),d.jsxs("div",{className:"flex justify-between mt-6",children:[d.jsxs(Yt,{variant:"outline",onClick:P,disabled:D,className:D?"invisible":"",children:[d.jsx(kSe,{className:"h-4 w-4 me-1"})," ",s("common.back","Back")]}),T?d.jsx(Yt,{onClick:j,disabled:!I()||r.isPending,"data-testid":"create-channel-submit",children:r.isPending?s("common.saving","Creating..."):s("channels.create","Create Channel")}):d.jsxs(Yt,{onClick:R,disabled:!I(),"data-testid":"create-channel-next",children:[s("common.next","Next")," ",d.jsx(hs,{className:"h-4 w-4 ms-1"})]})]})]})]}):null}function Sft(){const{t:i}=xe(),e=il(),[t,n]=L.useState(""),[s,r]=L.useState("card"),[o,a]=L.useState(!1),[l,c]=L.useState(null),{data:u,isLoading:h}=xft(),g=iTe(),f=wft(),m=L.useMemo(()=>{if(!u)return[];if(!t.trim())return u;const w=t.toLowerCase();return u.filter(k=>{var C,E,D;return((C=k.name)==null?void 0:C.toLowerCase().includes(w))||((E=k.channelId)==null?void 0:E.toLowerCase().includes(w))||((D=k.channelType)==null?void 0:D.toLowerCase().includes(w))})},[u,t]),x=(w,k)=>{c({id:w,version:k})},v=async()=>{l&&(await g.mutateAsync({id:l.id,version:l.version}),c(null))},_=(w,k)=>{f.mutate({id:w,version:k})};return d.jsxs("div",{className:"flex flex-col gap-6 p-6",children:[d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[d.jsx(vb,{className:"h-6 w-6 text-primary"}),i("pages.channels.title","Channels")]}),d.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:i("pages.channels.subtitle","Connect agents and groups to messaging platforms like Slack")})]}),d.jsxs(Yt,{onClick:()=>a(!0),"data-testid":"create-channel-btn",className:"gap-2",children:[d.jsx(Gt,{className:"h-4 w-4"}),i("channels.create","Create Channel")]})]}),d.jsx("div",{className:"rounded-xl border border-primary/20 bg-primary/5 p-4",children:d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-[#4A154B] text-white",children:d.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5",children:d.jsx("path",{d:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.163 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.163 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.163 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1-2.52-2.523 2.527 2.527 0 0 1 2.52-2.52h6.315A2.528 2.528 0 0 1 24 15.163a2.528 2.528 0 0 1-2.522 2.523h-6.315z"})})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h3",{className:"font-semibold text-sm",children:i("channels.slackSetupGuide","Slack Setup Guide")}),d.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("channels.slackSetupSummary","Create a Slack App, configure Bot Token Scopes (app_mentions:read, chat:write, im:history, channels:history, groups:history), then paste credentials here.")}),d.jsxs("a",{href:"https://api.slack.com/apps",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline mt-1",children:[i("channels.openSlackApps","Open Slack App Dashboard"),d.jsx(To,{className:"h-3 w-3"})]})]})]})}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("div",{className:"relative flex-1 max-w-sm",children:[d.jsx(br,{className:"absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx($f,{"data-testid":"channel-search",className:"ps-9",placeholder:i("channels.searchPlaceholder","Search channels..."),value:t,onChange:w=>n(w.target.value)})]}),u&&d.jsxs(Fi,{variant:"secondary",className:"text-xs",children:[m.length," ",m.length===1?i("channels.channel","channel"):i("channels.channelsPlural","channels")]}),d.jsx("div",{className:"ms-auto",children:d.jsx(zL,{view:s,onChange:r})})]}),h?d.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Array.from({length:3}).map((w,k)=>d.jsx("div",{className:"h-40 rounded-xl border border-border/50 bg-card animate-pulse"},k))}):m.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-4 text-center",children:[d.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-muted",children:d.jsx(vb,{className:"h-8 w-8 text-muted-foreground"})}),d.jsxs("div",{children:[d.jsx("p",{className:"font-medium text-foreground",children:t?i("common.noResults"):i("channels.empty","No channels yet")}),d.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:i("channels.emptyDesc","Create a channel integration to connect agents to Slack.")})]}),!t&&d.jsxs(Yt,{onClick:()=>a(!0),className:"gap-2",children:[d.jsx(Gt,{className:"h-4 w-4"}),i("channels.create","Create Channel")]})]}):s==="card"?d.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:m.map(w=>d.jsx(dft,{channel:w,onDelete:x,onDuplicate:_},w.id))}):d.jsx("div",{className:"rounded-xl border border-border/50 overflow-hidden",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b bg-muted/50",children:[d.jsx("th",{className:"text-start px-4 py-3 font-medium",children:i("channels.name","Name")}),d.jsx("th",{className:"text-start px-4 py-3 font-medium",children:i("channels.type","Type")}),d.jsx("th",{className:"text-start px-4 py-3 font-medium",children:i("channels.channelIdCol","Channel ID")}),d.jsx("th",{className:"text-start px-4 py-3 font-medium",children:i("channels.targetsCol","Targets")}),d.jsx("th",{className:"text-end px-4 py-3 font-medium",children:i("channels.version","Version")})]})}),d.jsx("tbody",{children:m.map(w=>d.jsxs("tr",{className:"border-b border-border/30 hover:bg-muted/30 cursor-pointer transition-colors",onClick:()=>e(`/manage/channels/${w.id}?version=${w.version}`),"data-testid":`channel-row-${w.id}`,children:[d.jsx("td",{className:"px-4 py-3 font-medium",children:w.name}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(Fi,{variant:"outline",className:"text-xs",children:w.channelType})}),d.jsx("td",{className:"px-4 py-3 font-mono text-xs text-muted-foreground",children:w.channelId??"—"}),d.jsx("td",{className:"px-4 py-3",children:w.targetCount}),d.jsxs("td",{className:"px-4 py-3 text-end",children:["v",w.version]})]},w.id))})]})}),d.jsx(Cft,{open:o,onOpenChange:a,onCreated:w=>e(`/manage/channels/${w}?version=1`)}),d.jsx(sl,{open:!!l,onOpenChange:()=>c(null),title:i("channels.confirmDelete","Delete channel?"),description:i("channels.confirmDeleteDesc","This will permanently remove this channel integration."),onConfirm:v,confirmLabel:i("common.delete"),cancelLabel:i("common.cancel"),isPending:g.isPending})]})}function kft({target:i,index:e,isDefault:t,onUpdate:n,onRemove:s,onSetDefault:r}){const{t:o}=xe(),[a,l]=L.useState(""),[c,u]=L.useState(!0),h=()=>{const g=a.trim().toLowerCase();g&&!i.triggers.includes(g)&&g!=="help"&&(n({...i,triggers:[...i.triggers,g]}),l(""))};return d.jsxs("div",{"data-testid":`target-card-${e}`,className:"rounded-xl border border-border/50 bg-card overflow-hidden",children:[d.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 bg-muted/30 cursor-pointer",onClick:()=>u(!c),children:[d.jsx("div",{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg ${i.type==="GROUP"?"bg-violet-100 text-violet-600 dark:bg-violet-900/30 dark:text-violet-400":"bg-primary/10 text-primary"}`,children:i.type==="GROUP"?d.jsx(ga,{className:"h-4 w-4"}):d.jsx(ai,{className:"h-4 w-4"})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx("span",{className:"font-medium text-sm truncate",children:i.name||`Target ${e+1}`})}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[t&&d.jsx(Fi,{className:"text-xs bg-primary/10 text-primary border-primary/20",children:o("channelDetail.isDefault","default")}),i.triggers.length>0&&d.jsxs(Fi,{variant:"secondary",className:"text-xs",children:[i.triggers.length," ",o("channelDetail.triggers","triggers")]}),c?d.jsx(Y_,{className:"h-4 w-4 text-muted-foreground"}):d.jsx(Rn,{className:"h-4 w-4 text-muted-foreground"})]})]}),c&&d.jsxs("div",{className:"p-4 space-y-4 border-t border-border/30",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"text-xs font-medium",children:o("channelDetail.targetName","Name")}),d.jsx($f,{"data-testid":`target-name-${e}`,className:"h-8 text-sm",value:i.name,onChange:g=>n({...i,name:g.target.value}),placeholder:"e.g. support"})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"text-xs font-medium",children:o("channelDetail.targetType","Type")}),d.jsxs("select",{className:"flex h-8 w-full rounded-lg border border-border bg-background px-2 text-sm",value:i.type,onChange:g=>n({...i,type:g.target.value}),children:[d.jsx("option",{value:"AGENT",children:"Agent"}),d.jsx("option",{value:"GROUP",children:"Group"})]})]})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"text-xs font-medium",children:i.type==="GROUP"?o("channelDetail.groupId","Group ID"):o("channelDetail.agentId","Agent ID")}),d.jsx($f,{"data-testid":`target-id-${e}`,className:"h-8 text-sm",value:i.targetId,onChange:g=>n({...i,targetId:g.target.value})})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"text-xs font-medium",children:o("channelDetail.triggerKeywords","Trigger Keywords")}),d.jsx("p",{className:"text-xs text-muted-foreground",children:o("channelDetail.triggerHint",'Users type "keyword: message" to route to this target')}),d.jsx("div",{className:"flex gap-1.5 flex-wrap",children:i.triggers.map(g=>d.jsxs(Fi,{variant:"secondary",className:"text-xs gap-1 font-mono",children:[g,":",d.jsx("button",{"aria-label":`Remove ${g}`,onClick:()=>n({...i,triggers:i.triggers.filter(f=>f!==g)}),className:"hover:text-destructive",children:d.jsx(An,{className:"h-3 w-3"})})]},g))}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx($f,{className:"h-7 text-xs",value:a,onChange:g=>l(g.target.value),placeholder:o("channelDetail.addTrigger","Add trigger..."),onKeyDown:g=>g.key==="Enter"&&(g.preventDefault(),h())}),d.jsx(Yt,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:h,children:o("common.add","Add")})]})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border/30",children:[!t&&d.jsxs(Yt,{variant:"outline",size:"sm",className:"text-xs gap-1",onClick:r,children:[d.jsx(yj,{className:"h-3 w-3"}),o("channelDetail.setDefault","Set as Default")]}),d.jsxs(Yt,{variant:"ghost",size:"sm",className:"text-xs text-destructive hover:text-destructive ms-auto gap-1",onClick:s,children:[d.jsx(_n,{className:"h-3 w-3"}),o("channelDetail.removeTarget","Remove")]})]})]})]})}function Nft(){const{t:i}=xe(),{id:e}=K_(),[t,n]=G_(),s=il(),r=Number(t.get("version")??"1"),o=Number.isFinite(r)?r:1,{data:a,isLoading:l}=vft(e,o),c=yft(),u=iTe(),[h,g]=L.useState(null),[f,m]=L.useState(!1),[x,v]=L.useState(!1),[_,w]=L.useState(!1);L.useEffect(()=>{a&&g({...a})},[a]);const k=`${window.location.origin}/integrations/slack/events`,C=async()=>{if(!h||!e)return;const j=await c.mutateAsync({id:e,version:o,config:h}),B=j==null?void 0:j.location;if(B){const{version:U}=nTe(B);n({version:String(U)},{replace:!0})}},E=async()=>{e&&(await u.mutateAsync({id:e,version:o}),s("/manage/channels"))},D=L.useCallback((j,B)=>{g(U=>{if(!U)return U;const $=[...U.targets];return $[j]=B,{...U,targets:$}})},[]),T=L.useCallback(j=>{g(B=>{var z;if(!B)return B;const U=B.targets[j],$=B.targets.filter((G,ne)=>ne!==j);let{defaultTargetName:K}=B;return U&&U.name===K&&(K=((z=$[0])==null?void 0:z.name)??""),{...B,targets:$,defaultTargetName:K}})},[]),I=L.useCallback(j=>{g(B=>B&&{...B,defaultTargetName:j})},[]),R=L.useCallback(()=>{g(j=>{if(!j)return j;const B={name:"",type:"AGENT",targetId:"",triggers:[],observeMode:!1,observeConfig:null};return{...j,targets:[...j.targets,B]}})},[]),P=async()=>{await navigator.clipboard.writeText(k),w(!0),setTimeout(()=>w(!1),2e3)};return l||!h?d.jsxs("div",{className:"p-6 space-y-6",children:[d.jsx("div",{className:"h-8 w-48 bg-muted rounded animate-pulse"}),d.jsx("div",{className:"h-64 bg-muted rounded-xl animate-pulse"})]}):d.jsxs("div",{className:"flex flex-col gap-6 p-6 max-w-4xl",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Yt,{variant:"ghost",size:"icon",onClick:()=>s("/manage/channels"),children:d.jsx(El,{className:"h-4 w-4"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h1",{className:"text-xl font-bold tracking-tight truncate",children:h.name||"Untitled Channel"}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["v",o," · ",h.channelType]})]}),d.jsxs(Yt,{variant:"outline",size:"sm",className:"text-destructive",onClick:()=>m(!0),"data-testid":"delete-channel-btn",children:[d.jsx(_n,{className:"h-4 w-4 me-1"})," ",i("common.delete")]}),d.jsxs(Yt,{size:"sm",onClick:C,disabled:c.isPending,"data-testid":"save-channel-btn",children:[d.jsx(u7,{className:"h-4 w-4 me-1"})," ",c.isPending?i("common.saving"):i("common.save")]})]}),d.jsxs("section",{className:"rounded-xl border border-border/50 p-5 space-y-4",children:[d.jsxs("h2",{className:"text-sm font-semibold flex items-center gap-2",children:[d.jsx(vb,{className:"h-4 w-4 text-primary"}),i("channelDetail.general","General")]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"text-xs font-medium",children:i("channelDetail.name","Name")}),d.jsx($f,{"data-testid":"channel-name-input",value:h.name,onChange:j=>g({...h,name:j.target.value})})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"text-xs font-medium",children:i("channelDetail.type","Channel Type")}),d.jsx("select",{"data-testid":"channel-type-select",className:"flex h-9 w-full rounded-lg border border-border bg-background px-3 text-sm",value:h.channelType,onChange:j=>g({...h,channelType:j.target.value}),children:eTe.map(j=>d.jsx("option",{value:j,children:j.charAt(0).toUpperCase()+j.slice(1)},j))})]})]})]}),d.jsxs("section",{className:"rounded-xl border border-border/50 p-5 space-y-4",children:[d.jsxs("h2",{className:"text-sm font-semibold flex items-center gap-2",children:[d.jsx(Zf,{className:"h-4 w-4 text-primary"}),i("channelDetail.platformConfig","Platform Configuration")]}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"text-xs font-medium",children:i("channelDetail.channelId","Slack Channel ID")}),d.jsx($f,{"data-testid":"channel-id-input",value:h.platformConfig.channelId??"",onChange:j=>g({...h,platformConfig:{...h.platformConfig,channelId:j.target.value}}),placeholder:"C0123ABCDEF"})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"text-xs font-medium",children:i("channelDetail.botToken","Bot Token")}),d.jsx(Rd,{value:h.platformConfig.botToken??"",onChange:j=>g({...h,platformConfig:{...h.platformConfig,botToken:j}}),placeholder:"xoxb-… or ${vault:slack-bot-token}"})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"text-xs font-medium",children:i("channelDetail.signingSecret","Signing Secret")}),d.jsx(Rd,{value:h.platformConfig.signingSecret??"",onChange:j=>g({...h,platformConfig:{...h.platformConfig,signingSecret:j}}),placeholder:"${vault:slack-signing-secret}"})]})]})]}),d.jsxs("section",{className:"rounded-xl border border-primary/20 bg-primary/5 p-5 space-y-3",children:[d.jsxs("h2",{className:"text-sm font-semibold flex items-center gap-2",children:[d.jsx(To,{className:"h-4 w-4 text-primary"}),i("channelDetail.webhookUrl","Webhook URL")]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:i("channelDetail.webhookHint","Paste this URL into your Slack App's Event Subscriptions → Request URL field.")}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("code",{className:"flex-1 rounded-lg bg-background border border-border px-3 py-2 text-xs font-mono truncate",children:k}),d.jsxs(Yt,{size:"sm",variant:"outline",className:"gap-1 shrink-0",onClick:P,children:[_?d.jsx(Ns,{className:"h-3.5 w-3.5 text-green-500"}):d.jsx(mo,{className:"h-3.5 w-3.5"}),i(_?"common.copied":"common.copy")]})]}),d.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[d.jsx("p",{className:"font-medium",children:i("channelDetail.requiredScopes","Required Bot Token Scopes:")}),d.jsx("div",{className:"flex flex-wrap gap-1",children:["app_mentions:read","chat:write","im:history","channels:history","groups:history"].map(j=>d.jsx(Fi,{variant:"outline",className:"text-xs font-mono",children:j},j))}),d.jsx("p",{className:"font-medium mt-2",children:i("channelDetail.requiredEvents","Required Event Subscriptions:")}),d.jsx("div",{className:"flex flex-wrap gap-1",children:["app_mention","message.channels","message.groups","message.im"].map(j=>d.jsx(Fi,{variant:"outline",className:"text-xs font-mono",children:j},j))})]})]}),d.jsxs("section",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("h2",{className:"text-sm font-semibold flex items-center gap-2",children:[d.jsx(ai,{className:"h-4 w-4 text-primary"}),i("channelDetail.targets","Message Routing Targets")]}),d.jsxs(Yt,{size:"sm",variant:"outline",className:"gap-1",onClick:R,"data-testid":"add-target-btn",children:[d.jsx(Gt,{className:"h-3.5 w-3.5"})," ",i("channelDetail.addTarget","Add Target")]})]}),d.jsx("div",{className:"space-y-3",children:h.targets.map((j,B)=>d.jsx(kft,{target:j,index:B,isDefault:h.defaultTargetName===j.name,onUpdate:U=>D(B,U),onRemove:()=>T(B),onSetDefault:()=>{j.name&&I(j.name)}},B))})]}),d.jsxs("section",{className:"rounded-xl border border-border/50 overflow-hidden",children:[d.jsxs("button",{className:"w-full flex items-center justify-between px-5 py-3 text-sm font-medium hover:bg-muted/30 transition-colors",onClick:()=>v(!x),children:[i("channelDetail.rawConfig","Raw Configuration"),x?d.jsx(Y_,{className:"h-4 w-4"}):d.jsx(Rn,{className:"h-4 w-4"})]}),x&&d.jsx("div",{className:"border-t border-border/30 p-4",children:d.jsx("pre",{className:"text-xs font-mono bg-muted/30 p-4 rounded-lg overflow-auto max-h-96",children:JSON.stringify(h,null,2)})})]}),d.jsx(sl,{open:f,onOpenChange:m,title:i("channels.confirmDelete","Delete channel?"),description:i("channels.confirmDeleteDesc","This will permanently remove this channel integration."),onConfirm:E,confirmLabel:i("common.delete"),cancelLabel:i("common.cancel"),isPending:u.isPending})]})}function Eft(){const i=mp();return d.jsxs(WJe,{resetKey:i.key,children:[d.jsxs(A6e,{children:[d.jsx(Li,{path:"/manage/studio/:agentId",element:d.jsx(Iht,{})}),d.jsxs(Li,{element:d.jsx(HJe,{}),children:[d.jsx(Li,{path:"/manage",element:d.jsx(Net,{})}),d.jsx(Li,{path:"/manage/agents",element:d.jsx(nit,{})}),d.jsx(Li,{path:"/manage/agents/wizard",element:d.jsx(kct,{})}),d.jsx(Li,{path:"/manage/agentview/:id",element:d.jsx(jit,{})}),d.jsx(Li,{path:"/manage/workflows",element:d.jsx(Kit,{})}),d.jsx(Li,{path:"/manage/workflowview/:id",element:d.jsx(Zrt,{})}),d.jsx(Li,{path:"/manage/conversations",element:d.jsx(rot,{})}),d.jsx(Li,{path:"/manage/coordinator",element:d.jsx(Bct,{})}),d.jsx(Li,{path:"/manage/schedules",element:d.jsx(rdt,{})}),d.jsx(Li,{path:"/manage/logs",element:d.jsx(xdt,{})}),d.jsx(Li,{path:"/manage/orphans",element:d.jsx(hdt,{})}),d.jsx(Li,{path:"/manage/secrets",element:d.jsx(Ldt,{})}),d.jsx(Li,{path:"/manage/variables",element:d.jsx(jdt,{})}),d.jsx(Li,{path:"/manage/audit",element:d.jsx(Ydt,{})}),d.jsx(Li,{path:"/manage/quotas",element:d.jsx(sut,{})}),d.jsx(Li,{path:"/manage/gdpr",element:d.jsx(bgt,{})}),d.jsx(Li,{path:"/manage/groups",element:d.jsx(Tut,{})}),d.jsx(Li,{path:"/manage/groups/wizard",element:d.jsx(Cht,{})}),d.jsx(Li,{path:"/manage/groups/:id",element:d.jsx(yht,{})}),d.jsx(Li,{path:"/manage/userdata",element:d.jsx(qgt,{})}),d.jsx(Li,{path:"/manage/triggers",element:d.jsx(nft,{})}),d.jsx(Li,{path:"/manage/capabilities",element:d.jsx(rft,{})}),d.jsx(Li,{path:"/manage/sync",element:d.jsx(oft,{})}),d.jsx(Li,{path:"/manage/channels",element:d.jsx(Sft,{})}),d.jsx(Li,{path:"/manage/channels/:id",element:d.jsx(Nft,{})}),d.jsx(Li,{path:"/manage/memories",element:d.jsx(fT,{to:"/manage/userdata?tab=memories",replace:!0})}),d.jsx(Li,{path:"/manage/properties",element:d.jsx(fT,{to:"/manage/userdata?tab=properties",replace:!0})}),d.jsx(Li,{path:"/manage/user-conversations",element:d.jsx(fT,{to:"/manage/userdata?tab=conversations",replace:!0})}),d.jsx(Li,{path:"/manage/conversationview/:id",element:d.jsx(aot,{})}),d.jsx(Li,{path:"/manage/chat",element:d.jsx(Cot,{})}),d.jsx(Li,{path:"/manage/resources",element:d.jsx(Dot,{})}),d.jsx(Li,{path:"/manage/resources/:type",element:d.jsx(Oot,{})}),d.jsx(Li,{path:"/manage/resources/:type/:id",element:d.jsx(bct,{})}),d.jsx(Li,{path:"/",element:d.jsx(fT,{to:"/manage",replace:!0})}),d.jsx(Li,{path:"*",element:d.jsx(fT,{to:"/manage",replace:!0})})]})]}),d.jsx(ogt,{})]})}const Jn=i=>typeof i=="string",TT=()=>{let i,e;const t=new Promise((n,s)=>{i=n,e=s});return t.resolve=i,t.reject=e,t},ibe=i=>i==null?"":""+i,Lft=(i,e,t)=>{i.forEach(n=>{e[n]&&(t[n]=e[n])})},Dft=/###/g,sbe=i=>i&&i.indexOf("###")>-1?i.replace(Dft,"."):i,rbe=i=>!i||Jn(i),X2=(i,e,t)=>{const n=Jn(e)?e.split("."):e;let s=0;for(;s{const{obj:n,k:s}=X2(i,e,Object);if(n!==void 0||e.length===1){n[s]=t;return}let r=e[e.length-1],o=e.slice(0,e.length-1),a=X2(i,o,Object);for(;a.obj===void 0&&o.length;)r=`${o[o.length-1]}.${r}`,o=o.slice(0,o.length-1),a=X2(i,o,Object),a!=null&&a.obj&&typeof a.obj[`${a.k}.${r}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${r}`]=t},Tft=(i,e,t,n)=>{const{obj:s,k:r}=X2(i,e,Object);s[r]=s[r]||[],s[r].push(t)},Uj=(i,e)=>{const{obj:t,k:n}=X2(i,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},Ift=(i,e,t)=>{const n=Uj(i,t);return n!==void 0?n:Uj(e,t)},sTe=(i,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in i?Jn(i[n])||i[n]instanceof String||Jn(e[n])||e[n]instanceof String?t&&(i[n]=e[n]):sTe(i[n],e[n],t):i[n]=e[n]);return i},BS=i=>i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Aft={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Rft=i=>Jn(i)?i.replace(/[&<>"'\/]/g,e=>Aft[e]):i;class Mft{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Pft=[" ",",","?","!",";"],Oft=new Mft(20),jft=(i,e,t)=>{e=e||"",t=t||"";const n=Pft.filter(o=>e.indexOf(o)<0&&t.indexOf(o)<0);if(n.length===0)return!0;const s=Oft.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let r=!s.test(i);if(!r){const o=i.indexOf(t);o>0&&!s.test(i.substring(0,o))&&(r=!0)}return r},eY=function(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!i)return;if(i[e])return Object.prototype.hasOwnProperty.call(i,e)?i[e]:void 0;const n=e.split(t);let s=i;for(let r=0;r-1&&li==null?void 0:i.replace("_","-"),Fft={type:"logger",log(i){this.output("log",i)},warn(i){this.output("warn",i)},error(i){this.output("error",i)},output(i,e){var t,n;(n=(t=console==null?void 0:console[i])==null?void 0:t.apply)==null||n.call(t,console,e)}};class qj{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||Fft,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n{this.observers[n]||(this.observers[n]=new Map);const s=this.observers[n].get(t)||0;this.observers[n].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s{let[a,l]=o;for(let c=0;c{let[a,l]=o;for(let c=0;c1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){var c,u;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):Jn(n)&&r?a.push(...n.split(r)):a.push(n)));const l=Uj(this.data,a);return!l&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),l||!o||!Jn(n)?l:eY((u=(c=this.data)==null?void 0:c[e])==null?void 0:u[t],n,r)}addResource(e,t,n,s){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."),s=t,t=a[1]),this.addNamespaces(t),obe(this.data,a,s),r.silent||this.emit("added",e,t,n,s)}addResources(e,t,n){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const r in n)(Jn(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,r){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),s=n,n=t,t=a[1]),this.addNamespaces(t);let l=Uj(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?sTe(l,n,r):l={...l,...n},obe(this.data,a,l),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var rTe={processors:{},addPostProcessor(i){this.processors[i.name]=i},handle(i,e,t,n,s){return i.forEach(r=>{var o;e=((o=this.processors[r])==null?void 0:o.process(e,t,n,s))??e}),e}};const lbe={},cbe=i=>!Jn(i)&&typeof i!="boolean"&&typeof i!="number";class Kj extends G7{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Lft(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ff.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const n=this.resolve(e,t);return(n==null?void 0:n.res)!==void 0}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const o=n&&e.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!jft(e,n,s);if(o&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:Jn(r)?[r]:r};const c=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(c[0])>-1)&&(r=c.shift()),e=c.join(s)}return{key:e,namespaces:Jn(r)?[r]:r}}translate(e,t,n){if(typeof t!="object"&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),typeof t=="object"&&(t={...t}),t||(t={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const s=t.returnDetails!==void 0?t.returnDetails:this.options.returnDetails,r=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],t),l=a[a.length-1],c=t.lng||this.language,u=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((c==null?void 0:c.toLowerCase())==="cimode"){if(u){const j=t.nsSeparator||this.options.nsSeparator;return s?{res:`${l}${j}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:`${l}${j}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:o}const h=this.resolve(e,t);let g=h==null?void 0:h.res;const f=(h==null?void 0:h.usedKey)||o,m=(h==null?void 0:h.exactUsedKey)||o,x=["[object Number]","[object Function]","[object RegExp]"],v=t.joinArrays!==void 0?t.joinArrays:this.options.joinArrays,_=!this.i18nFormat||this.i18nFormat.handleAsObject,w=t.count!==void 0&&!Jn(t.count),k=Kj.hasDefaultValue(t),C=w?this.pluralResolver.getSuffix(c,t.count,t):"",E=t.ordinal&&w?this.pluralResolver.getSuffix(c,t.count,{ordinal:!1}):"",D=w&&!t.ordinal&&t.count===0,T=D&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${C}`]||t[`defaultValue${E}`]||t.defaultValue;let I=g;_&&!g&&k&&(I=T);const R=cbe(I),P=Object.prototype.toString.apply(I);if(_&&I&&R&&x.indexOf(P)<0&&!(Jn(v)&&Array.isArray(I))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const j=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,I,{...t,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(h.res=j,h.usedParams=this.getUsedParamsDetails(t),h):j}if(r){const j=Array.isArray(I),B=j?[]:{},U=j?m:f;for(const $ in I)if(Object.prototype.hasOwnProperty.call(I,$)){const K=`${U}${r}${$}`;k&&!g?B[$]=this.translate(K,{...t,defaultValue:cbe(T)?T[$]:void 0,joinArrays:!1,ns:a}):B[$]=this.translate(K,{...t,joinArrays:!1,ns:a}),B[$]===K&&(B[$]=I[$])}g=B}}else if(_&&Jn(v)&&Array.isArray(g))g=g.join(v),g&&(g=this.extendTranslation(g,e,t,n));else{let j=!1,B=!1;!this.isValidLookup(g)&&k&&(j=!0,g=T),this.isValidLookup(g)||(B=!0,g=o);const $=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&B?void 0:g,K=k&&T!==g&&this.options.updateMissing;if(B||j||K){if(this.logger.log(K?"updateKey":"missingKey",c,l,o,K?T:g),r){const te=this.resolve(o,{...t,keySeparator:!1});te&&te.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let z=[];const G=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if(this.options.saveMissingTo==="fallback"&&G&&G[0])for(let te=0;te{var V;const Y=k&&Q!==g?Q:$;this.options.missingKeyHandler?this.options.missingKeyHandler(te,l,H,Y,K,t):(V=this.backendConnector)!=null&&V.saveMissing&&this.backendConnector.saveMissing(te,l,H,Y,K,t),this.emit("missingKey",te,l,H,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?z.forEach(te=>{const H=this.pluralResolver.getSuffixes(te,t);D&&t[`defaultValue${this.options.pluralSeparator}zero`]&&H.indexOf(`${this.options.pluralSeparator}zero`)<0&&H.push(`${this.options.pluralSeparator}zero`),H.forEach(Q=>{ne([te],o+Q,t[`defaultValue${Q}`]||T)})}):ne(z,o,T))}g=this.extendTranslation(g,e,t,h,n),B&&g===o&&this.options.appendNamespaceToMissingKey&&(g=`${l}:${o}`),(B||j)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${o}`:o,j?g:void 0))}return s?(h.res=g,h.usedParams=this.getUsedParamsDetails(t),h):g}extendTranslation(e,t,n,s,r){var c,u;var o=this;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const h=Jn(e)&&(((u=n==null?void 0:n.interpolation)==null?void 0:u.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let g;if(h){const m=e.match(this.interpolator.nestingRegexp);g=m&&m.length}let f=n.replace&&!Jn(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,n.lng||this.language||s.usedLng,n),h){const m=e.match(this.interpolator.nestingRegexp),x=m&&m.length;g1&&arguments[1]!==void 0?arguments[1]:{},n,s,r,o,a;return Jn(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,t),u=c.key;s=u;let h=c.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const g=t.count!==void 0&&!Jn(t.count),f=g&&!t.ordinal&&t.count===0,m=t.context!==void 0&&(Jn(t.context)||typeof t.context=="number")&&t.context!=="",x=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);h.forEach(v=>{var _,w;this.isValidLookup(n)||(a=v,!lbe[`${x[0]}-${v}`]&&((_=this.utils)!=null&&_.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(a))&&(lbe[`${x[0]}-${v}`]=!0,this.logger.warn(`key "${s}" for languages "${x.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(k=>{var D;if(this.isValidLookup(n))return;o=k;const C=[u];if((D=this.i18nFormat)!=null&&D.addLookupKeys)this.i18nFormat.addLookupKeys(C,u,k,v,t);else{let T;g&&(T=this.pluralResolver.getSuffix(k,t.count,t));const I=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(C.push(u+T),t.ordinal&&T.indexOf(R)===0&&C.push(u+T.replace(R,this.options.pluralSeparator)),f&&C.push(u+I)),m){const P=`${u}${this.options.contextSeparator}${t.context}`;C.push(P),g&&(C.push(P+T),t.ordinal&&T.indexOf(R)===0&&C.push(P+T.replace(R,this.options.pluralSeparator)),f&&C.push(P+I))}}let E;for(;E=C.pop();)this.isValidLookup(n)||(r=E,n=this.getResource(k,v,E,t))}))})}),{res:n,usedKey:s,exactUsedKey:r,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n){var r;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(r=this.i18nFormat)!=null&&r.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Jn(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const r of t)delete s[r]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class dbe{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ff.create("languageUtils")}getScriptPartFromCode(e){if(e=$j(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=$j(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Jn(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const s=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const s=this.getLanguagePartFromCode(n);if(this.isSupportedCode(s))return t=s;t=this.options.supportedLngs.find(r=>{if(r===s)return r;if(!(r.indexOf("-")<0&&s.indexOf("-")<0)&&(r.indexOf("-")>0&&s.indexOf("-")<0&&r.substring(0,r.indexOf("-"))===s||r.indexOf(s)===0&&s.length>1))return r})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),Jn(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),s=[],r=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return Jn(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):Jn(e)&&r(this.formatLanguageCode(e)),n.forEach(o=>{s.indexOf(o)<0&&r(this.formatLanguageCode(o))}),s}}const ube={zero:0,one:1,two:2,few:3,many:4,other:5},hbe={select:i=>i===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Bft{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Ff.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=$j(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:n,type:s});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let o;try{o=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),hbe;if(!e.match(/-|_/))return hbe;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,t)}return this.pluralRulesCache[r]=o,o}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,n).map(s=>`${t}${s}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((s,r)=>ube[s]-ube[r]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const gbe=function(i,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,r=Ift(i,e,t);return!r&&s&&Jn(t)&&(r=eY(i,t,n),r===void 0&&(r=eY(e,t,n))),r},JU=i=>i.replace(/\$/g,"$$$$");class Hft{constructor(){var t;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ff.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:r,prefixEscaped:o,suffix:a,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:h,nestingPrefix:g,nestingPrefixEscaped:f,nestingSuffix:m,nestingSuffixEscaped:x,nestingOptionsSeparator:v,maxReplaces:_,alwaysFormat:w}=e.interpolation;this.escape=t!==void 0?t:Rft,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=r?BS(r):o||"{{",this.suffix=a?BS(a):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=g?BS(g):f||BS("$t("),this.nestingSuffix=m?BS(m):x||BS(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=_||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,n)=>(t==null?void 0:t.source)===n?(t.lastIndex=0,t):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){var f;let r,o,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=m=>{if(m.indexOf(this.formatSeparator)<0){const w=gbe(t,l,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,n,{...s,...t,interpolationkey:m}):w}const x=m.split(this.formatSeparator),v=x.shift().trim(),_=x.join(this.formatSeparator).trim();return this.format(gbe(t,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),_,n,{...s,...t,interpolationkey:v})};this.resetRegExp();const u=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,h=((f=s==null?void 0:s.interpolation)==null?void 0:f.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>JU(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?JU(this.escape(m)):JU(m)}].forEach(m=>{for(a=0;r=m.regex.exec(e);){const x=r[1].trim();if(o=c(x),o===void 0)if(typeof u=="function"){const _=u(e,r,s);o=Jn(_)?_:""}else if(s&&Object.prototype.hasOwnProperty.call(s,x))o="";else if(h){o=r[0];continue}else this.logger.warn(`missed to pass in variable ${x} for interpolating ${e}`),o="";else!Jn(o)&&!this.useRawValueToEscape&&(o=ibe(o));const v=m.safeValue(o);if(e=e.replace(r[0],v),h?(m.regex.lastIndex+=o.length,m.regex.lastIndex-=r[0].length):m.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,r,o;const a=(l,c)=>{const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const h=l.split(new RegExp(`${u}[ ]*{`));let g=`{${h[1]}`;l=h[0],g=this.interpolate(g,o);const f=g.match(/'/g),m=g.match(/"/g);(((f==null?void 0:f.length)??0)%2===0&&!m||m.length%2!==0)&&(g=g.replace(/'/g,'"'));try{o=JSON.parse(g),c&&(o={...c,...o})}catch(x){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,x),`${l}${u}${g}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;s=this.nestingRegexp.exec(e);){let l=[];o={...n},o=o.replace&&!Jn(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let c=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const u=s[1].split(this.formatSeparator).map(h=>h.trim());s[1]=u.shift(),l=u,c=!0}if(r=t(a.call(this,s[1].trim(),o),o),r&&s[0]===e&&!Jn(r))return r;Jn(r)||(r=ibe(r)),r||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),r=""),c&&(r=l.reduce((u,h)=>this.format(u,h,n.lng,{...n,interpolationkey:s[1].trim()}),r.trim())),e=e.replace(s[0],r),this.regexp.lastIndex=0}return e}}const Wft=i=>{let e=i.toLowerCase().trim();const t={};if(i.indexOf("(")>-1){const n=i.split("(");e=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(o=>{if(o){const[a,...l]=o.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=a.trim();t[u]||(t[u]=c),c==="false"&&(t[u]=!1),c==="true"&&(t[u]=!0),isNaN(c)||(t[u]=parseInt(c,10))}})}return{formatName:e,formatOptions:t}},HS=i=>{const e={};return(t,n,s)=>{let r=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(r={...r,[s.interpolationkey]:void 0});const o=n+JSON.stringify(r);let a=e[o];return a||(a=i($j(n),s),e[o]=a),a(t)}};class Vft{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ff.create("formatter"),this.options=e,this.formats={number:HS((t,n)=>{const s=new Intl.NumberFormat(t,{...n});return r=>s.format(r)}),currency:HS((t,n)=>{const s=new Intl.NumberFormat(t,{...n,style:"currency"});return r=>s.format(r)}),datetime:HS((t,n)=>{const s=new Intl.DateTimeFormat(t,{...n});return r=>s.format(r)}),relativetime:HS((t,n)=>{const s=new Intl.RelativeTimeFormat(t,{...n});return r=>s.format(r,n.range||"day")}),list:HS((t,n)=>{const s=new Intl.ListFormat(t,{...n});return r=>s.format(r)})},this.init(e)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=HS(t)}format(e,t,n){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find(a=>a.indexOf(")")>-1)){const a=r.findIndex(l=>l.indexOf(")")>-1);r[0]=[r[0],...r.splice(1,a)].join(this.formatSeparator)}return r.reduce((a,l)=>{var h;const{formatName:c,formatOptions:u}=Wft(l);if(this.formats[c]){let g=a;try{const f=((h=s==null?void 0:s.formatParams)==null?void 0:h[s.interpolationkey])||{},m=f.locale||f.lng||s.locale||s.lng||n;g=this.formats[c](a,m,{...u,...s,...f})}catch(f){this.logger.warn(f)}return g}else this.logger.warn(`there was no format function for ${c}`);return a},e)}}const zft=(i,e)=>{i.pending[e]!==void 0&&(delete i.pending[e],i.pendingCount--)};class Uft extends G7{constructor(e,t,n){var r,o;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=Ff.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(o=(r=this.backend)==null?void 0:r.init)==null||o.call(r,n,s.backend,s)}queueLoad(e,t,n,s){const r={},o={},a={},l={};return e.forEach(c=>{let u=!0;t.forEach(h=>{const g=`${c}|${h}`;!n.reload&&this.store.hasResourceBundle(c,h)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?o[g]===void 0&&(o[g]=!0):(this.state[g]=1,u=!1,o[g]===void 0&&(o[g]=!0),r[g]===void 0&&(r[g]=!0),l[h]===void 0&&(l[h]=!0)))}),u||(a[c]=!0)}),(Object.keys(r).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(r),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,t,n){const s=e.split("|"),r=s[0],o=s[1];t&&this.emit("failedLoading",r,o,t),!t&&n&&this.store.addResourceBundle(r,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(l=>{Tft(l.loaded,[r],o),zft(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{a[c]||(a[c]={});const u=l.loaded[c];u.length&&u.forEach(h=>{a[c][h]===void 0&&(a[c][h]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,t,n){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:r,callback:o});return}this.readingCalls++;const a=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(c&&u&&s{this.read.call(this,e,t,n,s+1,r*2,o)},r);return}o(c,u)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(e,t);c&&typeof c.then=="function"?c.then(u=>a(null,u)).catch(a):a(null,c)}catch(c){a(c)}return}return l(e,t,a)}prepareLoading(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Jn(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Jn(t)&&(t=[t]);const r=this.queueLoad(e,t,n,s);if(!r.toLoad.length)return r.pending.length||s(),null;r.toLoad.forEach(o=>{this.loadOne(o)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=e.split("|"),s=n[0],r=n[1];this.read(s,r,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${t}loading namespace ${r} for language ${s} failed`,o),!o&&a&&this.logger.log(`${t}loaded namespace ${r} for language ${s}`,a),this.loaded(e,o,a)})}saveMissing(e,t,n,s,r){var l,c,u,h,g;let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((c=(l=this.services)==null?void 0:l.utils)!=null&&c.hasLoadedNamespace&&!((h=(u=this.services)==null?void 0:u.utils)!=null&&h.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((g=this.backend)!=null&&g.create){const f={...o,isUpdate:r},m=this.backend.create.bind(this.backend);if(m.length<6)try{let x;m.length===5?x=m(e,t,n,s,f):x=m(e,t,n,s),x&&typeof x.then=="function"?x.then(v=>a(null,v)).catch(a):a(null,x)}catch(x){a(x)}else m(e,t,n,s,a,f)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const fbe=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:i=>{let e={};if(typeof i[1]=="object"&&(e=i[1]),Jn(i[1])&&(e.defaultValue=i[1]),Jn(i[2])&&(e.tDescription=i[2]),typeof i[2]=="object"||typeof i[3]=="object"){const t=i[3]||i[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:i=>i,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),pbe=i=>{var e,t;return Jn(i.ns)&&(i.ns=[i.ns]),Jn(i.fallbackLng)&&(i.fallbackLng=[i.fallbackLng]),Jn(i.fallbackNS)&&(i.fallbackNS=[i.fallbackNS]),((t=(e=i.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(i.supportedLngs=i.supportedLngs.concat(["cimode"])),typeof i.initImmediate=="boolean"&&(i.initAsync=i.initImmediate),i},W5=()=>{},$ft=i=>{Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach(t=>{typeof i[t]=="function"&&(i[t]=i[t].bind(i))})};class IA extends G7{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=pbe(e),this.services={},this.logger=Ff,this.modules={external:[]},$ft(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Jn(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=fbe();this.options={...s,...this.options,...pbe(t)},this.options.interpolation={...s.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const r=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?Ff.init(r(this.modules.logger),this.options):Ff.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=Vft;const h=new dbe(this.options);this.store=new abe(this.options.resources,this.options);const g=this.services;g.logger=Ff,g.resourceStore=this.store,g.languageUtils=h,g.pluralResolver=new Bft(h,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(g.formatter=r(u),g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new Hft(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new Uft(r(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",function(f){for(var m=arguments.length,x=new Array(m>1?m-1:0),v=1;v1?m-1:0),v=1;v{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,n||(n=W5),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=function(){return e.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return e.store[u](...arguments),e}});const l=TT(),c=()=>{const u=(h,g)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(g),n(h,g)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(e){var r,o;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:W5;const s=Jn(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const a=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(h=>{h!=="cimode"&&a.indexOf(h)<0&&a.push(h)})};s?l(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>l(u)),(o=(r=this.options.preload)==null?void 0:r.forEach)==null||o.call(r,c=>l(c)),this.services.backendConnector.load(a,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(c)})}else n(null)}reloadResources(e,t,n){const s=TT();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=W5),this.services.backendConnector.reload(e,t,r=>{s.resolve(),n(r)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&rTe.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const s=TT();this.emit("languageChanging",e);const r=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,c)=>{c?(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,s.resolve(function(){return n.t(...arguments)}),t&&t(l,function(){return n.t(...arguments)})},a=l=>{var u,h;!e&&!l&&this.services.languageDetector&&(l=[]);const c=Jn(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||r(c),this.translator.language||this.translator.changeLanguage(c),(h=(u=this.services.languageDetector)==null?void 0:u.cacheUserLanguage)==null||h.call(u,c)),this.loadResources(c,g=>{o(g,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),s}getFixedT(e,t,n){var s=this;const r=function(o,a){let l;if(typeof a!="object"){for(var c=arguments.length,u=new Array(c>2?c-2:0),h=2;h`${l.keyPrefix}${g}${m}`):f=l.keyPrefix?`${l.keyPrefix}${g}${o}`:o,s.t(f,l)};return Jn(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(){var s;for(var e=arguments.length,t=new Array(e),n=0;n1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const o=(a,l)=>{const c=this.services.backendConnector.state[`${a}|${l}`];return c===-1||c===0||c===2};if(t.precheck){const a=t.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!s||o(r,e)))}loadNamespaces(e,t){const n=TT();return this.options.ns?(Jn(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=TT();Jn(e)&&(e=[e]);const s=this.options.preload||[],r=e.filter(o=>s.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return r.length?(this.options.preload=s.concat(r),this.loadResources(o=>{n.resolve(),t&&t(o)}),n):(t&&t(),Promise.resolve())}dir(e){var s,r;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((r=this.services)==null?void 0:r.languageUtils)||new dbe(fbe());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new IA(e,t)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:W5;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},r=new IA(s);if((e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(a=>{r[a]=this[a]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},n){const a=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},Object.keys(l[c]).reduce((u,h)=>(u[h]={...l[c][h]},u),{})),{});r.store=new abe(a,s),r.services.resourceStore=r.store}return r.translator=new Kj(r.services,s),r.translator.on("*",function(a){for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u{if(e)for(const t in e)i[t]===void 0&&(i[t]=e[t])}),i}function Yft(i){return typeof i!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(i))}const mbe=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Qft=function(i,e){const n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(e);let r=`${i}=${s}`;if(n.maxAge>0){const o=n.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");r+=`; Max-Age=${Math.floor(o)}`}if(n.domain){if(!mbe.test(n.domain))throw new TypeError("option domain is invalid");r+=`; Domain=${n.domain}`}if(n.path){if(!mbe.test(n.path))throw new TypeError("option path is invalid");r+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return n.partitioned&&(r+="; Partitioned"),r},bbe={create(i,e,t,n){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+t*60*1e3)),n&&(s.domain=n),document.cookie=Qft(i,e,s)},read(i){const e=`${i}=`,t=document.cookie.split(";");for(let n=0;n-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const o=s.substring(1).split("&");for(let a=0;a0&&o[a].substring(0,l)===e&&(t=o[a].substring(l+1))}}return t}},Jft={name:"hash",lookup(i){var s;let{lookupHash:e,lookupFromHashIndex:t}=i,n;if(typeof window<"u"){const{hash:r}=window.location;if(r&&r.length>2){const o=r.substring(1);if(e){const a=o.split("&");for(let l=0;l0&&a[l].substring(0,c)===e&&(n=a[l].substring(c+1))}}if(n)return n;if(!n&&t>-1){const a=r.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?(s=a[typeof t=="number"?t:0])==null?void 0:s.replace("/",""):void 0}}}return n}};let WS=null;const xbe=()=>{if(WS!==null)return WS;try{if(WS=typeof window<"u"&&window.localStorage!==null,!WS)return!1;const i="i18next.translate.boo";window.localStorage.setItem(i,"foo"),window.localStorage.removeItem(i)}catch{WS=!1}return WS};var ept={name:"localStorage",lookup(i){let{lookupLocalStorage:e}=i;if(e&&xbe())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(i,e){let{lookupLocalStorage:t}=e;t&&xbe()&&window.localStorage.setItem(t,i)}};let VS=null;const vbe=()=>{if(VS!==null)return VS;try{if(VS=typeof window<"u"&&window.sessionStorage!==null,!VS)return!1;const i="i18next.translate.boo";window.sessionStorage.setItem(i,"foo"),window.sessionStorage.removeItem(i)}catch{VS=!1}return VS};var tpt={name:"sessionStorage",lookup(i){let{lookupSessionStorage:e}=i;if(e&&vbe())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(i,e){let{lookupSessionStorage:t}=e;t&&vbe()&&window.sessionStorage.setItem(t,i)}},npt={name:"navigator",lookup(i){const e=[];if(typeof navigator<"u"){const{languages:t,userLanguage:n,language:s}=navigator;if(t)for(let r=0;r0?e:void 0}},ipt={name:"htmlTag",lookup(i){let{htmlTag:e}=i,t;const n=e||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(t=n.getAttribute("lang")),t}},spt={name:"path",lookup(i){var s;let{lookupFromPathIndex:e}=i;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?(s=t[typeof e=="number"?e:0])==null?void 0:s.replace("/",""):void 0}},rpt={name:"subdomain",lookup(i){var s,r;let{lookupFromSubdomainIndex:e}=i;const t=typeof e=="number"?e+1:1,n=typeof window<"u"&&((r=(s=window.location)==null?void 0:s.hostname)==null?void 0:r.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(n)return n[t]}};let oTe=!1;try{document.cookie,oTe=!0}catch{}const aTe=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];oTe||aTe.splice(1,1);const opt=()=>({order:aTe,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:i=>i});class lTe{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Gft(t,this.options||{},opt()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Xft),this.addDetector(Zft),this.addDetector(ept),this.addDetector(tpt),this.addDetector(npt),this.addDetector(ipt),this.addDetector(spt),this.addDetector(rpt),this.addDetector(Jft)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(n=>{if(this.detectors[n]){let s=this.detectors[n].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(t=t.concat(s))}}),t=t.filter(n=>n!=null&&!Yft(n)).map(n=>this.options.convertDetectedLanguage(n)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(e,this.options)}))}}lTe.type="languageDetector";const apt={title:"EDDI Manager",description:"Admin dashboard for the EDDI conversational AI platform"},lpt={login:"Login",logout:"Logout",loading:"Authenticating…",sessionExpired:"Session expired. Please login again.",profile:"Profile",guest:"Guest",userMenu:"User menu"},cpt={dashboard:"Dashboard",agents:"Agents",packages:"Workflows",conversations:"Conversations",coordinator:"Coordinator",schedules:"Schedules",logs:"Logs",orphans:"Orphans",secrets:"Secrets",variables:"Variables",audit:"Audit Trail",quotas:"Quotas",groups:"Groups",chat:"Chat",studio:"Studio",resources:"Resources",gdpr:"Privacy",memories:"User Memory",properties:"Properties",triggers:"Triggers",capabilities:"Capabilities",sync:"Sync",channels:"Channels",userConversations:"User Conversations",userData:"User Data",sectionCore:"Core",sectionBuild:"Build & Test",sectionMonitor:"Monitor",sectionAdmin:"Admin",sectionManagement:"Management",sectionDevelopment:"Development",sectionOperations:"Operations",mainNavigation:"Main navigation",openMenu:"Open navigation menu"},dpt={light:"Light",dark:"Dark",system:"System"},upt={label:"Language",en:"English",de:"Deutsch",fr:"Français",es:"Español",ar:"العربية",zh:"中文",th:"ไทย",ja:"日本語",ko:"한국어",pt:"Português",hi:"हिन्दी"},hpt={dashboard:{title:"Dashboard",subtitle:"Overview of your EDDI agents and conversations",activeAgents:"Active Agents",totalWorkflows:"Workflows",totalResources:"Resources",totalConversations:"Conversations",quickActions:"Quick Actions",recentAgents:"Recent Agents",noRecentAgents:"No agents yet. Create your first agent!"},agents:{title:"Agents",subtitle:"Manage your conversational AI agents"},packages:{title:"Workflows",subtitle:"Configure agent workflows and task pipelines"},conversations:{title:"Conversations",subtitle:"View and manage agent conversations"},resources:{title:"Resources",subtitle:"Manage Rules, dictionaries, outputs, and more"},groups:{title:"Groups",subtitle:"Multi-agent discussion groups for structured debate and collaboration"},chat:{title:"Chat",subtitle:"Talk to your deployed agents"},channels:{title:"Channels",subtitle:"Connect agents and groups to messaging platforms like Slack"}},gpt={loading:"Loading...",error:"Something went wrong",retry:"Retry",save:"Save",cancel:"Cancel",delete:"Delete",create:"Create",edit:"Edit",search:"Search...",noResults:"No results found",duplicate:"Duplicate",close:"Close",skipToMain:"Skip to main content",opensNewTab:"opens in new tab",moreActions:"More actions",sortByName:"Sort by name",sortByVersion:"Sort by version",sortByModified:"Sort by last modified",apply:"Apply",copied:"Copied",copy:"Copy",saving:"Saving...",showMore:"Show more",showLess:"Show less",copyFailed:"Failed to copy to clipboard"},fpt={title:"New {{type}}",newAgent:"New Agent",newGroup:"New Group",quickCreate:"Quick Create",quickCreateTitle:"Quick Create {{type}}",quickCreateDesc:"Set a name and description, configure details later.",guidedSetup:"Guided Setup",guidedSetupDesc:"Step-by-step wizard with LLM provider, prompts, and deployment."},ppt={status:"Platform Status",online:"Online",offline:"Offline",checking:"Checking connection…",connected:"Connected",disconnected:"Disconnected",instance:"Instance",latency:"Latency",lastChecked:"Last checked",justNow:"just now",secondsAgo:"{{count}}s ago"},mpt={live:"Live",reconnecting:"Reconnecting…"},bpt={deploy:"Deploy",undeploy:"Undeploy",createAgent:"Create Agent",createTitle:"Create New Agent",name:"Name",namePlaceholder:"My Agent",description:"Description",descriptionPlaceholder:"Describe what this agent does...",empty:"No agents yet. Create your first agent!",emptyDescription:"Use the wizard to create a fully configured agent in minutes.",confirmDelete:"Are you sure you want to delete this agent?",count_one:"{{count}} agent",count_other:"{{count}} agents",export:"Export",exporting:"Exporting...",exportSuccess:"Agent exported successfully",import:"Import Agent",importing:"Importing...",importSuccess:"Agent imported successfully",importError:"Failed to import agent",chat:"Chat",deployAndChat:"Deploy & Chat",openExternalChat:"Open in new tab"},xpt={title:"Agent Detail",backToAgents:"Back to Agents",packages:"Workflows",noWorkflows:"No workflows added yet",addWorkflow:"Add Workflow",selectWorkflow:"Select Workflow to Add",rawConfig:"Raw Configuration",editName:"Edit name",editDescription:"Edit description",clickToEdit:"Click to edit",noDescription:"No description",duplicate:"Duplicate",duplicating:"Duplicating...",duplicateSuccess:"Agent duplicated successfully",environments:"Environments",envProduction:"Production",envTest:"Test",savingAgent:"Saving agent...",savedAgent:"Agent saved successfully",saveError:"Failed to save agent",deployToEnv:"Deploy to {{env}}",undeployFromEnv:"Undeploy from {{env}}",openStudio:"Open in Studio",maxKeyLength:"Max Key Length",maxValueLength:"Max Value Length",maxWritesPerTurn:"Max Writes/Turn",dreamSchedule:"Schedule (cron)",dreamLlmProvider:"LLM Provider",dreamLlmModel:"LLM Model",dreamMaxCost:"Max Cost/Run ($)",dreamPruneDays:"Prune After (days)",dreamBatchSize:"Batch Size",detectContradictions:"Detect contradictions",summarizeInteractions:"Summarize interactions",confidenceLow:"Low",confidenceMedium:"Medium",confidenceHigh:"High",visibilitySelf:"self",visibilityGlobal:"global",onCapEvict:"Evict Oldest",onCapReject:"Reject",recallMostRecent:"Most Recent",recallMostRelevant:"Most Relevant",channels:"Channel Connectors",channelsDesc:"Connect this agent to Slack channels. Each channel connector is independently configured with its own credentials, supporting multi-workspace setups.",noChannels:"No channels configured",noChannelsDesc:"Add a Slack channel to let users interact with this agent from Slack.",addSlackChannel:"Add Slack Channel",slackChannel:"Slack Channel",removeChannel:"Remove channel",removeChannelConfirm:"Remove this Slack channel connector?",removeChannelDesc:"This action will permanently disconnect this channel.",channelId:"Channel ID",channelIdHint:"Channel IDs start with C followed by uppercase alphanumeric characters",botToken:"Bot Token",botTokenPlaceholder:"xoxb-… or ${vault:slack-bot-token}",botTokenHint:"Slack Bot User OAuth Token. Use a vault reference for security.",signingSecret:"Signing Secret",signingSecretPlaceholder:"Hex string or ${vault:slack-signing-secret}",signingSecretHint:"From your Slack App's Basic Information page. Use a vault reference for security.",groupIdOptional:"Group ID (optional)",groupIdPlaceholder:"Multi-agent group config ID",groupIdHint:'Set this to enable "group: question" multi-agent discussions from this Slack channel.',slackSetupGuide:"Slack Setup Guide",slackWebhookUrl:"Webhook URL",slackWebhookCopied:"Webhook URL copied",slackStep1:"Create a Slack App at api.slack.com/apps and install it to your workspace.",slackStep2:"Copy the Bot Token (xoxb-…) and Signing Secret into the EDDI vault and configure channels below.",slackStep3:"Then enable Event Subscriptions in your Slack App, paste the Webhook URL above, and subscribe to:",slackSetupNote:"Important: Configure the channel below before enabling Event Subscriptions — Slack sends a URL verification challenge that requires the signing secret to be configured in EDDI.",slackRequiredScopes:"Required Bot Token Scopes"},vpt={title:"Agent Wizard"},_pt={title:"Agent Setup Wizard",subtitle:"Create a fully configured agent in minutes",backToAgents:"Back to Agents",next:"Next",back:"Back",createOnly:"Create Only",createAndDeploy:"Create & Deploy",typeTitle:"What kind of agent?",typeDesc:"Choose the type of agent you want to create",standardAgent:"Standard Agent",apiAgent:"API Agent",standardDesc:"Conversational AI powered by an LLM with optional tools, quick replies, and sentiment analysis",apiDesc:"Import an OpenAPI/Swagger specification to auto-generate an AI agent that can call your APIs",infoTitle:"Agent Identity",infoDesc:"Give your agent a name and personality",agentName:"Agent Name",namePlaceholder:"e.g. Customer Support Bot",systemPrompt:"System Prompt",promptPlaceholder:"You are a helpful AI assistant that...",promptHint:"This is the instruction that shapes how your agent behaves and responds.",llmTitle:"LLM Configuration",llmDesc:"Choose the AI model that powers your agent",provider:"Provider",model:"Model",apiKey:"API Key",baseUrl:"Base URL",baseUrlPlaceholder:"Custom endpoint URL",optional:"optional",apiSpecTitle:"OpenAPI Specification",apiSpecDesc:"Provide your API's OpenAPI/Swagger spec",specByUrl:"URL",specByFile:"File",specByPaste:"Paste",fetch:"Fetch",specFetched:"Specification loaded!",specFetchError:"Failed to fetch specification",dropFile:"Drop your OpenAPI file here",dropHint:"JSON or YAML format",browse:"Browse Files",pasteSpec:"Paste your OpenAPI/Swagger JSON or YAML here...",specLoaded:"File loaded: {{name}}",specReady:"Specification loaded ({{chars}} chars)",apiBaseUrlLabel:"API Base URL",apiAuthLabel:"API Auth Header",endpointFilter:"Endpoint Filter",endpointFilterPlaceholder:"Comma-separated: GET /users, POST /orders",featuresTitle:"Features & Options",featuresDesc:"Customize your agent's capabilities",introMessage:"Intro Message",introMessageDesc:"Greeting shown when a conversation starts",quickReplies:"Quick Replies",quickRepliesDesc:"LLM generates clickable reply suggestions",sentiment:"Sentiment Analysis",sentimentDesc:"Track user mood, intent and urgency in real-time",structuredOutput:"Structured Output",structuredOutputDesc:"LLM responds with a JSON object instead of plain text",structuredOutputInfo:"Enabling this changes how the LLM responds: instead of plain text, it returns a JSON object with structured fields. A JSON schema is appended to your system prompt, and the model is set to JSON response mode.",builtInTools:"Built-in Tools",builtInToolsDesc:"Enable EDDI's built-in tool library (calculator, datetime, etc.)",toolsWhitelist:"Whitelist (empty = all tools)",allTools:"All Tools",selectSpecific:"Select Specific",allToolsInfo:'All {{count}} built-in tools will be available to your agent. Switch to "Select Specific" to restrict which tools are enabled.',availableTools:"Available Tools",toolCount:"{{selected}} of {{total}} selected",mcpServers:"MCP Servers",mcpServersDesc:"Connect to Model Context Protocol servers for external tools",autoDeploy:"Auto-Deploy",autoDeployDesc:"Deploy the agent immediately after creation",environment:"Environment",envProduction:"Production",envTest:"Test",reviewTitle:"Review & Create",reviewDesc:"Review your configuration before creating the agent",reviewType:"Type",reviewName:"Name",reviewPrompt:"System Prompt",reviewProvider:"Provider",reviewModel:"Model",reviewSpec:"OpenAPI Spec",reviewIntro:"Intro Message",reviewDeploy:"Deploy",success:"Agent created successfully!",agentCreated:"Agent Created!",deployed:"Deployed",endpointsParsed:"{{count}} API endpoints parsed",viewAgent:"View Agent",createAnother:"Create Another"},ypt={createWorkflow:"Create Workflow",createTitle:"Create New Workflow",name:"Name",namePlaceholder:"My Workflow",description:"Description",descriptionPlaceholder:"Describe what this workflow does...",noDescription:"No description",empty:"No workflows yet. Create your first workflow!",emptyDescription:"Workflows define the processing pipeline for your agents.",confirmDelete:"Are you sure you want to delete this workflow?",count_one:"{{count}} workflow",count_other:"{{count}} workflows"},wpt={title:"Workflow Detail",backToWorkflows:"Back to Workflows",extensions:"Tasks",noExtensions:"No tasks in this workflow",rawConfig:"Raw Configuration"},Cpt={title:"Workflow Editor",pipeline:"Pipeline",noTasks:"No tasks in this workflow",addHint:"Add tasks to build your processing pipeline",addTask:"Add Task",addHintDialog:"Select a task type to add to the pipeline",reorder:"Reorder task",saved:"Workflow saved successfully",saveError:"Failed to save workflow"},Spt={searchPlaceholder:"Search by conversation ID...",id:"Conversation",agent:"Agent",state:"State",lastActivity:"Last Activity",actions:"Actions",empty:"No conversations yet. Deploy a agent and start chatting!",emptyDescription:"Deploy an agent and start a conversation from the Chat page.",confirmDelete:"Are you sure you want to delete this conversation?",count_one:"{{count}} conversation",count_other:"{{count}} conversations"},kpt={continueChat:"Continue in Chat",searchTranscript:"Search in conversation…",exportMd:"Export as Markdown",toolSummary:"Tool Usage Summary",totalCost:"Total Cost",cacheHitRate:"Cache Hit Rate"},Npt={selectAgent:"Select an agent...",noAgents:"No deployed agents available. Deploy an agent first.",placeholder:"Type a message...",send:"Send",newConversation:"New Conversation",endConversation:"End Conversation",streaming:"Streaming",thinking:"Thinking...",connectionError:"Connection error. Please try again.",empty:"Select an agent and start chatting!",history:"History",continueConversation:"Continue",noHistory:"No conversation history yet.",undo:"Undo last message",redo:"Redo message",attach:"Attach file",attachUploading:"Uploading...",attachSuccess:"File attached",attachError:"Failed to upload file",retry:"Retry Last Step",retrySuccess:"Step re-executed",retryError:"Retry failed",showActivity:"Show Activity",hideActivity:"Hide Activity",scrollToBottom:"Scroll to bottom",copyMessage:"Copy message",copied:"Copied!",activity:{processing:"Processing…",steps:"steps",toolCalls:"tool calls",toolCall:"Tool call",toolResult:"Result"},context:{conversationId:"Conversation ID",agentVersion:"Agent Version",startTime:"Started",stepCount:"Steps",show:"Show conversation info",hide:"Hide conversation info"},agentTyping:"Agent is typing"},Ept={placeholder:"Search pages, agents, actions…",noResults:"No results found.",recent:"Recent",navigate:"Navigate",agents:"Agents",actions:"Quick Actions",createAgent:"Create New Agent",openChat:"Open Chat",kbdNavigate:"navigate",kbdSelect:"select",kbdClose:"close"},Lpt={unnamed:"Unnamed Resource",noDescription:"No description",backToResources:"Back to Resources",backToList:"Back to {{type}}",unknownType:"Unknown resource type",rawConfig:"Raw Configuration",rawConfigHint:"JSON configuration for this resource",create:"Create {{type}}",createTitle:"Create {{type}}",createDescription:"Create an empty {{type}} configuration. You can edit it after creation.",confirmDelete:"Are you sure you want to delete this {{type}}?",empty:"No {{type}} resources yet.",emptyDescription:"Create your first {{type}} to use it in workflows.",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",count_one:"{{count}} resource",count_other:"{{count}} resources",types:{rules:{name:"Rules",description:"Define conversation flow rules and decision logic"},apicalls:{name:"API Calls",description:"Configure external API integrations and webhooks"},output:{name:"Output Sets",description:"Manage agent response templates and output variations"},dictionary:{name:"Dictionaries",description:"Define word and phrase recognition patterns"},llm:{name:"LLM",description:"Configure AI agent models, prompts, and tool bindings"},propertysetter:{name:"Property Setter",description:"Set conversation properties and manage slot-filling"},mcpcalls:{name:"MCP Calls",description:"Configure MCP server connections and deterministic tool calls"},rag:{name:"Knowledge Bases",description:"Configure RAG knowledge bases for document retrieval"},snippets:{name:"Prompt Snippets",description:"Reusable system prompt building blocks for template composition"}}},Dpt={formTab:"Form",jsonTab:"JSON",save:"Save",discard:"Discard",saving:"Saving...",saved:"Saved successfully",saveError:"Failed to save",dirty:"Unsaved changes",version:"Version",versionPicker:"Select version",readOnly:"Read-only",formPlaceholder:"Visual editor coming soon. Use the JSON tab to edit.",jsonSchema:"Schema validation active",cascadeMode:"Changes will cascade to parent workflow and agent",usedInAgents:"Used in {{count}} agent(s)",updateUsageHint:"Update the selected workflows and agents to use the new version?",updateUsage:"Update Selected",skipUpdate:"Skip",cascading:"Updating...",cascadeSuccess:"Cascade update complete",invalidJson:"Invalid JSON — switch to the JSON tab to fix."},Tpt={appendActions:"Append Actions",expressionsAsActions:"Expressions as Actions",groups:"Rules Groups",addGroup:"Add Group",groupName:"Group Name",executionStrategy:"Execution Strategy",rules:"Rules",addRule:"Add Rule",ruleName:"Rule Name",actions:"Actions",noActions:"No actions",addAction:"Add",actionPlaceholder:"e.g. greet, get_weather",conditions:"Conditions",addCondition:"Add Condition",conditionType:"Condition Type",nestedConditions:"Nested Conditions",configKey:"Key",configValue:"Value",addConfig:"Add config",removeRule:"Remove Rule",removeGroup:"Remove Group",removeCondition:"Remove Condition",noGroups:"No Rules Groups defined",noRules:"No rules in this group",noConditions:"No conditions"},Ipt={targetServerUrl:"Target Server URL",targetServerUrlPlaceholder:"https://api.example.com",calls:"HTTP Calls",addCall:"Add HTTP Call",callName:"Call Name",callDescription:"Description",descriptionPlaceholder:"Natural language description for LLM agents",request:"Request",method:"Method",path:"Path",pathPlaceholder:"/api/endpoint",headers:"Headers",addHeader:"Add Header",queryParams:"Query Parameters",addQueryParam:"Add Query Param",contentType:"Content Type",body:"Request Body",bodyPlaceholder:"JSON body template...",parameters:"Parameters (for LLM agents)",paramName:"Parameter Name",paramDescription:"Description",addParam:"Add Parameter",options:"Options",saveResponse:"Save Response",responseObjectName:"Response Object Name",responseHeaderObjectName:"Response Header Object Name",fireAndForget:"Fire and Forget",batchCalls:"Batch Calls",iterationObjectName:"Iteration Object Name",prePostInstructions:"Pre/Post Instructions",preRequest:"Pre-Request",postResponse:"Post-Response",removeCall:"Remove Call",noCalls:"No HTTP calls configured",actions:"Trigger Actions",noActions:"No actions",actionPlaceholder:"e.g. get_weather"},Apt={tasks:"LLM Tasks",addTask:"Add Task",noTasks:"No LLM Tasks configured",removeTask:"Remove Task",taskId:"Task ID",description:"Description",descriptionPlaceholder:"What this task does",triggerActions:"Trigger Actions",noActions:"No actions",actionPlaceholder:"e.g. help, chat",systemPrompt:"System Prompt",systemPromptPlaceholder:"You are a helpful assistant...",modelParams:"Model Parameters",addParam:"Add Parameter",agentMode:"Agent Mode",enableBuiltInTools:"Enable Built-in Tools",toolWhitelist:"Tool Whitelist (empty = all)",enableHttpCallTools:"Auto-Discover HTTP Call Tools",enableHttpCallToolsDesc:"Automatically expose all httpcall extensions from the workflow as LLM tools",httpCallTools:"HTTP Call Tool URIs",httpCallToolsHint:"Explicit httpcall URIs (in addition to auto-discovered ones)",addTool:"Add Tool URI",mcpServers:"MCP Servers",mcpServersDesc:"External MCP servers whose tools become available to the LLM",addMcpServer:"Add MCP Server",mcpUrlPlaceholder:"http://localhost:7070/mcp",mcpName:"Name",mcpApiKey:"API Key / vault ref",historyLimit:"History Limit",historyLimitHint:"(-1 = unlimited)",budgetPerf:"Budget & Performance",maxBudget:"Max Budget ($)",costTracking:"Cost Tracking",toolCaching:"Tool Caching",rateLimiting:"Rate Limiting",defaultRate:"Default Rate (req/min)",prePostInstructions:"Pre/Post Instructions",preRequest:"Pre-Request",postResponse:"Post-Response",preRequestDesc:"Set or transform properties before the LLM call executes.",postResponseDesc:"Process LLM output: set properties, build output messages, and generate quick replies.",postPropertyInstructions:"Property Instructions",postOutputInstructions:"Output Build Instructions",postQrInstructions:"Quick Reply Build Instructions",enableMcpCallTools:"Auto-Discover MCP Call Tools",enableMcpCallToolsDesc:"Automatically expose all mcpcalls extensions from the workflow as LLM tools",a2aAgents:"A2A Agents",a2aAgentsDesc:"Remote A2A-compatible agents whose skills become LLM tools",addA2aAgent:"Add A2A Agent",a2aUrlPlaceholder:"https://remote.example.com/a2a/agents/...",a2aName:"Display Name",a2aApiKey:"${vault:my-a2a-key}",a2aTimeout:"Timeout (ms)",a2aSkillsFilter:"Skills Filter (empty = all)",budgetCosts:"Budget & Costs",execution:"Execution",moveUp:"Move up",moveDown:"Move down",cascade:"Model Cascade",cascadeDesc:"Try a cheap/fast model first. If confidence is too low, automatically escalate to a more powerful (and expensive) model. Saves costs without sacrificing quality.",cascadeEnable:"Enable Model Cascade",cascadeStrategy:"Strategy",strategyCascade:"Sequential Escalation",strategyParallel:"Parallel (future)",cascadeStrategyHint:"Sequential tries cheap first, escalates on low confidence",cascadeEvalStrategy:"Confidence Evaluation",cascadeEvalHint:"How to determine if a response is good enough",evalStructured:"Structured Output (JSON)",evalHeuristic:"Heuristic (hedging detection)",evalJudge:"Judge Model (secondary LLM)",evalNone:"None (always accept)",cascadeInAgent:"Also use cascade in Agent Mode (with tools)",cascadeSteps:"Cascade Steps (cheap → expensive)",cascadeStepsDesc:"Order matters: first step tried first. Last step is always accepted (set confidence to empty).",cascadeModelName:"e.g. claude-sonnet-4-6",cascadeConfidence:"Min. Confidence (0–1)",cascadeConfidencePlaceholder:"empty = always accept",cascadeTimeout:"Timeout (ms)",addCascadeStep:"Add Cascade Step",parallelExecution:"Parallel Tool Execution",parallelExecutionDesc:"Run independent tool calls concurrently instead of sequentially",parallelTimeout:"Timeout (ms)",maxToolIterations:"Max Tool Iterations",maxToolIterationsHint:"(default 10)",toolRateLimits:"Per-Tool Rate Limits",toolRateLimitsDesc:"Override the default rate for specific tools (calls/min)",toolName:"Tool name",addToolRate:"Add Tool Rate",retryConfig:"Retry Configuration",retryDesc:"Configure automatic retries for failed LLM API calls with exponential backoff.",retryMaxAttempts:"Max Attempts",retryDelay:"Initial Delay (ms)",retryMultiplier:"Backoff Multiplier",retryMaxDelay:"Max Delay (ms)",ragConfig:"RAG (Knowledge Retrieval)",ragDesc:"Augment LLM responses with relevant documents retrieved from an embedding store.",ragHttpCall:"HTTP Call URI",ragEmbeddingModel:"Embedding Model",ragEmbeddingModelPlaceholder:"e.g. text-embedding-3-small",ragEmbeddingStore:"Embedding Store",ragEmbeddingStorePlaceholder:"e.g. pgvector, qdrant",ragMaxResults:"Max Results",ragMinScore:"Min Similarity Score (0–1)",allSkills:"All skills",skillPlaceholder:"e.g. order-tracking",modeAgent:"Agent",modeChat:"Chat",perMinute:"/min",allTools:"All Tools",selectSpecific:"Select Specific",allToolsInfo:'All {{count}} built-in tools are available to the LLM. Switch to "Select Specific" to restrict which tools are exposed.',availableTools:"Available Tools",toolCount:"{{selected}} of {{total}} selected",toolSources:"Workflow Tool Sources",toolSourcesInfo:"Both sources are enabled by default — all workflow HTTP calls and MCP calls are automatically exposed as LLM tools. Disable a source to exclude it.",included:"Included"},Rpt={language:"Language",langPlaceholder:"e.g. en, de",outputSets:"Output Sets",addOutputSet:"Add Output Set",noOutputSets:"No output sets configured",actionName:"Action name",timesOccurred:"×",removeOutput:"Remove",outputs:"Outputs",alternativeGroup:"Alternative Group",addAlternative:"Add Alternative",addOutputGroup:"Add Output Group",textPlaceholder:"Output text...",urlPlaceholder:"URL...",delayMs:"Delay (ms)",quickReplies:"Quick Replies",noQuickReplies:"No quick replies",addQuickReply:"Add Quick Reply",qrValue:"Button text",qrExpressions:"Expressions",default:"Default"},Mpt={setters:"Property Setters",addSetter:"Add Setter",noSetters:"No property setters configured",removeSetter:"Remove",triggerActions:"Trigger Actions",noActions:"No actions",actionPlaceholder:"e.g. greet, fallback",properties:"Properties",noProperties:"No properties",addProperty:"Add Property",propName:"Property name",propValue:"Value / expression",fromPath:"From path",fromObjectPath:"fromObjectPath",override:"Override",propsCount:"props",untitled:"(no actions)"},Ppt={language:"Language",langPlaceholder:"e.g. en, de",words:"Words",addWord:"Add Word",wordPlaceholder:"e.g. hello",phrases:"Phrases",addPhrase:"Add Phrase",phrasePlaceholder:"e.g. good morning",regExs:"Regular Expressions",addRegEx:"Add RegEx",regexPlaceholder:"Regular expression",expressionPlaceholder:"e.g. greeting(hello)",frequency:"Frequency",none:"None defined"},Opt={title:"Coordinator Dashboard",subtitle:"Monitor conversation processing and manage dead-letter entries",type:"Coordinator Type",connection:"Connection",processed:"Tasks Processed",deadLettered:"Dead-Lettered",activeQueues:"Active Queues",queued:"queued",deadLetterTitle:"Dead-Letter Queue",noDeadLetters:"No dead-letter entries",colId:"ID",colConversation:"Conversation",colError:"Error",colTime:"Time",colActions:"Actions",replay:"Replay",discard:"Discard",purgeAll:"Purge All",confirmPurge:"Purge all?",yes:"Yes",cancel:"Cancel",replaySuccess:"Dead-letter replayed",replayError:"Failed to replay",discardSuccess:"Dead-letter discarded",discardError:"Failed to discard",purgeSuccess:"Purged all dead-letter entries",purgeError:"Failed to purge",empty:"No coordinator data available",emptyHint:"The coordinator service may still be starting up. Data will appear automatically."},jpt={expand:"Expand",expandHint:"Expand to fullscreen (Ctrl+Shift+F)",close:"Done",lines:"lines",chars:"chars",fullscreenTitle:"Content Editor",fullscreenDescription:"Full-screen content editor. Press Escape to close."},Fpt={title:"Logs",description:"Monitor real-time log stream or search historical logs.",tabLive:"Live",tabHistory:"History",connected:"Connected",disconnected:"Disconnected",filterAgent:"Agent ID...",filterConversation:"Conversation ID...",filterInstance:"Instance ID...",allLevels:"All Levels",pause:"Pause",resume:"Resume",clear:"Clear",search:"Search",waitingForLogs:"Waiting for logs...",connectingStream:"Connecting to stream...",noHistoryLogs:"No historical logs found.",noHistoryHint:"Try adjusting the filters or search for a different agent or conversation.",waitingHint:"Logs will appear here as they stream in from the backend.",entryCount:"{{count}} entries",showStacktrace:"Show stacktrace ({{count}} frames)",hideStacktrace:"Hide stacktrace",allAgents:"All Agents",allConversations:"All Conversations",searchConversations:"Search by ID, agent, user…",stepsCount:"{{count}} steps",noConversationsFound:"No conversations found",useConversationId:"Use ID: {{id}}",searchLogs:"Search logs…",errors:"errors",warnings:"warns",infos:"info",debugs:"debug",filteredCount:"{{shown}} of {{total}} entries",copyEntry:"Copy log entry",export:"Export",stateReady:"Ready",stateActive:"Active",stateError:"Error",stateEnded:"Ended"},Bpt={title:"Secrets Vault",description:"Manage encrypted secrets shared across all agents in a tenant. Values are never exposed.",tenantId:"Tenant ID",refresh:"Load Secrets",create:"Add Secret",createTitle:"Add Secret",keyName:"Key Name",keyNameLabel:"Key Name",keyNamePlaceholder:"e.g. openaiKey, dbPassword",valueLabel:"Secret Value",valuePlaceholder:"Enter secret value…",descriptionLabel:"Description (optional)",descriptionPlaceholder:"e.g. OpenAI API key for production",descriptionCol:"Description",reference:"Reference",willUseRef:"Reference:",copyRef:"Copy vault reference",refCopied:"Copied: {{ref}}",storeWarning:"The value will be encrypted with AES-256-GCM. It cannot be retrieved once stored — only replaced.",store:"Store Secret",storeSuccess:'Secret "{{key}}" stored',deleteSuccess:'Secret "{{key}}" deleted',created:"Created",lastAccessed:"Last Accessed",lastRotated:"Last Rotated",checksum:"Checksum",actions:"Actions",confirmDeleteTitle:"Delete Secret",confirmDeleteMessage:'Are you sure you want to permanently delete "{{key}}"? Any agent configs using this secret will fail to resolve. This cannot be undone.',empty:"No secrets found",emptyHint:'No secrets stored for tenant "{{tenant}}" yet. Click "Add Secret" to create one.',scopeExplanation:"Secrets are scoped per tenant and shared across all agents. Reference them in configs with ${vault:keyName}. Access is controlled by configuration authorship — only admins who write the config decide which secrets to use.",creatingFor:'Storing in tenant "{{tenant}}" — available to all agents',vaultUp:"Vault Online",vaultDown:"Vault Offline",vaultNotConfigured:"Secrets Vault is not configured",viewDocs:"View documentation",selectAgentFirst:"Select an agent first",tableTitle:'{{count}} secret(s) in tenant "{{tenant}}"'},Hpt={title:"Global Variables",description:"Deployment-wide configuration values available in all agents.",create:"Add Variable",createTitle:"Add Global Variable",editTitle:"Edit Variable",keyLabel:"Key",keyPlaceholder:"e.g., default-model",keyError:"Letters, digits, dots, underscores, hyphens only.",valueLabel:"Value",valuePlaceholder:"e.g., gpt-4.1",valueWarning:"Values are visible in UI and logs. Use the Secrets Vault for sensitive data.",descriptionLabel:"Description (optional)",descriptionPlaceholder:"Optional description…",exportableLabel:"Include in agent exports",save:"Save Variable",saveSuccess:'Variable "{{key}}" saved',deleteSuccess:'Variable "{{key}}" deleted',confirmDeleteTitle:"Delete Variable",confirmDeleteMessage:'Are you sure you want to delete "{{key}}"? Agents using ${vars:{{key}}} will see unresolved references.',empty:"No global variables defined",emptyHint:'Click "Add Variable" to create your first deployment-wide configuration value.',searchPlaceholder:"Filter variables…",tableTitle:"{{count}} variable(s)",colKey:"Key",colValue:"Value",colDescription:"Description",colExportable:"Export",colReference:"Reference",colActions:"Actions",exportYes:"Included in exports",exportNo:"Excluded from exports",copyVars:"Copy ${vars:…} reference",refCopied:"Copied: {{ref}}",infoLine1:"Use {{vars.}} in system prompts or ${vars:} anywhere in agent configurations.",infoLine2:"Changes take effect within 2 minutes (cache TTL). For sensitive values, use the Secrets Vault instead."},Wpt={title:"Audit Trail",description:"Browse the immutable audit ledger for compliance and debugging.",byConversation:"By Conversation",byAgent:"By Agent",selectAgent:"Select an agent…",conversationIdPlaceholder:"Enter conversation ID...",agentIdPlaceholder:"Enter agent ID...",versionPlaceholder:"Version (optional)",search:"Search",entries:"entries",conversations:"conversations",totalDuration:"total",totalCost:"total cost",step:"Step",tasks:"tasks",input:"Input",output:"Output",llmDetail:"LLM Detail",toolCalls:"Tool Calls",hmacIntegrity:"HMAC integrity verified",empty:"Search for audit entries",emptyHint:"Enter a conversation ID above to browse the audit trail.",emptyAgent:"Select an agent to view its audit trail",emptyAgentHint:"Choose a deployed agent from the dropdown above to see all its audit records.",noResults:"No audit entries found",noResultsHint:"Try a different ID or check that the conversation has been processed.",loadMore:"Load more",export:"Export",autoRefreshToggle:"Toggle auto-refresh (every 10s)",autoRefreshOn:"Auto",autoRefreshOff:"Auto",integrityVerified:"All entries cryptographically signed",integrityVerifiedDesc:"{{count}} of {{total}} entries have HMAC-SHA256 signatures",integrityPass:"SIGNED",integrityPartial:"Partially signed audit trail",integrityPartialDesc:"{{count}} of {{total}} entries have HMAC signatures",integrityNone:"Unsigned audit entries",integrityNoneDesc:"Configure a vault master key to enable automatic HMAC-SHA256 signing on all future audit entries.",signed:"Signed",allSigned:"All signed"},Vpt={title:"Schedules",subtitle:"Manage scheduled agent triggers — cron jobs and heartbeats",create:"Create Schedule",createTitle:"Create Schedule",createSuccess:"Schedule created successfully",createError:"Failed to create schedule",creating:"Creating...",name:"Name",namePlaceholder:"e.g. Daily health check",triggerType:"Trigger Type",cronExpression:"Cron Expression",interval:"Interval (seconds)",agentId:"Agent ID",agentIdPlaceholder:"Enter agent ID...",environment:"Environment",message:"Message",messagePlaceholder:"Message to send to agent",conversationStrategy:"Conversation Strategy",total:"Total Schedules",active:"Active",failedCount:"Failed / Dead-Lettered",nextFireLabel:"Next Fire",tableTitle:"All Schedules",empty:"No schedules yet",emptyHint:"Create a schedule to automate agent triggers.",colName:"Name",colType:"Type",colSchedule:"Schedule",colAgent:"Agent",colStatus:"Status",colNextFire:"Next Fire",colLastFired:"Last Fired",colActions:"Actions",enable:"Enable",disable:"Disable",enabled:"Schedule enabled",disabled:"Schedule disabled",toggleError:"Failed to toggle schedule",fireNow:"Fire Now",fired:"Schedule fired successfully",fireError:"Failed to fire schedule",retry:"Retry",retrySuccess:"Schedule re-queued",retryError:"Failed to retry schedule",deleteSuccess:"Schedule deleted",deleteError:"Failed to delete schedule",fireHistory:"Fire History"},zpt={title:"Debug",tabPipeline:"Pipeline",tabCosts:"Costs",tabMemory:"Memory",tabLogs:"Logs",tabPrompt:"Prompt",turn:"Turn",latest:"Latest",noPipeline:"Send a message to see the pipeline trace",processing:"Processing...",actions:"Actions",confidence:"Confidence",duration:"Duration"},Upt={thisTurn:"This Turn",conversationTotal:"Conversation Total",tokens:"Tokens",cost:"Cost",duration:"Duration",model:"Model",toolCalls:"Tool Calls",toolUsage:"Tool Usage",cacheStats:"Cache",hitRate:"Hit Rate",empty:"Send a message to see cost metrics",in:"in",out:"out",total:"total",calls:"calls"},$pt={title:"Conversation Memory",noConversation:"Start a conversation to inspect memory",empty:"No memory data available",properties:"Properties",step:"Step",keys:"keys",input:"Input"},qpt={noAgent:"Select an agent to view logs",search:"Search...",pause:"Pause",resume:"Resume",clear:"Clear",waiting:"Waiting for logs...",connected:"Connected",disconnected:"Disconnected",logOutput:"Log output"},Kpt={noConversation:"Start a conversation to inspect prompts",noLlm:"No LLM interactions found yet",turn:"Turn",latest:"Latest",tokens:"Tokens",model:"Model",cost:"Cost",copy:"Copy Prompt",copied:"Copied!",replay:"Replay This Turn",toolCalls:"Tool Calls",step:"Step",roleSystem:"System Prompt",roleUser:"User",roleAssistant:"Assistant",roleTool:"Tool Result"},Gpt={preview:"Preview",edit:"Edit",switchToPreview:"Preview resolved prompt",switchToEdit:"Switch to Edit",refresh:"Refresh",sampleData:"Sample data (no conversation)",disclaimerReal:"Preview uses the real Qute engine with actual conversation data.",disclaimerSample:"Preview uses the real Qute engine with built-in sample data. Select a conversation for real values.",resolvedPrompt:"Resolved Prompt",copy:"Copy",copied:"Copied!",error:"Template resolution error",loading:"Resolving template…",availableVariables:"Available Variables",copyVariable:"Click to copy variable reference",varProperties:"Properties",varMemory:"Memory",varContext:"Context",varSnippets:"Snippets",varUserInfo:"User Info",varConversationInfo:"Conversation Info",varInput:"Input",varConversationLog:"Conversation Log"},Ypt={title:"Agent Studio",subtitle:"Build, test, and debug your agents in one workspace",pipeline:"Pipeline",editor:"Editor",debug:"Debug & Chat",selectStage:"Click a pipeline stage to open its editor",openInStudio:"Open in Studio",loading:"Loading agent...",notFound:"Agent not found",hideChat:"Hide chat",showChat:"Show chat",backToAgent:"Back to agent detail",selectStageHint:"Select any extension in the pipeline to view and edit its configuration inline",noConfig:"This pipeline stage has no configuration URI",unsupportedType:"Editor not available for this extension type",openEditor:"Open in Editor",editorComingSoon:"In-place editor integration coming soon",noPipeline:"No pipeline stages",landingDescription:"Select an agent to open the visual pipeline editor, debugger, and live chat",noAgents:"No agents found — create one from the Agents page",chat:"Chat",type:{parser:"Parser",rules:"Rules",property:"Property Setter",apicalls:"API Calls",llm:"LLM",output:"Output","output.template":"Output Template",mcpcalls:"MCP Calls",rag:"Knowledge Bases",dictionary:"Dictionary"}},Qpt={general:"General",kbName:"Knowledge Base Name",kbNamePlaceholder:"e.g. product-docs, faq, internal-wiki",kbNameHint:"Used to reference this KB from LLM tasks",embeddingModel:"Embedding Model",provider:"Provider",embeddingParams:"Provider Parameters",embeddingParamsHint:"Model name, API key (use ${vault:...} for secrets), base URL, etc.",vectorStore:"Vector Store",storeType:"Store Type",storeParams:"Connection Parameters",chunking:"Document Chunking",chunkStrategy:"Strategy",chunkSize:"Chunk Size",chunkOverlap:"Chunk Overlap",overlapHint:"Overlap helps maintain context between chunks",chunkPreview:"Preview (how a document gets split)",chunkBlocks:"{{count}} chunks of ~{{size}} chars with {{overlap}} char overlap",retrievalDefaults:"Retrieval Defaults",retrievalHint:"These defaults can be overridden per-task in the LLM configuration.",maxResults:"Max Results (top-K)",minScore:"Min Similarity Score",ingestion:"Document Ingestion",dropFiles:"Drop documents here to ingest",dropHint:"Text, Markdown, or any text-based file",browse:"Browse",pasteText:"Or paste text content",pastePlaceholder:"Paste document text here...",ingestText:"Ingest Text",ingestionHistory:"Ingestion Status",saveFirstIngestion:"Save this knowledge base first to enable document ingestion.",addParam:"Add Parameter"},Xpt={welcome:{title:"Welcome to EDDI",subtitle:"Your AI Agent Command Center",introText:"EDDI Manager is your command center for building, testing, and operating conversational AI agents.",capabilitiesTitle:"What You Can Do",capabilitiesSubtitle:"Everything you need to build production-ready AI agents",buildAgents:"Build Agents",buildAgentsDesc:"Create and configure AI agents with the wizard or from scratch",designWorkflows:"Design Workflows",designWorkflowsDesc:"Drag-and-drop pipeline builder with Rules, LLM chains, and tools",testRealtime:"Test in Real-Time",testRealtimeDesc:"Chat with your agents with streaming responses and built-in debugging",monitorOperate:"Monitor & Operate",monitorOperateDesc:"Conversations, audit trails, secrets, and quotas — all in one place",readyTitle:"Ready to Start?",readySubtitle:"You can restart any tour from the sidebar Help menu",startTour:"Start the Tour",exploreOwn:"I'll Explore on My Own"},tour:{back:"Back",next:"Next",skip:"Skip Tour",finish:"Finish",stepOf:"Step {{current}} of {{total}}",dashboard:{title:"Dashboard Tour",step1Title:"Your Command Center",step1Desc:"The sidebar organizes everything into three zones: Management, Development, and Operations. You'll always know where to find things.",step2Title:"Platform at a Glance",step2Desc:"Live counts of your agents, workflows, and conversations. Click any card to jump straight to that section.",step3Title:"Quick Actions",step3Desc:"Jump straight to common tasks. The Agent Wizard is the fastest way to create your first agent — it takes under 2 minutes.",step4Title:"Make It Yours",step4Desc:"Switch between light, dark, and system themes. EDDI Manager speaks 11 languages — pick yours from the language selector."},agents:{title:"Agents Tour",step1Title:"Agent Wizard",step1Desc:"The wizard walks you through creating a fully configured agent — choose a model, set a personality, enable tools, and deploy.",step2Title:"Manual Creation",step2Desc:"For power users: create a blank agent and configure it with full JSON control. Perfect for advanced setups.",step3Title:"Search & Filter",step3Desc:"Find agents instantly by name. Switch between card and list views with the toggle on the right.",step4Title:"Your Agent Fleet",step4Desc:"Each card shows the agent's name, version, and last modified time. Click any agent for its detail page with deploy, chat, and workflow controls."},workflows:{title:"Workflows Tour",step1Title:"Create a Workflow",step1Desc:"Workflows define the processing pipeline — a sequence of tasks like LLM calls, Rules, and HTTP integrations.",step2Title:"Your Workflows",step2Desc:"Each workflow can be attached to one or more agents. Click to open the drag-and-drop pipeline editor.",step3Title:"Organize Your View",step3Desc:"Search by name and switch between card grid and sortable table views."},chat:{title:"Chat Tour",step1Title:"Pick an Agent",step1Desc:"Select a deployed agent to start a conversation. Only agents that have been deployed appear here.",step2Title:"Streaming Mode",step2Desc:"Toggle real-time token streaming. When enabled, the response appears word by word — great for debugging latency.",step3Title:"Conversation History",step3Desc:"Open the sidebar to browse and resume previous conversations.",step4Title:"Start Chatting",step4Desc:"Type a message and press Enter. The agent responds using the LLM, tools, and workflows you've configured."},resources:{title:"Resources Tour",step1Title:"Extension Library",step1Desc:"Resources are the building blocks of workflows. Each type controls a different part of the agent's behavior.",step2Title:"LLM Configurations",step2Desc:"Define which AI model powers your agent, its system prompt, tools, MCP servers, and cascade settings. This is the brain.",step3Title:"Rules & API Calls",step3Desc:"Rules control conversation flow. HTTP Calls connect to external APIs. Both can be used as LLM tools."},conversations:{title:"Conversations Tour",step1Title:"Search",step1Desc:"Find conversations quickly by ID, agent, or recent user messages.",step2Title:"Status Filters",step2Desc:"Filter conversations by state: Active, In Progress, Ended, or Error.",step3Title:"Conversation List",step3Desc:"Browse all sessions. Click any conversation card to open the timeline and debug."},groups:{title:"Discussion Groups Tour",step1Title:"Create Group",step1Desc:"Create an orchestration group to let multiple agents collaborate and debate.",step2Title:"Group Search",step2Desc:"Search through your existing multi-agent clusters.",step3Title:"Group Grid",step3Desc:"Manage your collaborative environments, edit their policies, or delete stale groups."},logs:{title:"System Logs Tour",step1Title:"Live vs History",step1Desc:"Switch between a real-time stream of system logs and historical log search.",step2Title:"Stream Filters",step2Desc:"Filter the incoming live stream by Agent or by critical Log Level.",step3Title:"Export",step3Desc:"Download the current filtered logs as a text file for external analysis."},secrets:{title:"Secrets Vault Tour",step1Title:"Create Secret",step1Desc:"Securely store a new API key, token, or password that your agents can reference.",step2Title:"Tenant Isolation",step2Desc:"Filter the vault view to show secrets scoped to a specific tenant ID.",step3Title:"Reference Syntax",step3Desc:"Learn how to dynamically inject secrets into your LLM configurations without hardcoding them."},audit:{title:"Audit Ledger Tour",step1Title:"Search Mode",step1Desc:"Search the immutable audit ledger by a specific Conversation ID or by an Agent version.",step2Title:"Execute Search",step2Desc:"Enter your ID and click search to pull the verifiable execution history.",step3Title:"Export Ledger",step3Desc:"Export the retrieved audit records to JSON for compliance and reporting."},schedules:{title:"Schedules Tour",step1Title:"Create Schedule",step1Desc:"Set up a new cron job or continuous heartbeat to trigger agent workflows automatically.",step2Title:"Health Stats",step2Desc:"Monitor the total, active, and failed schedules across your platform.",step3Title:"Schedule Management",step3Desc:"Manage your automated triggers natively: pause, resume, edit, or test-fire them."},quotas:{title:"Quotas Tour",step1Title:"Configuration Constraints",step1Desc:"Define hard limits on total agents, daily conversations, and token costs for this tenant.",step2Title:"Usage Analytics",step2Desc:"Monitor how much of the allocated quota the tenant has consumed in real-time.",step3Title:"Enforce Changes",step3Desc:"Save your adjusted limits. The platform will block traffic that breaches these ceilings."},coordinator:{title:"Coordinator Tour",step1Title:"Live Connection",step1Desc:"View the heartbeat and event source connected to the backend coordinator system.",step2Title:"Queue Processing",step2Desc:"Monitor real-time task queues and active job execution across your cluster.",step3Title:"Dead Letters",step3Desc:"Inspect failed tasks and systematically discard or retry them to maintain system stability."},orphans:{title:"Orphans Tour",step1Title:"Trigger Scan",step1Desc:"Start a platform scan to detect loose configs disconnected from any agent.",step2Title:"Include Soft-Deleted",step2Desc:"Optionally toggle to include historically soft-deleted records in the purge.",step3Title:"Review & Purge",step3Desc:"Review the scanner's report, select stale objects, and permanently purge to reclaim DB space."}},help:{title:"Help & Tour",platformTour:"Platform Tour",resetAll:"Reset All Tours",resetConfirm:"Reset all tour progress?"},offer:{message:"New here? Take the {{page}}",accept:"Show me",dontAsk:"Don't ask again"}},Zpt={empty:"No groups yet",emptyDescription:"Groups let multiple agents collaborate on structured discussions.",createGroup:"Create Group",unnamed:"Unnamed Group",noDescription:"No description",count_one:"{{count}} group",count_other:"{{count}} groups",confirmDelete:"Delete this group?",confirmDeleteDesc:"This will permanently delete the group configuration.",duplicateSuccess:"Group duplicated",members:"members",discussionStyle:"Discussion Style",maxRounds:"Max Rounds"},Jpt={title:"Group Setup Wizard",subtitle:"Assemble a team of AI advisors to discuss your questions",backToGroups:"Back to Groups",templateTitle:"Start from a template",templateDesc:"Choose a preset group configuration or start from scratch.",startBlank:"Start from Scratch",blankDesc:"Configure everything manually",configTitle:"Group Configuration",configDesc:"Name your group and choose how the agents will discuss",namePlaceholder:"e.g. Advisory Board",descPlaceholder:"What is this group for?",membersTitle:"Assemble Your Team",membersDesc:"For each seat, choose an existing agent or create a new one on the fly.",addMember:"Add Member",refreshAgents:"Refresh agent list",existingAgents:"existing agents",displayName:"Agent Name",displayNamePlaceholder:"Give this agent a name…",rolePlaceholder:"Role (e.g. Marketing, Engineering)",useExisting:"Use Existing",createNew:"Create New",selectAgent:"Select agent…",systemPrompt:"System Prompt",provider:"LLM Provider",model:"Model",apiKey:"API Key",apiKeyPlaceholder:"sk-…",createThisAgent:"Create Agent",creatingAgent:"Creating agent…",agentReady:"Agent created & deployed",agentCreated:'Agent "{{name}}" created',agentCreateFailed:"Failed to create agent: {{error}}",moderator:"Moderator",moderatorHint:"Synthesizes the discussion",addModerator:"Add Moderator",removeModerator:"Remove moderator",createModerator:"Create Moderator Agent",moderatorReady:"Moderator agent ready",moderatorCreated:"Moderator agent created",creatingModerator:"Creating moderator…",creatingSlot:"Creating {{name}}…",creatingGroup:"Creating group…",needMembers:"Add at least 2 members to proceed",reviewTitle:"Review & Create",reviewDesc:"Review your group configuration before creating.",reviewMembers:"Members",autoCreateNotice:"{{count}} agents will be auto-created when you click Create Group",autoCreateHint:"Each agent will be created and deployed automatically before the group is assembled.",unassignedWarning:"{{count}} members set to 'Use Existing' but no agent selected",unassignedHint:"These members will be skipped during discussions. Go back to assign agents.",flowPreview:"Discussion Flow",createGroup:"Create Group",created:"Group Created!",viewGroup:"Open Group",createAnother:"Create Another",success:"Group created successfully!"},emt={advisoryBoard:"Advisory Board",advisoryBoardDesc:"A panel of expert advisors consulting on strategic decisions. Each agent represents a different business function.",codeReview:"Code Review Panel",codeReviewDesc:"Structured code review with independent opinions, peer critique, revision, and a synthesized assessment.",riskAssessment:"Risk Assessment",riskAssessmentDesc:"Panel with a devil's advocate who challenges assumptions and identifies blind spots.",forecasting:"Forecasting Panel",forecastingDesc:"Delphi-style anonymous deliberation for reducing groupthink and getting unbiased estimates.",proCon:"Pro/Con Debate",proConDesc:"Formal debate with pro and con teams arguing their positions, followed by rebuttals and a verdict.",roles:{marketingExpert:"Marketing Expert",techLead:"Tech Lead",financeDirector:"Finance Director",legalCounsel:"Legal Counsel",strategyConsultant:"Strategy Consultant",seniorEngineer:"Senior Engineer",architect:"Architect",securityReviewer:"Security Reviewer",riskAnalyst:"Risk Analyst",domainExpert:"Domain Expert",devilsAdvocate:"Devil's Advocate",analystA:"Analyst A",analystB:"Analyst B",analystC:"Analyst C",analystD:"Analyst D",proAdvocate1:"Pro Advocate 1",proAdvocate2:"Pro Advocate 2",conAdvocate1:"Con Advocate 1",conAdvocate2:"Con Advocate 2"}},tmt={title:"User Memory",subtitle:"Browse, search, and manage persistent user memories stored by agents",userIdPlaceholder:"Enter User ID...",searchPlaceholder:"Search memories...",enterUserId:"Enter a User ID to browse their memories",totalEntries:"Total Entries",preferences:"Preferences",facts:"Facts",conflicts:"Conflicted",cat_all:"All",cat_preference:"Preferences",cat_fact:"Facts",cat_context:"Context",deleteAll:"Delete All",deleteAllTitle:"Delete All Memories",deleteAllDesc:"This will permanently delete ALL memory entries for this user. This action cannot be undone.",deleteAllConfirm:"Delete All",entryDeleted:"Memory entry deleted",allDeleted:"All memories deleted for user",noResults:"No memory entries found",value:"Value",sourceAgent:"Source Agent",accessCount:"Access Count",created:"Created",updated:"Updated",sourceConversation:"Source Conversation",conflicted:"Conflicted"},nmt={title:"User Properties",subtitle:"Browse and manage longTerm slot-filling properties stored per user",userIdPlaceholder:"Enter User ID...",searchPlaceholder:"Filter properties...",enterUserId:"Enter a User ID to view their properties",key:"Key",type:"Type",value:"Value",deleteAll:"Delete All",deleteAllTitle:"Delete All Properties",deleteAllDesc:"This will permanently delete ALL properties for this user.",deleted:"Properties deleted",noResults:"No properties found",showingCount:"{{count}} properties"},imt={title:"Agent Triggers",subtitle:"Map intents to agent deployments for automatic routing",create:"New Trigger",createTitle:"Create Trigger",editTitle:"Edit Trigger",intent:"Intent",deployments:"Agent Deployments",addDeployment:"Add Agent",agents:"agents",empty:"No triggers configured yet",created:"Trigger created",updated:"Trigger updated",deleted:"Trigger deleted",deleteTitle:"Delete Trigger",deleteDesc:'Permanently delete the trigger for intent "{{intent}}"?',searchPlaceholder:"Filter by intent or agent ID..."},smt={title:"Capability Discovery",subtitle:"Discover agents by their declared skills and capabilities",searchPlaceholder:"Search skills...",strategyHighest:"Highest Confidence",strategyAll:"All Matches",registeredSkills:"Registered Skills",noSkills:"No skills found",matchingAgents:"Matching Agents",noMatches:"No agents found for this skill"},rmt={title:"Export Agent",loading:"Loading resource tree...",selectResources:"Select resources to export",required:"Required",snippets:"Snippets",allSelected:"All resources selected",countSelected:"{{count}} of {{total}} resources selected",exportSelected:"Export Selected"},omt={title:"Import Agent",dropZone:"Drop a .zip file here or click to browse",dropZoneHint:"Exported agent archive (.zip)",strategyLabel:"Import Strategy",createNew:"Create as new agent",createNewDesc:"Creates a fresh copy with new IDs. Best for first-time import.",mergeSync:"Merge / sync with existing",mergeSyncDesc:"Updates existing resources if previously imported. Creates new ones if not found.",upgradeExisting:"Upgrade existing agent",upgradeDesc:"Match resources structurally against a target agent. Best for promoting across environments.",syncRemote:"Sync from remote instance",syncDesc:"Connect to another EDDI instance and sync a specific agent live.",importNow:"Import Now",previewChanges:"Preview Changes",selectTargetAgent:"Select target agent",upgradeTargetHint:"The imported resources will be structurally matched against this agent.",chooseAgent:"— Choose an agent —",sourceAgent:"Source agent (remote)",targetAgent:"Target agent (local)",createNewTarget:"Create new agent",resource:"Resource",type:"Type",match:"Match",action:"Action",new:"new",updated:"updated",unchanged:"unchanged",selected:"selected",mergeNow:"Import Selected",syncNow:"Sync Now",upgradeNow:"Upgrade Now",importing:"Importing agent...",contentIdentical:"Content identical",targetContent:"Target",sourceContent:"Source"},amt={actionCreate:"New",actionUpdate:"Update",actionSkip:"Up to date",actionConflict:"Conflict"},lmt={title:"Agent Sync",subtitle:"Synchronize agents between EDDI instances",connection:"Source Instance",sourceUrl:"Source EDDI Instance URL",authToken:"Authorization Token",authHint:"Optional. Sent as X-Source-Authorization header.",connect:"Connect",connected:"Connected",agentsFound:"agents",connectionFailed:"Connection failed",agentMapping:"Agent Mapping",previewAll:"Preview All",syncSelected:"Sync Selected",remote:"Remote",createNew:"Create new",changes:"changes",agentsSelected:"agents selected",totalResources:"resources",syncSuccess:"Sync complete",syncError:"Sync failed",empty:"Connect to a source instance to begin syncing agents.",autoMatched:"auto-matched",previewFirst:"Preview changes before syncing"},cmt={title:"User Conversations",subtitle:"Lookup and manage intent → user → conversation bindings used by managed agents",lookup:"Lookup",intent:"Intent",userId:"User ID",agentId:"Agent ID",environment:"Environment",conversationId:"Conversation ID",binding:"Active Binding",enterBoth:"Enter both intent and user ID to search",notFound:"No binding found for this intent + user",create:"Create Binding",createTitle:"Create Binding",created:"Binding created",deleteTitle:"Delete Binding",deleteDesc:'Remove the conversation binding for intent "{{intent}}" and user "{{userId}}"?',deleted:"Binding deleted"},dmt={agentIdPlaceholder:"Agent ID to handle messages",botToken:"Bot Token",botTokenHint:"Bot User OAuth Token. Use a vault reference for security.",botTokenPlaceholder:"xoxb-… or ${vault:slack-bot-token}",channel:"channel",channelId:"Slack Channel ID",channelIdCol:"Channel ID",channelIdHint:"Right-click a Slack channel → View channel details → copy the Channel ID",channelsPlural:"channels",channelType:"Channel Type",confirmDelete:"Delete channel?",confirmDeleteDesc:"This will permanently remove this channel integration.",create:"Create Channel",createTitle:"Create Channel Integration",defaultAgentId:"Default Agent ID",defaultTargetHint:"The default target handles all messages that don't match a trigger keyword. You can add more targets after creation.",empty:"No channels yet",emptyDesc:"Create a channel integration to connect agents to Slack.",name:"Name",namePlaceholder:"e.g. Engineering AI Hub",openSlackApps:"Open Slack App Dashboard",searchPlaceholder:"Search channels...",signingSecret:"Signing Secret",signingSecretHint:"From your Slack App's Basic Information page.",signingSecretPlaceholder:"Hex string or ${vault:slack-signing-secret}",slackSetupGuide:"Slack Setup Guide",slackSetupSummary:"Create a Slack App, configure Bot Token Scopes (app_mentions:read, chat:write, im:history, channels:history, groups:history), then paste credentials here.",target:"target",targets:"targets",targetsCol:"Targets",type:"Type",unnamed:"Unnamed Channel",version:"Version"},umt={addTarget:"Add Target",addTrigger:"Add trigger...",agentId:"Agent ID",botToken:"Bot Token",channelId:"Slack Channel ID",cooldown:"Cooldown (s)",general:"General",groupId:"Group ID",isDefault:"default",maxCost:"Max $/Day",maxDaily:"Max/Day",name:"Name",observe:"Observe",observeDesc:"Passively monitor and selectively respond",observeKeywords:"Trigger Keywords",observeMimeTypes:"Trigger MIME Types",observeMode:"Observe Mode",observeSettings:"Observe Mode Settings",platformConfig:"Platform Configuration",rawConfig:"Raw Configuration",removeTarget:"Remove",requiredEvents:"Required Event Subscriptions:",requiredScopes:"Required Bot Token Scopes:",setDefault:"Set as Default",signingSecret:"Signing Secret",targetName:"Name",targets:"Message Routing Targets",targetType:"Type",triggerHint:'Users type "keyword: message" to route to this target',triggerKeywords:"Trigger Keywords",triggers:"triggers",type:"Channel Type",webhookHint:"Paste this URL into your Slack App’s Event Subscriptions → Request URL field.",webhookUrl:"Webhook URL"},hmt={app:apt,auth:lpt,nav:cpt,theme:dpt,language:upt,pages:hpt,common:gpt,createOrWizard:fpt,platform:ppt,stream:mpt,agents:bpt,agentDetail:xpt,wizard:vpt,setupWizard:_pt,packages:ypt,packageDetail:wpt,packageEditor:Cpt,conversations:Spt,conversationDetail:kpt,chat:Npt,commandPalette:Ept,resources:Lpt,editor:Dpt,rulesEditor:Tpt,apiCallsEditor:Ipt,llmEditor:Apt,outputEditor:Rpt,propertySetterEditor:Mpt,dictionaryEditor:Ppt,coordinator:Opt,contentEditor:jpt,logs:Fpt,secrets:Bpt,variables:Hpt,audit:Wpt,schedules:Vpt,debugDrawer:zpt,costDashboard:Upt,memoryInspector:$pt,logViewer:qpt,promptViewer:Kpt,promptPreview:Gpt,studio:Ypt,ragEditor:Qpt,onboarding:Xpt,groups:Zpt,groupWizard:Jpt,groupTemplates:emt,memories:tmt,properties:nmt,triggers:imt,capabilities:smt,exportDialog:rmt,importDialog:omt,sync:amt,syncPage:lmt,userConversations:cmt,channels:dmt,channelDetail:umt},gmt={title:"EDDI Manager",description:"Admin-Dashboard für die EDDI KI-Plattform"},fmt={login:"Anmelden",logout:"Abmelden",loading:"Authentifizierung…",sessionExpired:"Sitzung abgelaufen. Bitte erneut anmelden.",profile:"Profil",guest:"Gast",userMenu:"Benutzermenü"},pmt={dashboard:"Dashboard",agents:"Agenten",packages:"Workflows",conversations:"Gespräche",coordinator:"Koordinator",schedules:"Zeitpläne",logs:"Protokolle",orphans:"Verwaist",secrets:"Geheimnisse",audit:"Prüfprotokoll",quotas:"Kontingente",groups:"Gruppen",chat:"Chat",resources:"Ressourcen",sectionManagement:"Verwaltung",sectionDevelopment:"Entwicklung",sectionOperations:"Betrieb",mainNavigation:"Hauptnavigation",openMenu:"Navigationsmenü öffnen",sectionCore:"Kern",sectionBuild:"Erstellen & Testen",sectionMonitor:"Überwachung",sectionAdmin:"Verwaltung",studio:"Studio",gdpr:"Datenschutz",memories:"Nutzererinnerungen",properties:"Eigenschaften",triggers:"Auslöser",capabilities:"Fähigkeiten",sync:"Synchronisierung",channels:"Kanäle",userConversations:"Nutzer-Konversationen",userData:"Nutzerdaten",variables:"Variablen"},mmt={light:"Hell",dark:"Dunkel",system:"System"},bmt={label:"Sprache",en:"English",de:"Deutsch",fr:"Français",es:"Español",ar:"العربية",zh:"中文",th:"ไทย",ja:"日本語",ko:"한국어",pt:"Português",hi:"हिन्दी"},xmt={dashboard:{title:"Dashboard",subtitle:"Übersicht Ihrer EDDI-Agents und Gespräche",activeAgents:"Aktive Agents",totalWorkflows:"Workflows",totalResources:"Ressourcen",totalConversations:"Gespräche",quickActions:"Schnellzugriff",recentAgents:"Neueste Agents",noRecentAgents:"Noch keine Agents. Erstellen Sie Ihren ersten Agent!"},agents:{title:"Agenten",subtitle:"Verwalten Sie Ihre KI-Agents"},packages:{title:"Workflows",subtitle:"Workflows und Erweiterungen konfigurieren"},conversations:{title:"Gespräche",subtitle:"Agent-Gespräche anzeigen und verwalten"},resources:{title:"Ressourcen",subtitle:"Verhaltensregeln, Wörterbücher, Ausgaben und mehr verwalten"},chat:{title:"Chat",subtitle:"Mit Ihren bereitgestellten Agents sprechen"},channels:{title:"Kanäle",subtitle:"Verbinden Sie Agenten und Gruppen mit Messaging-Plattformen wie Slack"},groups:{title:"Gruppen",subtitle:"Multi-Agenten-Diskussionsgruppen für strukturierte Debatten und Zusammenarbeit"}},vmt={loading:"Laden...",error:"Etwas ist schiefgelaufen",retry:"Erneut versuchen",save:"Speichern",cancel:"Abbrechen",delete:"Löschen",create:"Erstellen",edit:"Bearbeiten",search:"Suchen...",noResults:"Keine Ergebnisse gefunden",duplicate:"Duplizieren",close:"Schließen",skipToMain:"Zum Hauptinhalt springen",opensNewTab:"öffnet in neuem Tab",moreActions:"Weitere Aktionen",sortByName:"Nach Name sortieren",sortByVersion:"Nach Version sortieren",sortByModified:"Nach Änderungsdatum sortieren",apply:"Anwenden",copied:"Kopiert",copy:"Kopieren",saving:"Wird gespeichert…",showMore:"Show More",showLess:"Show Less",copyFailed:"Kopieren in die Zwischenablage fehlgeschlagen"},_mt={deploy:"Bereitstellen",undeploy:"Deaktivieren",createAgent:"Agent erstellen",createTitle:"Neuen Agent erstellen",name:"Name",namePlaceholder:"Mein Agent",description:"Beschreibung",descriptionPlaceholder:"Beschreiben Sie, was dieser Agent tut...",empty:"Noch keine Agents. Erstellen Sie Ihren ersten Agent!",confirmDelete:"Möchten Sie diesen Agent wirklich löschen?",count_one:"{{count}} Agent",count_other:"{{count}} Agenten",export:"Exportieren",exporting:"Wird exportiert...",exportSuccess:"Agent erfolgreich exportiert",import:"Agent importieren",importing:"Wird importiert...",importSuccess:"Agent erfolgreich importiert",importError:"Agent konnte nicht importiert werden",chat:"Chat",deployAndChat:"Bereitstellen & Chatten",openExternalChat:"In neuem Tab öffnen",emptyDescription:"Erstellen Sie mit dem Wizard in wenigen Minuten einen fertig konfigurierten Agent."},ymt={title:"Agent-Details",backToAgents:"Zurück zu Agents",packages:"Workflows",noWorkflows:"Noch keine Workflows hinzugefügt",addWorkflow:"Workflow hinzufügen",selectWorkflow:"Workflow zum Hinzufügen auswählen",rawConfig:"Rohkonfiguration",editName:"Name bearbeiten",editDescription:"Beschreibung bearbeiten",clickToEdit:"Klicken zum Bearbeiten",noDescription:"Keine Beschreibung",duplicate:"Duplizieren",duplicating:"Wird dupliziert...",duplicateSuccess:"Agent erfolgreich dupliziert",environments:"Umgebungen",envProduction:"Produktion",envTest:"Test",savingAgent:"Agent wird gespeichert...",savedAgent:"Agent erfolgreich gespeichert",saveError:"Agent konnte nicht gespeichert werden",deployToEnv:"In {{env}} bereitstellen",undeployFromEnv:"Aus {{env}} entfernen",openStudio:"Im Studio öffnen",maxKeyLength:"Max. Schlüssellänge",maxValueLength:"Max. Wertlänge",maxWritesPerTurn:"Max. Schreibvorgänge/Runde",dreamSchedule:"Zeitplan (cron)",dreamLlmProvider:"LLM-Anbieter",dreamLlmModel:"LLM-Modell",dreamMaxCost:"Max. Kosten/Lauf ($)",dreamPruneDays:"Bereinigung nach (Tage)",dreamBatchSize:"Stapelgröße",detectContradictions:"Widersprüche erkennen",summarizeInteractions:"Interaktionen zusammenfassen",confidenceLow:"Niedrig",confidenceMedium:"Mittel",confidenceHigh:"Hoch",visibilitySelf:"Eigene",visibilityGlobal:"Global",onCapEvict:"Älteste entfernen",onCapReject:"Ablehnen",recallMostRecent:"Neueste zuerst",recallMostRelevant:"Relevanteste zuerst",channels:"Kanalverbindungen",channelsDesc:"Verbinden Sie diesen Agenten mit Slack-Kanälen. Jede Kanalverbindung wird unabhängig mit eigenen Zugangsdaten konfiguriert und unterstützt Multi-Workspace-Setups.",noChannels:"Keine Kanäle konfiguriert",noChannelsDesc:"Fügen Sie einen Slack-Kanal hinzu, damit Benutzer mit diesem Agenten über Slack interagieren können.",addSlackChannel:"Slack-Kanal hinzufügen",slackChannel:"Slack-Kanal",removeChannel:"Kanal entfernen",removeChannelConfirm:"Diesen Slack-Kanalverbinder entfernen?",removeChannelDesc:"This action will permanently disconnect this channel.",channelId:"Kanal-ID",channelIdHint:"Kanal-IDs beginnen mit C gefolgt von alphanumerischen Großbuchstaben",botToken:"Bot-Token",botTokenPlaceholder:"xoxb-… oder ${vault:slack-bot-token}",botTokenHint:"Slack Bot User OAuth Token. Verwenden Sie eine Vault-Referenz für Sicherheit.",signingSecret:"Signaturgeheimnis",signingSecretPlaceholder:"Hex-String oder ${vault:slack-signing-secret}",signingSecretHint:"Von der Seite 'Basic Information' Ihrer Slack-App. Verwenden Sie eine Vault-Referenz für Sicherheit.",groupIdOptional:"Gruppen-ID (optional)",groupIdPlaceholder:"Multi-Agent Gruppen-Konfigurations-ID",groupIdHint:'Aktiviert "group: Frage" Multi-Agent-Diskussionen aus diesem Slack-Kanal.',slackSetupGuide:"Slack-Einrichtungsleitfaden",slackWebhookUrl:"Webhook-URL",slackWebhookCopied:"Webhook-URL kopiert",slackStep1:"Erstellen Sie eine Slack-App unter api.slack.com/apps und installieren Sie sie in Ihrem Workspace.",slackStep2:"Kopieren Sie das Bot-Token (xoxb-…) und das Signaturgeheimnis in den EDDI-Vault und konfigurieren Sie die Kanäle unten.",slackStep3:"Aktivieren Sie dann Event Subscriptions in Ihrer Slack-App, fügen Sie die Webhook-URL oben ein und abonnieren Sie:",slackSetupNote:"Wichtig: Konfigurieren Sie den Kanal unten, bevor Sie Event Subscriptions aktivieren — Slack sendet eine URL-Verifizierungsanfrage, die das Signaturgeheimnis in EDDI benötigt.",slackRequiredScopes:"Erforderliche Bot-Token-Berechtigungen"},wmt={title:"Agent-Assistent"},Cmt={title:"Agent-Assistent",subtitle:"Erstellen Sie einen vollständig konfigurierten Agent in wenigen Minuten",backToAgents:"Zurück zu Agents",next:"Weiter",back:"Zurück",createOnly:"Nur erstellen",createAndDeploy:"Erstellen & Bereitstellen",typeTitle:"Welche Art von Agent?",typeDesc:"Wählen Sie den gewünschten Agent-Typ",standardAgent:"Standard-Agent",apiAgent:"API-Agent",standardDesc:"KI-gestützte Konversation mit optionalen Tools, Quick Replies und Sentimentanalyse",apiDesc:"Importieren Sie eine OpenAPI/Swagger-Spezifikation zur automatischen Generierung eines API-Agents",infoTitle:"Agent-Identität",infoDesc:"Geben Sie Ihrem Agent einen Namen und eine Persönlichkeit",agentName:"Agent-Name",namePlaceholder:"z.B. Kundensupport-Bot",systemPrompt:"Systemprompt",promptPlaceholder:"Du bist ein hilfreicher KI-Assistent, der...",promptHint:"Diese Anweisung bestimmt, wie sich Ihr Agent verhält und antwortet.",llmTitle:"LLM-Konfiguration",llmDesc:"Wählen Sie das KI-Modell, das Ihren Agent antreibt",provider:"Anbieter",model:"Modell",apiKey:"API-Schlüssel",baseUrl:"Basis-URL",baseUrlPlaceholder:"Benutzerdefinierte Endpoint-URL",optional:"optional",apiSpecTitle:"OpenAPI-Spezifikation",apiSpecDesc:"Geben Sie die OpenAPI/Swagger-Spezifikation Ihrer API an",specByUrl:"URL",specByFile:"Datei",specByPaste:"Einfügen",fetch:"Abrufen",specFetched:"Spezifikation geladen!",specFetchError:"Spezifikation konnte nicht abgerufen werden",dropFile:"OpenAPI-Datei hier ablegen",dropHint:"JSON- oder YAML-Format",browse:"Dateien durchsuchen",pasteSpec:"OpenAPI/Swagger JSON oder YAML hier einfügen...",specLoaded:"Datei geladen: {{name}}",specReady:"Spezifikation geladen ({{chars}} Zeichen)",apiBaseUrlLabel:"API-Basis-URL",apiAuthLabel:"API-Auth-Header",endpointFilter:"Endpoint-Filter",endpointFilterPlaceholder:"Kommagetrennt: GET /users, POST /orders",featuresTitle:"Funktionen & Optionen",featuresDesc:"Passen Sie die Fähigkeiten Ihres Agents an",introMessage:"Begrüßungsnachricht",introMessageDesc:"Nachricht, die zu Beginn einer Konversation angezeigt wird",quickReplies:"Schnellantworten",quickRepliesDesc:"LLM generiert anklickbare Antwortvorschläge",sentiment:"Sentimentanalyse",sentimentDesc:"Stimmung, Absicht und Dringlichkeit des Nutzers in Echtzeit erkennen",structuredOutput:"Strukturierte Ausgabe",structuredOutputDesc:"LLM antwortet mit einem JSON-Objekt statt mit reinem Text",structuredOutputInfo:"Wenn aktiviert, antwortet das LLM mit einem JSON-Objekt mit strukturierten Feldern. Ein JSON-Schema wird dem Systemprompt angehängt und das Modell wird in den JSON-Antwortmodus versetzt.",builtInTools:"Integrierte Tools",builtInToolsDesc:"Integrierte Tool-Bibliothek von EDDI aktivieren (Rechner, Datum/Zeit usw.)",toolsWhitelist:"Whitelist (leer = alle Tools)",mcpServers:"MCP-Server",mcpServersDesc:"Model Context Protocol Server für externe Tools verbinden",autoDeploy:"Automatisch bereitstellen",autoDeployDesc:"Agent sofort nach Erstellung bereitstellen",environment:"Umgebung",envProduction:"Produktion",envTest:"Test",reviewTitle:"Überprüfen & Erstellen",reviewDesc:"Überprüfen Sie Ihre Konfiguration vor dem Erstellen",reviewType:"Typ",reviewName:"Name",reviewPrompt:"Systemprompt",reviewProvider:"Anbieter",reviewModel:"Modell",reviewSpec:"OpenAPI-Spezifikation",reviewIntro:"Begrüßungsnachricht",reviewDeploy:"Bereitstellen",success:"Agent erfolgreich erstellt!",agentCreated:"Agent erstellt!",deployed:"Bereitgestellt",endpointsParsed:"{{count}} API-Endpoints analysiert",viewAgent:"Agent anzeigen",createAnother:"Weiteren erstellen",allTools:"Alle Werkzeuge",selectSpecific:"Manuell auswählen",allToolsInfo:"Alle {{count}} integrierten Werkzeuge stehen Ihrem Agenten zur Verfügung. Wählen Sie „Manuell auswählen“, um die Auswahl einzuschränken.",availableTools:"Verfügbare Werkzeuge",toolCount:"{{selected}} von {{total}} ausgewählt"},Smt={createWorkflow:"Workflow erstellen",createTitle:"Neuen Workflow erstellen",name:"Name",namePlaceholder:"Mein Workflow",description:"Beschreibung",descriptionPlaceholder:"Beschreiben Sie, was dieser Workflow tut...",noDescription:"Keine Beschreibung",empty:"Noch keine Workflows. Erstellen Sie Ihren ersten Workflow!",confirmDelete:"Möchten Sie diesen Workflow wirklich löschen?",count_one:"{{count}} Workflow",count_other:"{{count}} Workflows",emptyDescription:"Workflows definieren die Verarbeitungspipeline für Ihre Agents."},kmt={title:"Workflow-Details",backToWorkflows:"Zurück zu Workflows",extensions:"Erweiterungen",noExtensions:"Keine Erweiterungen in diesem Workflow",rawConfig:"Rohkonfiguration"},Nmt={title:"Workflow-Editor",pipeline:"Extension Pipeline",addHint:"Erweiterungen hinzufügen, um Ihre Pipeline aufzubauen",addHintDialog:"Erweiterungstyp zum Hinzufügen auswählen",reorder:"Erweiterung verschieben",saved:"Workflow erfolgreich gespeichert",saveError:"Speichern fehlgeschlagen",noTasks:"Keine Aufgaben in diesem Workflow",addTask:"Aufgabe hinzufügen"},Emt={searchPlaceholder:"Nach Gesprächs-ID suchen...",id:"Gespräch",agent:"Agent",state:"Status",lastActivity:"Letzte Aktivität",actions:"Aktionen",empty:"Noch keine Gespräche. Stellen Sie einen Agent bereit und beginnen Sie zu chatten!",confirmDelete:"Möchten Sie dieses Gespräch wirklich löschen?",count_one:"{{count}} Gespräch",count_other:"{{count}} Gespräche",emptyDescription:"Deployen Sie einen Agent und starten Sie eine Konversation über die Chat-Seite."},Lmt={continueChat:"Im Chat fortsetzen",searchTranscript:"Gesprächsverlauf durchsuchen…",exportMd:"Als Markdown exportieren",toolSummary:"Werkzeugnutzung",totalCost:"Gesamtkosten",cacheHitRate:"Cache-Trefferquote"},Dmt={selectAgent:"Agent auswählen...",noAgents:"Keine bereitgestellten Agents verfügbar. Stellen Sie zuerst einen Agent bereit.",placeholder:"Nachricht eingeben...",send:"Senden",newConversation:"Neues Gespräch",endConversation:"Gespräch beenden",streaming:"Streaming",thinking:"Denkt nach...",connectionError:"Verbindungsfehler. Bitte erneut versuchen.",empty:"Wählen Sie einen Agent und beginnen Sie zu chatten!",history:"Verlauf",undo:"Letzte Nachricht rückgängig",redo:"Nachricht wiederherstellen",continueConversation:"Fortsetzen",noHistory:"Noch kein Gesprächsverlauf.",attach:"Datei anhängen",attachUploading:"Wird hochgeladen...",attachSuccess:"Datei angehängt",attachError:"Datei konnte nicht hochgeladen werden",retry:"Letzten Schritt wiederholen",retrySuccess:"Schritt erneut ausgeführt",retryError:"Wiederholung fehlgeschlagen",showActivity:"Aktivität anzeigen",hideActivity:"Aktivität ausblenden",scrollToBottom:"Nach unten scrollen",copyMessage:"Nachricht kopieren",copied:"Kopiert!",activity:{processing:"Wird verarbeitet…",steps:"Schritte",toolCalls:"Werkzeugaufrufe",toolCall:"Werkzeugaufruf",toolResult:"Ergebnis"},channels:{title:"Kanäle",subtitle:"Agenten und Gruppen mit Messaging-Plattformen wie Slack verbinden"},context:{conversationId:"Gesprächs-ID",agentVersion:"Agentenversion",startTime:"Gestartet",stepCount:"Schritte",show:"Gesprächsinfo anzeigen",hide:"Gesprächsinfo ausblenden"},agentTyping:"Agent tippt"},Tmt={unnamed:"Unbenannte Ressource",noDescription:"Keine Beschreibung",backToResources:"Zurück zu Ressourcen",backToList:"Zurück zu {{type}}",unknownType:"Unbekannter Ressourcentyp",rawConfig:"Rohkonfiguration",rawConfigHint:"JSON-Konfiguration für diese Ressource",create:"{{type}} erstellen",createTitle:"{{type}} erstellen",createDescription:"Erstellen Sie eine leere {{type}}-Konfiguration. Sie können sie nach dem Erstellen bearbeiten.",confirmDelete:"Möchten Sie diese(n) {{type}} wirklich löschen?",empty:"Noch keine {{type}}-Ressourcen.",itemCount_one:"{{count}} Element",itemCount_other:"{{count}} Elemente",count_one:"{{count}} Ressource",count_other:"{{count}} Ressourcen",types:{rules:{name:"Verhaltensregeln",description:"Gesprächsflussregeln und Entscheidungslogik definieren"},apicalls:{name:"HTTP-Aufrufe",description:"Externe API-Integrationen und Webhooks konfigurieren"},output:{name:"Ausgabesets",description:"Agent-Antwortvorlagen und Ausgabevarianten verwalten"},dictionary:{name:"Wörterbücher",description:"Wort- und Phrasenerkennungsmuster definieren"},llm:{name:"LLM",description:"KI-Modelle, Prompts und Tool-Bindungen konfigurieren"},propertysetter:{name:"Eigenschafts-Setter",description:"Gesprächseigenschaften setzen und Slot-Filling verwalten"},mcpcalls:{name:"MCP-Aufrufe",description:"MCP-Server-Verbindungen und deterministische Tool-Aufrufe konfigurieren"},rag:{name:"Wissensbasen",description:"RAG-Wissensbasen für die Dokumentensuche konfigurieren"},snippets:{name:"Prompt-Snippets",description:"Wiederverwendbare Systemprompt-Bausteine fuer die Vorlagenkomposition"}},emptyDescription:"Erstellen Sie Ihre erste {{type}}, um sie in Workflows zu verwenden."},Imt={formTab:"Formular",jsonTab:"JSON",save:"Speichern",discard:"Verwerfen",saving:"Speichern...",saved:"Erfolgreich gespeichert",saveError:"Speichern fehlgeschlagen",dirty:"Ungespeicherte Änderungen",version:"Version",versionPicker:"Version auswählen",readOnly:"Schreibgeschützt",formPlaceholder:"Visueller Editor kommt bald. Verwenden Sie den JSON-Tab zum Bearbeiten.",jsonSchema:"Schema-Validierung aktiv",cascadeMode:"Änderungen werden an übergeordneten Workflow und Agent weitergegeben",usedInAgents:"Wird in {{count}} Agent(s) verwendet",updateUsageHint:"Ausgewählte Workflows und Agents auf die neue Version aktualisieren?",updateUsage:"Auswahl aktualisieren",skipUpdate:"Überspringen",cascading:"Aktualisiere...",cascadeSuccess:"Kaskaden-Update abgeschlossen",invalidJson:"Ungültiges JSON — wechseln Sie zum JSON-Tab zur Korrektur."},Amt={appendActions:"Aktionen anhängen",expressionsAsActions:"Ausdrücke als Aktionen",groups:"Verhaltensgruppen",addGroup:"Gruppe hinzufügen",groupName:"Gruppenname",executionStrategy:"Ausführungsstrategie",rules:"Regeln",addRule:"Regel hinzufügen",ruleName:"Regelname",actions:"Aktionen",noActions:"Keine Aktionen",addAction:"Hinzufügen",actionPlaceholder:"z.B. greet, get_weather",conditions:"Bedingungen",addCondition:"Bedingung hinzufügen",conditionType:"Bedingungstyp",nestedConditions:"Verschachtelte Bedingungen",configKey:"Schlüssel",configValue:"Wert",addConfig:"Konfiguration hinzufügen",removeRule:"Regel entfernen",removeGroup:"Gruppe entfernen",removeCondition:"Bedingung entfernen",noGroups:"Keine Verhaltensgruppen definiert",noRules:"Keine Regeln in dieser Gruppe",noConditions:"Keine Bedingungen"},Rmt={targetServerUrl:"Ziel-Server URL",targetServerUrlPlaceholder:"https://api.example.com",calls:"HTTP-Aufrufe",addCall:"HTTP-Aufruf hinzufügen",callName:"Aufrufname",callDescription:"Beschreibung",descriptionPlaceholder:"Beschreibung in natürlicher Sprache für LLM-Agents",request:"Anfrage",method:"Methode",path:"Pfad",pathPlaceholder:"/api/endpoint",headers:"Header",addHeader:"Header hinzufügen",queryParams:"Query-Parameter",addQueryParam:"Query-Parameter hinzufügen",contentType:"Inhaltstyp",body:"Anfragekörper",bodyPlaceholder:"JSON Body-Vorlage...",parameters:"Parameter (für LLM-Agents)",paramName:"Parametername",paramDescription:"Beschreibung",addParam:"Parameter hinzufügen",options:"Optionen",saveResponse:"Antwort speichern",responseObjectName:"Response-Objektname",responseHeaderObjectName:"Response-Header-Objektname",fireAndForget:"Senden und vergessen",batchCalls:"Batch-Aufrufe",iterationObjectName:"Iterations-Objektname",prePostInstructions:"Vor-/Nachbearbeitung",preRequest:"Vor Request",postResponse:"Nach Response",removeCall:"Aufruf entfernen",noCalls:"Keine HTTP-Aufrufe konfiguriert",actions:"Auslösende Aktionen",noActions:"Keine Aktionen",actionPlaceholder:"z.B. get_weather"},Mmt={tasks:"LLM-Aufgaben",addTask:"Task hinzufügen",noTasks:"Keine LLM Tasks konfiguriert",removeTask:"Task entfernen",taskId:"Aufgaben-ID",description:"Beschreibung",descriptionPlaceholder:"Was diese Aufgabe bewirkt",triggerActions:"Auslösende Aktionen",noActions:"Keine Aktionen",actionPlaceholder:"z.B. help, chat",systemPrompt:"Systemprompt",systemPromptPlaceholder:"Du bist ein hilfreicher Assistent...",modelParams:"Modellparameter",addParam:"Parameter hinzufügen",agentMode:"Agentenmodus",enableBuiltInTools:"Integrierte Tools aktivieren",toolWhitelist:"Tool Whitelist (leer = alle)",enableHttpCallTools:"HTTP Call Tools automatisch erkennen",enableHttpCallToolsDesc:"Alle httpcall-Erweiterungen des Workflows automatisch als LLM-Tools bereitstellen",httpCallTools:"HTTP-Aufruf-Tool-URIs",httpCallToolsHint:"Explizite httpcall-URIs (zusätzlich zu automatisch erkannten)",addTool:"Tool URI hinzufügen",mcpServers:"MCP-Server",mcpServersDesc:"Externe MCP-Server, deren Tools dem LLM zur Verfügung stehen",addMcpServer:"MCP Server hinzufügen",mcpUrlPlaceholder:"http://localhost:7070/mcp",mcpName:"Name",mcpApiKey:"API Key / Vault-Referenz",historyLimit:"Verlaufslimit",historyLimitHint:"(-1 = unbegrenzt)",budgetPerf:"Budget & Leistung",maxBudget:"Max. Budget ($)",costTracking:"Kostenerfassung",toolCaching:"Werkzeug-Caching",rateLimiting:"Ratenbegrenzung",defaultRate:"Standardrate (Anfr./Min.)",prePostInstructions:"Vor-/Nachbearbeitung",preRequest:"Vor Request",postResponse:"Nach Response",enableMcpCallTools:"MCP-Werkzeuge automatisch erkennen",enableMcpCallToolsDesc:"Alle mcpcalls-Erweiterungen aus dem Workflow automatisch als LLM-Werkzeuge bereitstellen",a2aAgents:"A2A-Agenten",a2aAgentsDesc:"Entfernte A2A-kompatible Agenten, deren Fähigkeiten zu LLM-Werkzeugen werden",addA2aAgent:"A2A-Agent hinzufügen",a2aUrlPlaceholder:"https://remote.example.com/a2a/agents/...",a2aName:"Anzeigename",a2aApiKey:"${vault:my-a2a-key}",a2aTimeout:"Zeitlimit (ms)",a2aSkillsFilter:"Fähigkeitenfilter (leer = alle)",cascade:"Modellkaskade",cascadeDesc:"Try a cheap/fast model first. If confidence is too low, automatically escalate to a more powerful (and expensive) model.",cascadeEnable:"Modellkaskade aktivieren",cascadeStrategy:"Strategie",strategyCascade:"Schrittweise Eskalation",strategyParallel:"Parallel (zukünftig)",cascadeStrategyHint:"Beginnt mit dem günstigsten Modell und eskaliert bei niedriger Konfidenz",cascadeEvalStrategy:"Konfidenzbewertung",cascadeEvalHint:"Wie bestimmt wird, ob eine Antwort ausreichend gut ist",evalStructured:"Strukturierte Ausgabe (JSON)",evalHeuristic:"Heuristisch (Unsicherheitserkennung)",evalJudge:"Bewertungsmodell (Sub-LLM)",evalNone:"Keine (immer akzeptieren)",cascadeInAgent:"Kaskade auch im Agentenmodus (mit Werkzeugen) verwenden",cascadeSteps:"Cascade Steps",cascadeStepsDesc:"Order matters: first step tried first. Last step is always accepted.",cascadeModelName:"z. B. claude-sonnet-4-6",cascadeConfidence:"Min. Confidence (0-1)",cascadeConfidencePlaceholder:"leer = immer akzeptieren",cascadeTimeout:"Zeitlimit (ms)",addCascadeStep:"Kaskadenschritt hinzufügen",parallelExecution:"Parallele Werkzeugausführung",parallelExecutionDesc:"Run independent tool calls concurrently",parallelTimeout:"Zeitlimit (ms)",maxToolIterations:"Max. Werkzeug-Iterationen",maxToolIterationsHint:"(Standard 10)",toolRateLimits:"Ratenlimits pro Werkzeug",toolRateLimitsDesc:"Override default rate for specific tools",toolName:"Werkzeugname",addToolRate:"Ratenlimit hinzufügen",retryConfig:"Wiederholungskonfiguration",retryDesc:"Configure automatic retries with exponential backoff.",retryMaxAttempts:"Max. Versuche",retryDelay:"Anfangsverzögerung (ms)",retryMultiplier:"Backoff-Faktor",retryMaxDelay:"Max. Verzögerung (ms)",ragConfig:"RAG (Wissensabruf)",ragDesc:"Augment LLM responses with retrieved documents.",ragHttpCall:"HTTP-Aufruf-URI",ragEmbeddingModel:"Embedding-Modell",ragEmbeddingModelPlaceholder:"z. B. text-embedding-3-small",ragEmbeddingStore:"Embedding-Speicher",ragEmbeddingStorePlaceholder:"z. B. pgvector, qdrant",ragMaxResults:"Max. Ergebnisse",ragMinScore:"Min Similarity Score (0-1)",moveDown:"Nach unten",moveUp:"Nach oben",execution:"Ausführung",budgetCosts:"Budget & Kosten",preRequestDesc:"Eigenschaften vor der LLM-Ausführung setzen oder transformieren.",postResponseDesc:"LLM-Ausgabe verarbeiten: Eigenschaften setzen, Ausgabe-Nachrichten erstellen und Quick Replies generieren.",postPropertyInstructions:"Eigenschaften-Anweisungen",postOutputInstructions:"Ausgabe-Anweisungen",postQrInstructions:"Quick Reply-Anweisungen",allSkills:"Alle Fähigkeiten",skillPlaceholder:"z. B. order-tracking",modeAgent:"Agent",modeChat:"Chat",perMinute:"/Min.",allTools:"Alle Werkzeuge",selectSpecific:"Manuell auswählen",allToolsInfo:"Alle {{count}} integrierten Werkzeuge stehen dem LLM zur Verfügung. Wählen Sie „Manuell auswählen“, um die Auswahl einzuschränken.",availableTools:"Verfügbare Werkzeuge",toolCount:"{{selected}} von {{total}} ausgewählt",toolSources:"Workflow-Werkzeugquellen",toolSourcesInfo:"Beide Quellen sind standardmäßig aktiv — alle HTTP- und MCP-Aufrufe im Workflow werden automatisch als LLM-Werkzeuge bereitgestellt. Deaktivieren Sie eine Quelle, um sie auszuschließen.",included:"Enthalten"},Pmt={language:"Sprache",langPlaceholder:"z.B. en, de",outputSets:"Ausgabesets",addOutputSet:"Ausgabeset hinzufügen",noOutputSets:"Keine Ausgabesets konfiguriert",actionName:"Aktionsname",timesOccurred:"×",removeOutput:"Entfernen",outputs:"Ausgaben",alternativeGroup:"Alternatives",addAlternative:"Alternative hinzufügen",addOutputGroup:"Ausgabegruppe hinzufügen",textPlaceholder:"Ausgabetext...",urlPlaceholder:"URL…",delayMs:"Verzögerung (ms)",quickReplies:"Schnellantworten",noQuickReplies:"Keine Quick Replies",addQuickReply:"Quick Reply hinzufügen",qrValue:"Button-Text",qrExpressions:"Ausdrücke",default:"Standard"},Omt={setters:"Eigenschafts-Setter",addSetter:"Setter hinzufügen",noSetters:"Keine Property Setter konfiguriert",removeSetter:"Entfernen",triggerActions:"Auslösende Aktionen",noActions:"Keine Aktionen",actionPlaceholder:"z.B. greet, fallback",properties:"Eigenschaften",noProperties:"Keine Eigenschaften",addProperty:"Eigenschaft hinzufügen",propName:"Eigenschaftsname",propValue:"Wert / Ausdruck",fromPath:"Quellpfad",fromObjectPath:"fromObjectPath",override:"Überschreiben",propsCount:"Eigensch.",untitled:"(keine Aktionen)"},jmt={language:"Sprache",langPlaceholder:"z.B. en, de",words:"Wörter",addWord:"Wort hinzufügen",wordPlaceholder:"z.B. hallo",phrases:"Phrasen",addPhrase:"Phrase hinzufügen",phrasePlaceholder:"z.B. guten Morgen",regExs:"Reguläre Ausdrücke",addRegEx:"RegEx hinzufügen",regexPlaceholder:"Regulärer Ausdruck",expressionPlaceholder:"z.B. greeting(hello)",frequency:"Häufigkeit",none:"Keine definiert"},Fmt={title:"Koordinator-Dashboard",subtitle:"Konversationsverarbeitung überwachen und Dead-Letter-Einträge verwalten",type:"Coordinator-Typ",connection:"Verbindung",processed:"Verarbeitete Aufgaben",deadLettered:"Unzustellbar",activeQueues:"Aktive Queues",queued:"in Warteschlange",deadLetterTitle:"Unzustellbare Nachrichten",noDeadLetters:"Keine Dead-Letter-Einträge",colId:"ID",colConversation:"Gespräch",colError:"Fehler",colTime:"Zeitpunkt",colActions:"Aktionen",replay:"Wiederholen",discard:"Verwerfen",purgeAll:"Alle löschen",confirmPurge:"Alle löschen?",yes:"Ja",cancel:"Abbrechen",replaySuccess:"Dead-Letter erneut eingereiht",replayError:"Wiederholung fehlgeschlagen",discardSuccess:"Dead-Letter verworfen",discardError:"Verwerfen fehlgeschlagen",purgeSuccess:"Alle Dead-Letter-Einträge gelöscht",purgeError:"Löschen fehlgeschlagen",empty:"Keine Coordinator-Daten verfügbar",emptyHint:"Der Coordinator-Dienst startet möglicherweise noch. Daten erscheinen automatisch."},Bmt={expand:"Erweitern",expandHint:"Vollbild öffnen (Strg+Umschalt+F)",close:"Fertig",lines:"Zeilen",chars:"Zeichen",fullscreenTitle:"Inhaltseditor",fullscreenDescription:"Vollbild-Inhaltseditor. Escape zum Schließen."},Hmt={title:"Protokolle",description:"Live-Protokollstream überwachen oder historische Logs durchsuchen.",tabLive:"Live",tabHistory:"Verlauf",connected:"Verbunden",disconnected:"Getrennt",filterAgent:"Agenten-ID…",filterConversation:"Gesprächs-ID...",filterInstance:"Instanz-ID...",allLevels:"Alle Stufen",pause:"Pause",resume:"Fortsetzen",clear:"Löschen",search:"Suchen",waitingForLogs:"Warte auf Protokolle...",connectingStream:"Verbinde mit Stream...",noHistoryLogs:"Keine historischen Logs gefunden.",entryCount:"{{count}} Einträge",showStacktrace:"Stacktrace anzeigen ({{count}} Frames)",hideStacktrace:"Stacktrace ausblenden",allAgents:"Alle Agenten",allConversations:"Alle Gespräche",waitingHint:"Logs erscheinen hier, sobald sie vom Backend gestreamt werden.",noHistoryHint:"Versuchen Sie, die Filter anzupassen oder nach einem anderen Agent oder Konversation zu suchen.",searchConversations:"Suche nach ID, Agent, Benutzer…",stepsCount:"{{count}} Schritte",noConversationsFound:"Keine Konversationen gefunden",useConversationId:"ID verwenden: {{id}}",searchLogs:"Logs durchsuchen…",errors:"Fehler",warnings:"Warnungen",infos:"Info",debugs:"Debug",filteredCount:"{{shown}} von {{total}} Einträgen",copyEntry:"Logeintrag kopieren",export:"Exportieren",stateReady:"Bereit",stateActive:"Aktiv",stateError:"Fehler",stateEnded:"Beendet"},Wmt={title:"Geheimnistresor",description:"Verschlüsselte Secrets im Vault verwalten. Werte werden nie offengelegt.",tenantId:"Mandanten-ID",refresh:"Secrets laden",create:"Secret hinzufügen",createTitle:"Secret hinzufügen",keyName:"Schlüsselname",keyNameLabel:"Schlüsselname",keyNamePlaceholder:"z.B. apiKey, dbPassword",valueLabel:"Secret-Wert",valuePlaceholder:"Secret-Wert eingeben…",storeWarning:"Der Wert wird verschlüsselt. Er kann nach dem Speichern nicht mehr abgerufen werden.",store:"Secret speichern",storeSuccess:'Secret "{{key}}" gespeichert',deleteSuccess:'Secret "{{key}}" gelöscht',created:"Erstellt",lastAccessed:"Letzter Zugriff",checksum:"Prüfsumme",actions:"Aktionen",confirmDeleteTitle:"Secret löschen",confirmDeleteMessage:'Möchten Sie "{{key}}" wirklich dauerhaft löschen? Diese Aktion kann nicht rückgängig gemacht werden.',empty:"Keine Secrets gefunden",emptyHint:"Erstellen Sie ein Secret oder ändern Sie die Namespace-Filter oben.",vaultUp:"Vault online",vaultDown:"Vault offline",descriptionLabel:"Beschreibung (optional)",descriptionPlaceholder:"z. B. OpenAI-API-Schlüssel für Produktion",descriptionCol:"Beschreibung",reference:"Referenz",willUseRef:"Referenz:",copyRef:"Tresor-Referenz kopieren",refCopied:"Kopiert: {{ref}}",lastRotated:"Zuletzt rotiert",scopeExplanation:"Geheimnisse gelten pro Mandant und werden von allen Agenten geteilt. Referenzieren Sie sie in Konfigurationen mit ${vault:keyName}. Der Zugriff wird durch die Konfigurationsautorenschaft gesteuert.",creatingFor:'Speicherung im Mandanten "{{tenant}}" — für alle Agenten verfügbar',vaultNotConfigured:"Geheimnistresor ist nicht konfiguriert",viewDocs:"Dokumentation anzeigen",selectAgentFirst:"Bitte zuerst einen Agenten auswählen",tableTitle:'{{count}} Geheimnis(se) im Mandanten "{{tenant}}"'},Vmt={title:"Prüfprotokoll",description:"Durchsuchen Sie das unveränderliche Audit-Protokoll für Compliance und Debugging.",byConversation:"Nach Gespräch",byAgent:"Nach Agent",selectAgent:"Agent auswählen…",conversationIdPlaceholder:"Gesprächs-ID eingeben...",agentIdPlaceholder:"Agent ID eingeben...",versionPlaceholder:"Version (optional)",search:"Suchen",entries:"Einträge",conversations:"Gespräche",totalDuration:"gesamt",totalCost:"Gesamtkosten",step:"Schritt",tasks:"Aufgaben",input:"Eingabe",output:"Ausgabe",llmDetail:"LLM-Detail",toolCalls:"Werkzeugaufrufe",hmacIntegrity:"HMAC-Integrität verifiziert",empty:"Audit-Einträge suchen",emptyHint:"Geben Sie oben eine Gesprächs-ID ein, um den Audit Trail zu durchsuchen.",emptyAgent:"Agent auswählen, um seinen Audit Trail anzuzeigen",emptyAgentHint:"Wählen Sie einen deployten Agent aus der Dropdown-Liste, um alle Audit-Einträge zu sehen.",noResults:"Keine Audit-Einträge gefunden",noResultsHint:"Versuchen Sie eine andere ID oder prüfen Sie, ob das Gespräch verarbeitet wurde.",loadMore:"Mehr laden",export:"Exportieren",autoRefreshToggle:"Auto-Aktualisierung umschalten (alle 10s)",autoRefreshOn:"Auto",autoRefreshOff:"Auto",integrityVerified:"Alle Einträge kryptographisch signiert",integrityVerifiedDesc:"{{count}} of {{total}} entries have HMAC-SHA256 signatures",integrityPass:"SIGNED",integrityPartial:"Teilweise signiertes Prüfprotokoll",integrityPartialDesc:"{{count}} von {{total}} Einträgen haben HMAC-Signaturen",integrityNone:"Unsignierte Audit-Einträge",integrityNoneDesc:"Konfigurieren Sie einen Vault-Master-Key, um automatische HMAC-SHA256-Signierung fuer alle zukuenftigen Audit-Eintraege zu aktivieren.",signed:"Signiert",allSigned:"Alle signiert"},zmt={title:"Zeitpläne",subtitle:"Geplante Agent-Trigger verwalten — Cron-Jobs und Heartbeats",create:"Zeitplan erstellen",createTitle:"Zeitplan erstellen",createSuccess:"Zeitplan erfolgreich erstellt",createError:"Zeitplan konnte nicht erstellt werden",creating:"Erstelle...",name:"Name",namePlaceholder:"z.B. Täglicher Health Check",triggerType:"Trigger-Typ",cronExpression:"Cron-Ausdruck",interval:"Intervall (Sekunden)",agentId:"Agent ID",agentIdPlaceholder:"Agent ID eingeben...",environment:"Umgebung",message:"Nachricht",messagePlaceholder:"Nachricht an den Agent",conversationStrategy:"Konversationsstrategie",total:"Zeitpläne gesamt",active:"Aktiv",failedCount:"Fehlgeschlagen / Dead-Lettered",nextFireLabel:"Nächste Ausführung",tableTitle:"Alle Zeitpläne",empty:"Noch keine Zeitpläne",emptyHint:"Erstellen Sie einen Zeitplan, um Agent-Trigger zu automatisieren.",colName:"Name",colType:"Typ",colSchedule:"Zeitplan",colAgent:"Agent",colStatus:"Status",colNextFire:"Nächste Ausführung",colLastFired:"Letzte Ausführung",colActions:"Aktionen",enable:"Aktivieren",disable:"Deaktivieren",enabled:"Zeitplan aktiviert",disabled:"Zeitplan deaktiviert",toggleError:"Zeitplan konnte nicht umgeschaltet werden",fireNow:"Jetzt ausführen",fired:"Zeitplan erfolgreich ausgeführt",fireError:"Ausführung fehlgeschlagen",retry:"Wiederholen",retrySuccess:"Zeitplan erneut eingereiht",retryError:"Wiederholung fehlgeschlagen",deleteSuccess:"Zeitplan gelöscht",deleteError:"Zeitplan konnte nicht gelöscht werden",fireHistory:"Ausführungsverlauf"},Umt={title:"Debug",tabPipeline:"Pipeline",tabCosts:"Kosten",tabMemory:"Speicher",tabLogs:"Protokolle",tabPrompt:"Prompt",turn:"Zug",latest:"Neueste",noPipeline:"Senden Sie eine Nachricht, um den Pipeline-Verlauf zu sehen",processing:"Verarbeite...",actions:"Aktionen",confidence:"Konfidenz",duration:"Dauer"},$mt={thisTurn:"Dieser Zug",conversationTotal:"Gespräch gesamt",tokens:"Tokens",cost:"Kosten",duration:"Dauer",model:"Modell",toolCalls:"Tool-Aufrufe",toolUsage:"Tool-Nutzung",cacheStats:"Cache",hitRate:"Trefferquote",empty:"Senden Sie eine Nachricht, um Kostenmetriken zu sehen",in:"ein",out:"aus",total:"gesamt",calls:"Aufrufe"},qmt={title:"Konversationsspeicher",noConversation:"Starten Sie eine Konversation, um den Speicher zu prüfen",empty:"Keine Speicherdaten verfügbar",properties:"Eigenschaften",step:"Schritt",keys:"Schlüssel",input:"Eingabe"},Kmt={noAgent:"Wählen Sie einen Agent, um Logs zu sehen",search:"Suchen...",pause:"Pause",resume:"Fortsetzen",clear:"Leeren",waiting:"Warte auf Logs...",connected:"Verbunden",disconnected:"Getrennt",logOutput:"Log-Ausgabe"},Gmt={noConversation:"Starten Sie ein Gespräch, um Prompts zu prüfen",noLlm:"Noch keine LLM-Interaktionen gefunden",turn:"Zug",latest:"Letzter",tokens:"Tokens",model:"Modell",cost:"Kosten",copy:"Prompt kopieren",copied:"Kopiert!",replay:"Diesen Zug wiederholen",toolCalls:"Tool-Aufrufe",step:"Schritt",roleSystem:"Systemprompt",roleUser:"Benutzer",roleAssistant:"Assistent",roleTool:"Tool-Ergebnis"},Ymt={preview:"Vorschau",edit:"Bearbeiten",switchToPreview:"Aufgelösten Prompt anzeigen",switchToEdit:"Zur Bearbeitung wechseln",refresh:"Aktualisieren",sampleData:"Beispieldaten (ohne Gespräch)",disclaimerReal:"Die Vorschau verwendet die Qute-Engine mit echten Gesprächsdaten.",disclaimerSample:"Die Vorschau verwendet die Qute-Engine mit Beispieldaten. Wählen Sie ein Gespräch für echte Werte.",resolvedPrompt:"Aufgelöster Prompt",copy:"Kopieren",copied:"Kopiert!",error:"Fehler beim Auflösen der Vorlage",loading:"Vorlage wird aufgelöst…",availableVariables:"Verfügbare Variablen",copyVariable:"Klicken, um Variablenreferenz zu kopieren",varProperties:"Eigenschaften",varMemory:"Erinnerung",varContext:"Kontext",varSnippets:"Snippets",varUserInfo:"Benutzerinfo",varConversationInfo:"Gesprächsinfo",varInput:"Eingabe",varConversationLog:"Gesprächsprotokoll"},Qmt={title:"Agent Studio",subtitle:"Erstellen, testen und debuggen Sie Agents in einem Workspace",pipeline:"Pipeline",editor:"Editor",debug:"Debug & Chat",selectStage:"Klicken Sie auf eine Phase, um ihren Editor zu öffnen",openInStudio:"Im Studio öffnen",loading:"Lade Agent...",notFound:"Agent nicht gefunden",hideChat:"Chat ausblenden",showChat:"Chat anzeigen",openEditor:"Im Editor öffnen",editorComingSoon:"Integrierter Editor kommt bald",noPipeline:"Keine Pipeline-Phasen",type:{parser:"Parser",rules:"Regeln",property:"Eigenschafts-Setter",apicalls:"API-Aufrufe",llm:"LLM",output:"Ausgabe","output.template":"Ausgabevorlage",mcpcalls:"MCP-Aufrufe",rag:"Wissensbasen",dictionary:"Wörterbuch"},landingDescription:"Wählen Sie einen Agenten, um den visuellen Pipeline-Editor, Debugger und Live-Chat zu öffnen",noAgents:"Keine Agenten gefunden — erstellen Sie einen auf der Agenten-Seite",chat:"Chat",backToAgent:"Zurück zum Agenten",selectStageHint:"Wählen Sie eine Erweiterung in der Pipeline, um deren Konfiguration direkt zu bearbeiten",noConfig:"Diese Pipeline-Stufe hat keine Konfigurations-URI",unsupportedType:"Für diesen Erweiterungstyp ist kein Editor verfügbar"},Xmt={general:"Allgemein",kbName:"Name der Knowledge Base",kbNamePlaceholder:"z.B. produkt-dokus, faq, internes-wiki",kbNameHint:"Wird verwendet, um auf diese KB aus LLM-Tasks zuzugreifen",embeddingModel:"Embedding-Modell",provider:"Anbieter",embeddingParams:"Provider-Parameter",embeddingParamsHint:"Modellname, API-Key (nutzen Sie ${vault:...} für Secrets), etc.",vectorStore:"Vektorspeicher",storeType:"Store-Typ",storeParams:"Verbindungsparameter",chunking:"Dokumenten-Chunking",chunkStrategy:"Strategie",chunkSize:"Chunk-Größe",chunkOverlap:"Überlappung",overlapHint:"Überlappung hilft, den Kontext zwischen Chunks zu erhalten",chunkPreview:"Vorschau (wie ein Dokument aufgeteilt wird)",chunkBlocks:"{{count}} Chunks à ~{{size}} Zeichen mit {{overlap}} Zeichen Überlappung",retrievalDefaults:"Abruf-Standards",retrievalHint:"Diese Standards können pro Task in der LLM-Konfiguration überschrieben werden.",maxResults:"Max. Ergebnisse (top-K)",minScore:"Min. Ähnlichkeits-Score",ingestion:"Dokumenten-Aufnahme",dropFiles:"Dokumente hierhin ziehen zum Aufnehmen",dropHint:"Text, Markdown oder beliebige Textdateien",browse:"Durchsuchen",pasteText:"Oder Textinhalt einfügen",pastePlaceholder:"Dokumententext hier einfügen...",ingestText:"Text aufnehmen",ingestionHistory:"Aufnahme-Status",saveFirstIngestion:"Speichern Sie diese Knowledge Base zuerst, um die Dokumenten-Aufnahme zu aktivieren.",addParam:"Parameter hinzufügen"},Zmt={welcome:{title:"Willkommen bei EDDI",subtitle:"Ihr KI-Agent-Kommandozentrum",introText:"Der EDDI Manager ist Ihr Werkzeug zum Erstellen, Testen und Betreiben von KI-Agenten.",capabilitiesTitle:"Was Sie tun können",capabilitiesSubtitle:"Alles, was Sie für produktionsreife KI-Agents benötigen",buildAgents:"Agents erstellen",buildAgentsDesc:"KI-Agents mit dem Wizard oder von Grund auf konfigurieren",designWorkflows:"Workflows entwerfen",designWorkflowsDesc:"Drag-and-Drop Pipeline-Builder mit Verhaltensregeln und Tools",testRealtime:"In Echtzeit testen",testRealtimeDesc:"Chatten Sie mit Agents inklusive Streaming-Antworten und Debugging",monitorOperate:"Überwachen & Betreiben",monitorOperateDesc:"Gespräche, Audit-Trails, Secrets und Quotas – an einem Ort",readyTitle:"Bereit loszulegen?",readySubtitle:"Sie können jede Tour später über das Hilfe-Menü neu starten",startTour:"Tour starten",exploreOwn:"Ich schaue mich selbst um"},tour:{back:"Zurück",next:"Weiter",skip:"Überspringen",finish:"Beenden",stepOf:"Schritt {{current}} von {{total}}",dashboard:{title:"Dashboard-Tour",step1Title:"Ihr Kommandozentrum",step1Desc:"Die Seitenleiste gliedert alles in Management, Entwicklung und Betrieb.",step2Title:"Plattform im Überblick",step2Desc:"Live-Zahlen zu Agents, Workflows und Gesprächen. Klicken Sie auf Kacheln für den Direktzugriff.",step3Title:"Schnellaktionen",step3Desc:"Mit dem Agent Wizard erstellen Sie den ersten Agent in unter 2 Minuten.",step4Title:"Nach Ihren Wünschen",step4Desc:"Wechseln Sie das Theme oder die Sprache über die jeweiligen Optionen."},agents:{title:"Agents-Tour",step1Title:"Agenten-Assistent",step1Desc:"Der Wizard führt Sie durch die Agenten-Erstellung: Modellauswahl, Prompting und Deployment.",step2Title:"Manuelle Erstellung",step2Desc:"Erstellen Sie blanke Agents und konfigurieren Sie sie mit voller JSON-Kontrolle.",step3Title:"Suchen & Filtern",step3Desc:"Finden Sie Agents sofort und wechseln Sie zwischen Karten- und Listenansicht.",step4Title:"Ihre Agent-Flotte",step4Desc:"Klicken Sie auf Agenten, um zur Detailseite für Deployment, Chat und Workflows zu gelangen."},workflows:{title:"Workflows-Tour",step1Title:"Workflows erstellen",step1Desc:"Workflows definieren die Prozessier-Pipeline – eine Sequenz von Tasks wie LLM-Aufrufe oder Regeln.",step2Title:"Ihre Workflows",step2Desc:"Klicken Sie zur Bearbeitung auf den Drag-and-Drop Editor.",step3Title:"Aufgeräumte Ansicht",step3Desc:"Suchen Sie nach Namen und wechseln Sie zwischen Grid und sortierbaren Tabellen."},chat:{title:"Chat-Tour",step1Title:"Agent wählen",step1Desc:"Wählen Sie einen deployten Agent für ein Gespräch aus.",step2Title:"Streaming-Modus",step2Desc:"Token-Streaming in Echtzeit zeigt Worte einzeln – gut für Latenzprüfungen.",step3Title:"Gesprächshistorie",step3Desc:"Öffnen Sie die Seitenleiste, um vorherige Unterhaltungen fortzuführen.",step4Title:"Chat starten",step4Desc:"Mit Eingabe antwortet der Agent sofort unter Nutzung Ihrer Tools."},channels:{title:"Kanäle",subtitle:"Agenten und Gruppen mit Messaging-Plattformen wie Slack verbinden"},resources:{title:"Ressourcen-Tour",step1Title:"Erweiterungs-Bibliothek",step1Desc:"Diese Ressourcen sind die Bausteine von Workflows.",step2Title:"LLM-Konfigurationen",step2Desc:"Prägen Sie das Gehirn des Agenten: Parameter, Prompts und Backup-Modelle.",step3Title:"Regeln & API",step3Desc:"Definieren Sie API-Calls oder statische Flow-Bedingungen, die auch als Tools dienen können."},conversations:{title:"Konversations-Tour",step1Title:"Suchfunktion",step1Desc:"Gespräche schnell per ID, Agent oder Nachricht finden.",step2Title:"Status-Filter",step2Desc:"Filterung nach Aktiv, Fehler, In Arbeit etc.",step3Title:"Gesprächsliste",step3Desc:"Jede Unterhaltung lässt sich zur detaillierten Debug-Anlayse öffnen."},groups:{title:"Diskussionsgruppen-Tour",step1Title:"Gruppe anlegen",step1Desc:"Sammeln Sie Agents in Gruppen für strukturiertes Feedback.",step2Title:"Gruppen-Suche",step2Desc:"Gruppen gezielt durchsuchen.",step3Title:"Umgebungen steuern",step3Desc:"Polices bearbeiten oder verwaiste Gruppen entfernen."},logs:{title:"Service-Logs-Tour",step1Title:"Live vs Historie",step1Desc:"Wählen Sie zwischen Live-Streams und Archivsuche.",step2Title:"Stream-Filter",step2Desc:"Nach Agents oder bestimmten Logleveln sortieren.",step3Title:"Exportieren",step3Desc:"Filter logisch anwenden und als Text für Analysen herunterladen."},secrets:{title:"Vault-Tour",step1Title:"Secret anlegen",step1Desc:"Legen Sie z.B. API-Keys verschlüsselt an.",step2Title:"Mandanten-Trennung",step2Desc:"Vault-Anzeige und Schlüssel immer pro Tenant isolieren.",step3Title:"Referenz-Syntax",step3Desc:"Fügen Sie Secrets dynamisch zur Config hinzu, ohne Passwörter direkt in JSON zu notieren."},audit:{title:"Audit-Tour",step1Title:"Suchmodus",step1Desc:"Nachprüfbare Ausführungen (Audits) nach ID und Agent suchen.",step2Title:"Suche ausführen",step2Desc:"Audits garantieren Nachvollziehbarkeit verifizierbarer Histories.",step3Title:"Ledger Export",step3Desc:"Exportieren von Audits ins JSON-Format zur Einhaltung rechtlicher Standards."},schedules:{title:"Schedules-Tour",step1Title:"Trigger planen",step1Desc:"Legen Sie Cron-Jobs oder Heartbeats an, die Agents in gewählten Intervallen antriggern.",step2Title:"System-Rhythmus",step2Desc:"Prüfen Sie Gesamtsumme oder fehlschlagende Scheduled Tasks.",step3Title:"Schedule-Managment",step3Desc:"Jobs pausieren, reaktivieren oder testen."},quotas:{title:"Quota-Tour",step1Title:"Sicherheitslimits",step1Desc:"Setzen Sie harte Obergrenzen für Kosten, Logs oder Chat-Durchsatz.",step2Title:"Echtzeitmetriken",step2Desc:"Beobachten Sie, was Tenants aktuell belasten.",step3Title:"Änderungen übernehmen",step3Desc:"Neue Configs fangen Lastspitzen ohne Latenz ab."},coordinator:{title:"Coordinator-Tour",step1Title:"Ereignisquelle",step1Desc:"Event-Source-Metriken im Backend einsehen.",step2Title:"Verarbeitung",step2Desc:"Abarbeitung von Queue-Aufträgen über Cluster hinweg.",step3Title:"Unzustellbare Nachrichten",step3Desc:"Abgestützte Tasks überprüfen, wieder einreihen (replay) oder löschen."},orphans:{title:"Orphans-Tour",step1Title:"Scan-Tool",step1Desc:"Entfernen Sie unverlinkte Fragmente der Konfiguration.",step2Title:"Weiche Löschung",step2Desc:"Inkludieren Sie Soft-Deletes in Final-Säuberungen.",step3Title:"Saubere DB",step3Desc:"Report anzeigen und Ressourcen aufräumen."}},help:{title:"Hilfe & Tour",platformTour:"Plattform-Tour",resetAll:"Alle Touren zurücksetzen",resetConfirm:"Fortschritt aller Touren zurücksetzen?"},offer:{message:"Neu hier? Starten Sie die {{page}}",accept:"Anzeigen",dontAsk:"Nicht nochmal fragen"}},Jmt={status:"Plattformstatus",online:"Online",offline:"Offline",checking:"Verbindung wird geprüft…",connected:"Verbunden",disconnected:"Getrennt",instance:"Instanz",latency:"Latenz",lastChecked:"Zuletzt geprüft",justNow:"gerade eben",secondsAgo:"vor {{count}}s"},ebt={live:"Live",reconnecting:"Verbindung wird wiederhergestellt…"},tbt={title:"Neue {{type}}",newAgent:"Neuer Agent",newGroup:"Neue Gruppe",quickCreate:"Schnellerstellung",quickCreateTitle:"Schnelle {{type}}-Erstellung",quickCreateDesc:"Legen Sie Name und Beschreibung fest. Details konfigurieren Sie später.",guidedSetup:"Geführtes Setup",guidedSetupDesc:"Schrittweises Setup mit LLM-Provider, Prompts und Deployment."},nbt={empty:"Noch keine Gruppen",emptyDescription:"Gruppen ermöglichen es mehreren Agents, bei strukturierten Diskussionen zusammenzuarbeiten.",createGroup:"Gruppe erstellen",unnamed:"Unbenannte Gruppe",noDescription:"Keine Beschreibung",count_one:"{{count}} Gruppe",count_other:"{{count}} Gruppen",confirmDelete:"Diese Gruppe löschen?",confirmDeleteDesc:"Die Gruppenkonfiguration wird dauerhaft gelöscht.",duplicateSuccess:"Gruppe dupliziert",members:"Mitglieder",discussionStyle:"Diskussionsstil",maxRounds:"Max. Runden"},ibt={title:"Gruppen-Assistent",subtitle:"Stellen Sie ein Team von KI-Beratern für Ihre Fragen zusammen",backToGroups:"Zurück zu Gruppen",templateTitle:"Mit einer Vorlage beginnen",templateDesc:"Wählen Sie eine vorkonfigurierte Gruppe oder starten Sie von Grund auf.",startBlank:"Von Grund auf",blankDesc:"Alles manuell konfigurieren",configTitle:"Gruppenkonfiguration",configDesc:"Benennen Sie Ihre Gruppe und wählen Sie den Diskussionsstil",namePlaceholder:"z.B. Beratungsgremium",descPlaceholder:"Wofür ist diese Gruppe?",membersTitle:"Team zusammenstellen",membersDesc:"Wählen Sie für jeden Platz einen bestehenden Agent oder erstellen Sie einen neuen.",addMember:"Mitglied hinzufügen",refreshAgents:"Agentenliste aktualisieren",existingAgents:"vorhandene Agents",displayName:"Agentenname",displayNamePlaceholder:"Geben Sie dem Agent einen Namen…",rolePlaceholder:"Rolle (z.B. Marketing, Technik)",useExisting:"Vorhandenen verwenden",createNew:"Neu erstellen",selectAgent:"Agent auswählen…",systemPrompt:"System-Prompt",provider:"LLM-Anbieter",model:"Modell",apiKey:"API-Schlüssel",apiKeyPlaceholder:"sk-…",createThisAgent:"Agent erstellen",creatingAgent:"Agent wird erstellt…",agentReady:"Agent erstellt & bereitgestellt",agentCreated:'Agent "{{name}}" erstellt',agentCreateFailed:"Agent konnte nicht erstellt werden: {{error}}",moderator:"Moderator",moderatorHint:"Fasst die Diskussion zusammen",addModerator:"Moderator hinzufügen",removeModerator:"Moderator entfernen",createModerator:"Moderator-Agent erstellen",moderatorReady:"Moderator-Agent bereit",moderatorCreated:"Moderator-Agent erstellt",creatingModerator:"Moderator wird erstellt…",creatingSlot:"{{name}} wird erstellt…",creatingGroup:"Gruppe wird erstellt…",needMembers:"Mindestens 2 Mitglieder erforderlich",reviewTitle:"Überprüfen & Erstellen",reviewDesc:"Prüfen Sie die Gruppenkonfiguration vor der Erstellung.",reviewMembers:"Mitglieder",autoCreateNotice:"{{count}} Agents werden automatisch erstellt, wenn Sie auf Gruppe erstellen klicken",autoCreateHint:"Jeder Agent wird automatisch erstellt und bereitgestellt, bevor die Gruppe zusammengestellt wird.",unassignedWarning:"{{count}} Mitglieder auf 'Vorhandenen verwenden' gesetzt, aber kein Agent ausgewählt",unassignedHint:"Diese Mitglieder werden bei Diskussionen übersprungen. Gehen Sie zurück, um Agents zuzuweisen.",flowPreview:"Diskussionsablauf",createGroup:"Gruppe erstellen",created:"Gruppe erstellt!",viewGroup:"Gruppe öffnen",createAnother:"Weitere erstellen",success:"Gruppe erfolgreich erstellt!"},sbt={advisoryBoard:"Beratungsgremium",advisoryBoardDesc:"Ein Expertengremium für strategische Entscheidungen. Jeder Agent vertritt eine andere Geschäftsfunktion.",codeReview:"Code-Review-Panel",codeReviewDesc:"Strukturiertes Code-Review mit unabhängigen Meinungen, Peer-Kritik, Überarbeitung und Gesamtbewertung.",riskAssessment:"Risikobewertung",riskAssessmentDesc:"Panel mit einem Advocatus Diaboli, der Annahmen hinterfragt und blinde Flecken aufdeckt.",forecasting:"Prognosepanel",forecastingDesc:"Anonyme Delphi-Beratung zur Vermeidung von Gruppendenken und für unvoreingenommene Einschätzungen.",proCon:"Pro/Contra-Debatte",proConDesc:"Formale Debatte mit Pro- und Contra-Teams, gefolgt von Erwiderungen und einem Urteil.",roles:{marketingExpert:"Marketing-Experte",techLead:"Tech-Lead",financeDirector:"Finanzdirektor",legalCounsel:"Rechtsberater",strategyConsultant:"Strategieberater",seniorEngineer:"Senior-Ingenieur",architect:"Architekt",securityReviewer:"Sicherheitsprüfer",riskAnalyst:"Risikoanalyst",domainExpert:"Fachexperte",devilsAdvocate:"Advocatus Diaboli",analystA:"Analyst A",analystB:"Analyst B",analystC:"Analyst C",analystD:"Analyst D",proAdvocate1:"Pro-Vertreter 1",proAdvocate2:"Pro-Vertreter 2",conAdvocate1:"Contra-Vertreter 1",conAdvocate2:"Contra-Vertreter 2"}},rbt={title:"Nutzererinnerungen",subtitle:"Persistente Nutzererinnerungen durchsuchen und verwalten",userIdPlaceholder:"Nutzer-ID eingeben…",searchPlaceholder:"Erinnerungen durchsuchen…",enterUserId:"Geben Sie eine Nutzer-ID ein, um deren Erinnerungen zu durchsuchen",totalEntries:"Einträge gesamt",preferences:"Präferenzen",facts:"Fakten",conflicts:"Konflikte",cat_all:"Alle",cat_preference:"Präferenzen",cat_fact:"Fakten",cat_context:"Kontext",deleteAll:"Alle löschen",deleteAllTitle:"Alle Erinnerungen löschen",deleteAllDesc:"Alle Erinnerungen dieses Nutzers werden unwiderruflich gelöscht.",deleteAllConfirm:"Alle löschen",entryDeleted:"Erinnerungseintrag gelöscht",allDeleted:"Alle Erinnerungen des Nutzers gelöscht",noResults:"Keine Erinnerungseinträge gefunden",value:"Wert",sourceAgent:"Quell-Agent",accessCount:"Zugriffe",created:"Erstellt",updated:"Aktualisiert",sourceConversation:"Quell-Gespräch",conflicted:"Widerspruch"},obt={title:"Nutzereigenschaften",subtitle:"Gespeicherte longTerm-Slot-Eigenschaften je Nutzer durchsuchen und verwalten",userIdPlaceholder:"Nutzer-ID eingeben…",searchPlaceholder:"Eigenschaften filtern…",enterUserId:"Geben Sie eine Nutzer-ID ein, um deren Eigenschaften anzuzeigen",key:"Schlüssel",type:"Typ",value:"Wert",deleteAll:"Alle löschen",deleteAllTitle:"Alle Eigenschaften löschen",deleteAllDesc:"Alle Eigenschaften dieses Nutzers werden unwiderruflich gelöscht.",deleted:"Eigenschaften gelöscht",noResults:"Keine Eigenschaften gefunden",showingCount:"{{count}} Eigenschaften"},abt={title:"Agenten-Auslöser",subtitle:"Absichten mit Agentenbereitstellungen für automatisches Routing verknüpfen",create:"Neuer Auslöser",createTitle:"Auslöser erstellen",editTitle:"Auslöser bearbeiten",intent:"Absicht",deployments:"Agentenbereitstellungen",addDeployment:"Agent hinzufügen",agents:"Agenten",empty:"Noch keine Auslöser konfiguriert",created:"Auslöser erstellt",updated:"Auslöser aktualisiert",deleted:"Auslöser gelöscht",deleteTitle:"Auslöser löschen",deleteDesc:"Auslöser für Absicht „{{intent}}“ endgültig löschen?",searchPlaceholder:"Nach Absicht oder Agenten-ID filtern…"},lbt={title:"Fähigkeiten-Erkennung",subtitle:"Agenten anhand ihrer deklarierten Fähigkeiten und Kompetenzen finden",searchPlaceholder:"Fähigkeiten suchen…",strategyHighest:"Höchste Konfidenz",strategyAll:"Alle Ergebnisse",registeredSkills:"Registrierte Fähigkeiten",noSkills:"Keine Fähigkeiten gefunden",matchingAgents:"Passende Agenten",noMatches:"Keine Agenten für diese Fähigkeit gefunden"},cbt={title:"Agent exportieren",loading:"Ressourcenbaum wird geladen…",selectResources:"Zu exportierende Ressourcen auswählen",required:"Erforderlich",snippets:"Snippets",allSelected:"Alle Ressourcen ausgewählt",countSelected:"{{count}} von {{total}} Ressourcen ausgewählt",exportSelected:"Ausgewählte exportieren"},dbt={title:"Agent importieren",dropZone:"ZIP-Datei hierher ziehen oder zum Durchsuchen klicken",dropZoneHint:"Exportiertes Agentenarchiv (.zip)",strategyLabel:"Import-Strategie",createNew:"Als neuen Agenten erstellen",createNewDesc:"Erstellt eine neue Kopie mit neuen IDs. Am besten für den Erstimport.",mergeSync:"Mit bestehendem zusammenführen",mergeSyncDesc:"Aktualisiert vorhandene Ressourcen. Erstellt neue, falls nicht vorhanden.",upgradeExisting:"Bestehenden Agenten aktualisieren",upgradeDesc:"Ressourcen strukturell mit einem Ziel-Agenten abgleichen. Am besten für Stufenübernahmen.",syncRemote:"Von Remote-Instanz synchronisieren",syncDesc:"Mit einer anderen EDDI-Instanz verbinden und einen Agenten live synchronisieren.",importNow:"Jetzt importieren",previewChanges:"Änderungen ansehen",selectTargetAgent:"Ziel-Agent auswählen",upgradeTargetHint:"Die importierten Ressourcen werden strukturell mit diesem Agenten abgeglichen.",chooseAgent:"— Agent wählen —",sourceAgent:"Quell-Agent (Remote)",targetAgent:"Ziel-Agent (Lokal)",createNewTarget:"Neuen Agenten erstellen",resource:"Ressource",type:"Typ",match:"Zuordnung",action:"Aktion",new:"neu",updated:"aktualisiert",unchanged:"unverändert",selected:"ausgewählt",mergeNow:"Ausgewählte importieren",syncNow:"Jetzt synchronisieren",upgradeNow:"Jetzt aktualisieren",importing:"Agent wird importiert…",contentIdentical:"Inhalt identisch",targetContent:"Ziel",sourceContent:"Quelle"},ubt={title:"Agenten-Synchronisierung",subtitle:"Agenten zwischen EDDI-Instanzen synchronisieren",connection:"Quell-Instanz",sourceUrl:"URL der Quell-EDDI-Instanz",authToken:"Autorisierungstoken",authHint:"Optional. Wird als X-Source-Authorization-Header gesendet.",connect:"Verbinden",connected:"Verbunden",agentsFound:"Agenten",connectionFailed:"Verbindung fehlgeschlagen",agentMapping:"Agenten-Zuordnung",previewAll:"Alle vorschauen",syncSelected:"Ausgewählte synchronisieren",remote:"Remote",createNew:"Neu erstellen",changes:"Änderungen",agentsSelected:"Agenten ausgewählt",totalResources:"Ressourcen",syncSuccess:"Synchronisierung abgeschlossen",syncError:"Synchronisierung fehlgeschlagen",empty:"Verbinden Sie sich mit einer Quell-Instanz, um die Agenten-Synchronisierung zu starten.",autoMatched:"Automatisch zugeordnet",previewFirst:"Änderungen vor dem Synchronisieren ansehen"},hbt={actionCreate:"Neu",actionUpdate:"Aktualisieren",actionSkip:"Aktuell",actionConflict:"Konflikt"},gbt={title:"Nutzer-Konversationen",subtitle:"Intent-Benutzer-Konversationszuordnungen verwalten",lookup:"Suche",intent:"Absicht",userId:"Benutzer-ID",agentId:"Agenten-ID",environment:"Umgebung",conversationId:"Konversations-ID",binding:"Aktive Zuordnung",enterBoth:"Geben Sie Intent und Benutzer-ID ein",notFound:"Keine Zuordnung gefunden",create:"Zuordnung erstellen",createTitle:"Zuordnung erstellen",created:"Zuordnung erstellt",deleteTitle:"Zuordnung löschen",deleteDesc:'Zuordnung für Intent "{{intent}}" und Benutzer "{{userId}}" entfernen?',deleted:"Zuordnung gelöscht"},fbt={placeholder:"Seiten, Agenten, Aktionen suchen…",noResults:"Keine Ergebnisse gefunden.",recent:"Kürzlich",navigate:"Navigation",agents:"Agenten",actions:"Schnellaktionen",createAgent:"Neuen Agenten erstellen",openChat:"Chat öffnen",kbdNavigate:"navigieren",kbdSelect:"auswählen",kbdClose:"schließen"},pbt={agentIdPlaceholder:"Agenten-ID zur Nachrichtenverarbeitung",botToken:"Bot-Token",botTokenHint:"Bot-Benutzer-OAuth-Token. Verwenden Sie eine Tresor-Referenz für mehr Sicherheit.",botTokenPlaceholder:"xoxb-… oder ${vault:slack-bot-token}",channel:"Kanal",channelId:"Slack-Kanal-ID",channelIdCol:"Kanal-ID",channelIdHint:"Rechtsklick auf einen Slack-Kanal → Kanaldetails anzeigen → Kanal-ID kopieren",channelsPlural:"Kanäle",channelType:"Kanaltyp",confirmDelete:"Kanal löschen?",confirmDeleteDesc:"Diese Kanalintegration wird dauerhaft entfernt.",create:"Kanal erstellen",createTitle:"Kanalintegration erstellen",defaultAgentId:"Standard-Agenten-ID",defaultTargetHint:"Das Standardziel verarbeitet alle Nachrichten, die keinem Trigger-Schlüsselwort entsprechen. Nach der Erstellung können weitere Ziele hinzugefügt werden.",empty:"Noch keine Kanäle",emptyDesc:"Erstellen Sie eine Kanalintegration, um Agenten mit Slack zu verbinden.",name:"Name",namePlaceholder:"z. B. Engineering AI Hub",openSlackApps:"Slack-App-Dashboard öffnen",searchPlaceholder:"Kanäle suchen…",signingSecret:"Signierungsgeheimnis",signingSecretHint:"Von der Seite „Grundlegende Informationen“ Ihrer Slack-App.",signingSecretPlaceholder:"Hex-String oder ${vault:slack-signing-secret}",slackSetupGuide:"Slack-Einrichtungsanleitung",slackSetupSummary:"Erstellen Sie eine Slack-App, konfigurieren Sie Bot-Token-Bereiche (app_mentions:read, chat:write, im:history, channels:history, groups:history) und fügen Sie die Anmeldedaten hier ein.",target:"Ziel",targets:"Ziele",targetsCol:"Ziele",type:"Typ",unnamed:"Unbenannter Kanal",version:"Version"},mbt={addTarget:"Ziel hinzufügen",addTrigger:"Trigger hinzufügen…",agentId:"Agenten-ID",botToken:"Bot-Token",channelId:"Slack-Kanal-ID",cooldown:"Abklingzeit (s)",general:"Allgemein",groupId:"Gruppen-ID",isDefault:"Standard",maxCost:"Max €/Tag",maxDaily:"Max/Tag",name:"Name",observe:"Beobachten",observeDesc:"Passiv überwachen und selektiv antworten",observeKeywords:"Trigger-Schlüsselwörter",observeMimeTypes:"Trigger-MIME-Typen",observeMode:"Beobachtungsmodus",observeSettings:"Einstellungen Beobachtungsmodus",platformConfig:"Plattformkonfiguration",rawConfig:"Rohkonfiguration",removeTarget:"Entfernen",requiredEvents:"Erforderliche Event-Abonnements:",requiredScopes:"Erforderliche Bot-Token-Bereiche:",setDefault:"Als Standard festlegen",signingSecret:"Signierungsgeheimnis",targetName:"Name",targets:"Nachrichtenrouting-Ziele",targetType:"Typ",triggerHint:"Benutzer geben „Schlüsselwort: Nachricht“ ein, um an dieses Ziel weiterzuleiten",triggerKeywords:"Trigger-Schlüsselwörter",triggers:"Trigger",type:"Kanaltyp",webhookHint:"Fügen Sie diese URL in das Feld „Request URL“ unter Event Subscriptions Ihrer Slack-App ein.",webhookUrl:"Webhook-URL"},bbt={app:gmt,auth:fmt,nav:pmt,theme:mmt,language:bmt,pages:xmt,common:vmt,agents:_mt,agentDetail:ymt,wizard:wmt,setupWizard:Cmt,packages:Smt,packageDetail:kmt,packageEditor:Nmt,conversations:Emt,conversationDetail:Lmt,chat:Dmt,resources:Tmt,editor:Imt,rulesEditor:Amt,apiCallsEditor:Rmt,llmEditor:Mmt,outputEditor:Pmt,propertySetterEditor:Omt,dictionaryEditor:jmt,coordinator:Fmt,contentEditor:Bmt,logs:Hmt,secrets:Wmt,audit:Vmt,schedules:zmt,debugDrawer:Umt,costDashboard:$mt,memoryInspector:qmt,logViewer:Kmt,promptViewer:Gmt,promptPreview:Ymt,studio:Qmt,ragEditor:Xmt,onboarding:Zmt,platform:Jmt,stream:ebt,createOrWizard:tbt,groups:nbt,groupWizard:ibt,groupTemplates:sbt,memories:rbt,properties:obt,triggers:abt,capabilities:lbt,exportDialog:cbt,importDialog:dbt,syncPage:ubt,sync:hbt,userConversations:gbt,commandPalette:fbt,channels:pbt,channelDetail:mbt},xbt={title:"EDDI Manager",description:"Tableau de bord d'administration de la plateforme IA EDDI"},vbt={login:"Connexion",logout:"Déconnexion",loading:"Authentification…",sessionExpired:"Session expirée. Veuillez vous reconnecter.",profile:"Profil",guest:"Invité",userMenu:"Menu utilisateur"},_bt={dashboard:"Tableau de bord",agents:"Agents",packages:"Workflows",conversations:"Conversations",coordinator:"Coordinateur",schedules:"Planifications",logs:"Journaux",orphans:"Orphelins",secrets:"Secrets",audit:"Journal d’audit",quotas:"Quotas",groups:"Groupes",chat:"Chat",resources:"Ressources",sectionManagement:"Gestion",sectionDevelopment:"Développement",sectionOperations:"Opérations",mainNavigation:"Navigation principale",openMenu:"Ouvrir le menu de navigation",sectionCore:"Principal",sectionBuild:"Création & tests",sectionMonitor:"Surveillance",sectionAdmin:"Administration",studio:"Studio",gdpr:"Confidentialité",memories:"Mémoire utilisateur",properties:"Propriétés",triggers:"Déclencheurs",capabilities:"Capacités",sync:"Synchronisation",channels:"Canaux",userConversations:"Conversations utilisateur",userData:"Données utilisateur",variables:"Variables"},ybt={light:"Clair",dark:"Sombre",system:"Système"},wbt={label:"Langue",en:"English",de:"Deutsch",fr:"Français",es:"Español",ar:"العربية",zh:"中文",th:"ไทย",ja:"日本語",ko:"한국어",pt:"Português",hi:"हिन्दी"},Cbt={dashboard:{title:"Tableau de bord",subtitle:"Vue d'ensemble de vos agents et conversations EDDI",activeAgents:"Agents actifs",totalWorkflows:"Workflows",totalResources:"Ressources",totalConversations:"Conversations",quickActions:"Actions rapides",recentAgents:"Agents récents",noRecentAgents:"Aucun agent pour l'instant. Créez votre premier agent !"},agents:{title:"Agents",subtitle:"Gérez vos agents d'IA conversationnelle"},packages:{title:"Workflows",subtitle:"Configurez les workflows et extensions des agents"},conversations:{title:"Conversations",subtitle:"Consultez et gérez les conversations des agents"},resources:{title:"Ressources",subtitle:"Gérez les règles de comportement, dictionnaires, sorties et plus"},chat:{title:"Chat",subtitle:"Discutez avec vos agents déployés"},channels:{title:"Canaux",subtitle:"Connectez des agents et des groupes à des plateformes de messagerie comme Slack"},groups:{title:"Groupes",subtitle:"Groupes de discussion multi-agents pour le débat structuré et la collaboration"}},Sbt={loading:"Chargement...",error:"Une erreur est survenue",retry:"Réessayer",save:"Enregistrer",cancel:"Annuler",delete:"Supprimer",create:"Créer",edit:"Modifier",search:"Rechercher...",noResults:"Aucun résultat trouvé",duplicate:"Dupliquer",close:"Fermer",skipToMain:"Aller au contenu principal",opensNewTab:"ouvre dans un nouvel onglet",moreActions:"Plus d'actions",sortByName:"Trier par nom",sortByVersion:"Trier par version",sortByModified:"Trier par date de modification",apply:"Appliquer",copied:"Copié",copy:"Copier",saving:"Enregistrement…",showMore:"Show More",showLess:"Show Less",copyFailed:"Échec de la copie dans le presse-papiers"},kbt={deploy:"Déployer",undeploy:"Retirer",createAgent:"Créer un agent",createTitle:"Créer un nouvel agent",name:"Nom",namePlaceholder:"Mon Agent",description:"Description",descriptionPlaceholder:"Décrivez ce que fait cet agent...",empty:"Aucun agent pour l'instant. Créez votre premier agent !",confirmDelete:"Êtes-vous sûr de vouloir supprimer cet agent ?",count_one:"{{count}} agent",count_other:"{{count}} agents",export:"Exporter",exporting:"Exportation en cours...",exportSuccess:"Agent exporté avec succès",import:"Importer un agent",importing:"Importation en cours...",importSuccess:"Agent importé avec succès",importError:"Échec de l'importation de l'agent",chat:"Chat",deployAndChat:"Déployer & Discuter",openExternalChat:"Ouvrir dans un nouvel onglet",emptyDescription:"Utilisez l'assistant pour créer un agent entièrement configuré en quelques minutes."},Nbt={title:"Détails de l'agent",backToAgents:"Retour aux Agents",packages:"Workflows",noWorkflows:"Aucun workflow ajouté",addWorkflow:"Ajouter un workflow",selectWorkflow:"Sélectionner un workflow à ajouter",rawConfig:"Configuration brute",editName:"Modifier le nom",editDescription:"Modifier la description",clickToEdit:"Cliquer pour modifier",noDescription:"Aucune description",duplicate:"Dupliquer",duplicating:"Duplication en cours...",duplicateSuccess:"Agent dupliqué avec succès",environments:"Environnements",envProduction:"Production",envTest:"Test",savingAgent:"Enregistrement de l'agent...",savedAgent:"Agent enregistré avec succès",saveError:"Échec de l'enregistrement de l'agent",deployToEnv:"Déployer en {{env}}",undeployFromEnv:"Retirer de {{env}}",openStudio:"Ouvrir dans le Studio",maxKeyLength:"Longueur max. de clé",maxValueLength:"Longueur max. de valeur",maxWritesPerTurn:"Écritures max./tour",dreamSchedule:"Planification (cron)",dreamLlmProvider:"Fournisseur LLM",dreamLlmModel:"Modèle LLM",dreamMaxCost:"Coût max./exécution ($)",dreamPruneDays:"Nettoyage après (jours)",dreamBatchSize:"Taille du lot",detectContradictions:"Détecter les contradictions",summarizeInteractions:"Résumer les interactions",confidenceLow:"Faible",confidenceMedium:"Moyen",confidenceHigh:"Élevé",visibilitySelf:"Propre",visibilityGlobal:"Global",onCapEvict:"Supprimer le plus ancien",onCapReject:"Rejeter",recallMostRecent:"Plus récent",recallMostRelevant:"Plus pertinent",channels:"Connecteurs de canal",channelsDesc:"Connectez cet agent à des canaux Slack. Chaque connecteur est configuré indépendamment avec ses propres identifiants, prenant en charge les configurations multi-workspace.",noChannels:"Aucun canal configuré",noChannelsDesc:"Ajoutez un canal Slack pour permettre aux utilisateurs d'interagir avec cet agent depuis Slack.",addSlackChannel:"Ajouter un canal Slack",slackChannel:"Canal Slack",removeChannel:"Supprimer le canal",removeChannelConfirm:"Supprimer ce connecteur de canal Slack ?",removeChannelDesc:"This action will permanently disconnect this channel.",channelId:"ID du canal",channelIdHint:"Les ID de canal commencent par C suivi de caractères alphanumériques majuscules",botToken:"Token du bot",botTokenPlaceholder:"xoxb-… ou ${vault:slack-bot-token}",botTokenHint:"Token OAuth Bot User Slack. Utilisez une référence vault pour la sécurité.",signingSecret:"Secret de signature",signingSecretPlaceholder:"Chaîne hexadécimale ou ${vault:slack-signing-secret}",signingSecretHint:"Depuis la page Basic Information de votre application Slack. Utilisez une référence vault pour la sécurité.",groupIdOptional:"ID de groupe (optionnel)",groupIdPlaceholder:"ID de configuration de groupe multi-agent",groupIdHint:'Activez les discussions multi-agents "group: question" depuis ce canal Slack.',slackSetupGuide:"Guide de configuration Slack",slackWebhookUrl:"URL du webhook",slackWebhookCopied:"URL du webhook copiée",slackStep1:"Créez une application Slack sur api.slack.com/apps et installez-la dans votre workspace.",slackStep2:"Copiez le token du bot (xoxb-…) et le secret de signature dans le vault EDDI et configurez les canaux ci-dessous.",slackStep3:"Ensuite, activez les Event Subscriptions dans votre application Slack, collez l'URL du webhook ci-dessus et abonnez-vous à :",slackSetupNote:"Important : Configurez le canal ci-dessous avant d'activer les Event Subscriptions — Slack envoie un défi de vérification d'URL qui nécessite que le secret de signature soit configuré dans EDDI.",slackRequiredScopes:"Permissions requises pour le token du bot"},Ebt={title:"Assistant Agent"},Lbt={title:"Assistant de création d'agent",subtitle:"Créez un agent entièrement configuré en quelques minutes",backToAgents:"Retour aux Agents",next:"Suivant",back:"Retour",createOnly:"Créer uniquement",createAndDeploy:"Créer & Déployer",typeTitle:"Quel type d'agent ?",typeDesc:"Choisissez le type d'agent que vous souhaitez créer",standardAgent:"Agent standard",apiAgent:"Agent API",standardDesc:"IA conversationnelle alimentée par un LLM avec outils, Quick Replies et analyse de sentiment",apiDesc:"Importez une spécification OpenAPI/Swagger pour générer automatiquement un agent API",infoTitle:"Identité de l'agent",infoDesc:"Donnez un nom et une personnalité à votre agent",agentName:"Nom de l'agent",namePlaceholder:"ex. Bot d'assistance client",systemPrompt:"Prompt système",promptPlaceholder:"Tu es un assistant IA serviable qui...",promptHint:"Cette instruction définit le comportement et les réponses de votre agent.",llmTitle:"Configuration LLM",llmDesc:"Choisissez le modèle d'IA qui alimente votre agent",provider:"Fournisseur",model:"Modèle",apiKey:"Clé API",baseUrl:"URL de base",baseUrlPlaceholder:"URL d'endpoint personnalisé",optional:"facultatif",apiSpecTitle:"Spécification OpenAPI",apiSpecDesc:"Fournissez la spécification OpenAPI/Swagger de votre API",specByUrl:"URL",specByFile:"Fichier",specByPaste:"Coller",fetch:"Récupérer",specFetched:"Spécification chargée !",specFetchError:"Échec du chargement de la spécification",dropFile:"Déposez votre fichier OpenAPI ici",dropHint:"Format JSON ou YAML",browse:"Parcourir les fichiers",pasteSpec:"Collez votre JSON ou YAML OpenAPI/Swagger ici...",specLoaded:"Fichier chargé : {{name}}",specReady:"Spécification chargée ({{chars}} caractères)",apiBaseUrlLabel:"URL de base API",apiAuthLabel:"En-tête d’authentification API",endpointFilter:"Filtre d'endpoints",endpointFilterPlaceholder:"Séparés par virgules : GET /users, POST /orders",featuresTitle:"Fonctionnalités & Options",featuresDesc:"Personnalisez les capacités de votre agent",introMessage:"Message d'accueil",introMessageDesc:"Message affiché au début d'une conversation",quickReplies:"Réponses rapides",quickRepliesDesc:"Le LLM génère des suggestions de réponses cliquables",sentiment:"Analyse de sentiment",sentimentDesc:"Suivre l'humeur, l'intention et l'urgence en temps réel",structuredOutput:"Sortie structurée",structuredOutputDesc:"Le LLM répond avec un objet JSON au lieu de texte brut",structuredOutputInfo:"L'activation modifie le mode de réponse du LLM : au lieu de texte brut, il retourne un objet JSON avec des champs structurés. Un schéma JSON est ajouté au prompt système et le modèle passe en mode réponse JSON.",builtInTools:"Outils intégrés",builtInToolsDesc:"Activer la bibliothèque d'outils intégrés d'EDDI (calculatrice, date/heure, etc.)",toolsWhitelist:"Whitelist (vide = tous les outils)",mcpServers:"Serveurs MCP",mcpServersDesc:"Serveurs Model Context Protocol pour outils externes",autoDeploy:"Déploiement auto",autoDeployDesc:"Déployer l'agent immédiatement après sa création",environment:"Environnement",envProduction:"Production",envTest:"Test",reviewTitle:"Vérifier & Créer",reviewDesc:"Vérifiez votre configuration avant de créer l'agent",reviewType:"Type",reviewName:"Nom",reviewPrompt:"Prompt système",reviewProvider:"Fournisseur",reviewModel:"Modèle",reviewSpec:"Spec. OpenAPI",reviewIntro:"Message d'accueil",reviewDeploy:"Déployer",success:"Agent créé avec succès !",agentCreated:"Agent créé !",deployed:"Déployé",endpointsParsed:"{{count}} endpoints API analysés",viewAgent:"Voir l'agent",createAnother:"Créer un autre",allTools:"Tous les outils",selectSpecific:"Sélection manuelle",allToolsInfo:"Les {{count}} outils intégrés seront accessibles à votre agent. Choisissez « Sélection manuelle » pour restreindre les outils actifs.",availableTools:"Outils disponibles",toolCount:"{{selected}} sur {{total}} sélectionnés"},Dbt={createWorkflow:"Créer un workflow",createTitle:"Créer un nouveau workflow",name:"Nom",namePlaceholder:"Mon Workflow",description:"Description",descriptionPlaceholder:"Décrivez ce que fait ce workflow...",noDescription:"Aucune description",empty:"Aucun workflow pour l'instant. Créez votre premier workflow !",confirmDelete:"Êtes-vous sûr de vouloir supprimer ce workflow ?",count_one:"{{count}} workflow",count_other:"{{count}} workflows",emptyDescription:"Les workflows définissent le pipeline de traitement de vos agents."},Tbt={title:"Détails du workflow",backToWorkflows:"Retour aux Workflows",extensions:"Extensions",noExtensions:"Aucune extension dans ce workflow",rawConfig:"Configuration brute"},Ibt={title:"Éditeur de workflow",pipeline:"Pipeline d'extensions",addHint:"Ajoutez des extensions pour construire votre pipeline",addHintDialog:"Sélectionnez un type d'extension à ajouter",reorder:"Réordonner l'extension",saved:"Workflow enregistré avec succès",saveError:"Échec de sauvegarde du workflow",noTasks:"Aucune tâche dans ce workflow",addTask:"Ajouter une tâche"},Abt={searchPlaceholder:"Rechercher par ID de conversation...",id:"Conversation",agent:"Agent",state:"État",lastActivity:"Dernière activité",actions:"Actions",empty:"Aucune conversation pour l'instant. Déployez un agent et commencez à discuter !",confirmDelete:"Êtes-vous sûr de vouloir supprimer cette conversation ?",count_one:"{{count}} conversation",count_other:"{{count}} conversations",emptyDescription:"Déployez un agent et démarrez une conversation depuis la page Chat."},Rbt={continueChat:"Continuer dans le chat",searchTranscript:"Rechercher dans la conversation…",exportMd:"Exporter en Markdown",toolSummary:"Utilisation des outils",totalCost:"Coût total",cacheHitRate:"Taux de cache"},Mbt={selectAgent:"Sélectionnez un agent...",noAgents:"Aucun agent déployé disponible. Déployez d'abord un agent.",placeholder:"Tapez un message...",send:"Envoyer",newConversation:"Nouvelle conversation",endConversation:"Terminer la conversation",streaming:"Streaming",thinking:"Réflexion en cours...",connectionError:"Erreur de connexion. Veuillez réessayer.",empty:"Sélectionnez un agent et commencez à discuter !",history:"Historique",undo:"Annuler le dernier message",redo:"Rétablir le message",continueConversation:"Continuer",noHistory:"Aucun historique de conversation.",attach:"Joindre un fichier",attachUploading:"Chargement...",attachSuccess:"Fichier joint",attachError:"Échec du chargement",retry:"Réessayer la dernière étape",retrySuccess:"Étape ré-exécutée",retryError:"Échec de la tentative",showActivity:"Afficher l’activité",hideActivity:"Masquer l’activité",scrollToBottom:"Défiler vers le bas",copyMessage:"Copier le message",copied:"Copié !",activity:{processing:"Traitement…",steps:"étapes",toolCalls:"appels d’outils",toolCall:"Appel d’outil",toolResult:"Résultat"},channels:{title:"Canaux",subtitle:"Connecter des agents et groupes à des plateformes comme Slack"},context:{conversationId:"ID conversation",agentVersion:"Version de l’agent",startTime:"Début",stepCount:"Étapes",show:"Afficher les infos",hide:"Masquer les infos"},agentTyping:"L’agent rédige"},Pbt={unnamed:"Ressource sans nom",noDescription:"Aucune description",backToResources:"Retour aux Ressources",backToList:"Retour à {{type}}",unknownType:"Type de ressource inconnu",rawConfig:"Configuration brute",rawConfigHint:"Configuration JSON de cette ressource",create:"Créer {{type}}",createTitle:"Créer {{type}}",createDescription:"Créer une configuration {{type}} vide. Vous pourrez la modifier après la création.",confirmDelete:"Êtes-vous sûr de vouloir supprimer ce(tte) {{type}} ?",empty:"Aucune ressource {{type}} pour l'instant.",itemCount_one:"{{count}} élément",itemCount_other:"{{count}} éléments",count_one:"{{count}} ressource",count_other:"{{count}} ressources",types:{rules:{name:"Règles de comportement",description:"Définir les règles de flux de conversation et la logique de décision"},apicalls:{name:"Appels HTTP",description:"Configurer les intégrations API externes et les webhooks"},output:{name:"Jeux de sorties",description:"Gérer les modèles de réponse et les variantes de sortie"},dictionary:{name:"Dictionnaires",description:"Définir les modèles de reconnaissance de mots et de phrases"},llm:{name:"LLM",description:"Configurer les modèles d'IA, les prompts et les liaisons d'outils"},propertysetter:{name:"Définisseur de propriétés",description:"Définir les propriétés de conversation et gérer le remplissage de slots"},mcpcalls:{name:"Appels MCP",description:"Configurer les connexions MCP et les appels d'outils déterministes"},rag:{name:"Bases de connaissances",description:"Configurer des bases de connaissances RAG pour la recherche documentaire"},snippets:{name:"Extraits de prompt",description:"Blocs de construction reutilisables pour les prompts systeme"}},emptyDescription:"Créez votre premier(ère) {{type}} pour l'utiliser dans les workflows."},Obt={formTab:"Formulaire",jsonTab:"JSON",save:"Enregistrer",discard:"Annuler",saving:"Enregistrement...",saved:"Enregistré avec succès",saveError:"Échec de l'enregistrement",dirty:"Modifications non enregistrées",version:"Version",versionPicker:"Sélectionner la version",readOnly:"Lecture seule",formPlaceholder:"Éditeur visuel bientôt disponible. Utilisez l'onglet JSON pour modifier.",jsonSchema:"Validation de schéma active",cascadeMode:"Les modifications seront propagées au workflow et à l'agent parent",usedInAgents:"Utilisé dans {{count}} agent(s)",updateUsageHint:"Mettre à jour les workflows et agents sélectionnés vers la nouvelle version ?",updateUsage:"Mettre à jour la sélection",skipUpdate:"Ignorer",cascading:"Mise à jour...",cascadeSuccess:"Mise à jour en cascade terminée",invalidJson:"JSON invalide — basculez vers l'onglet JSON pour corriger."},jbt={appendActions:"Ajouter des actions",expressionsAsActions:"Expressions comme actions",groups:"Groupes de comportement",addGroup:"Ajouter un groupe",groupName:"Nom du groupe",executionStrategy:"Stratégie d'exécution",rules:"Règles",addRule:"Ajouter une règle",ruleName:"Nom de la règle",actions:"Actions",noActions:"Aucune action",addAction:"Ajouter",actionPlaceholder:"ex. greet, get_weather",conditions:"Conditions",addCondition:"Ajouter une condition",conditionType:"Type de condition",nestedConditions:"Conditions imbriquées",configKey:"Clé",configValue:"Valeur",addConfig:"Ajouter une config",removeRule:"Supprimer la règle",removeGroup:"Supprimer le groupe",removeCondition:"Supprimer la condition",noGroups:"Aucun groupe de comportement défini",noRules:"Aucune règle dans ce groupe",noConditions:"Aucune condition"},Fbt={targetServerUrl:"URL du serveur cible",targetServerUrlPlaceholder:"https://api.example.com",calls:"Appels HTTP",addCall:"Ajouter un appel HTTP",callName:"Nom de l'appel",callDescription:"Description",descriptionPlaceholder:"Description en langage naturel pour les agents LLM",request:"Requête",method:"Méthode",path:"Chemin",pathPlaceholder:"/api/endpoint",headers:"En-têtes",addHeader:"Ajouter un header",queryParams:"Paramètres de requête",addQueryParam:"Ajouter un paramètre",contentType:"Type de contenu",body:"Corps de la requête",bodyPlaceholder:"Modèle de corps JSON...",parameters:"Paramètres (pour agents LLM)",paramName:"Nom du paramètre",paramDescription:"Description",addParam:"Ajouter un paramètre",options:"Options",saveResponse:"Enregistrer la réponse",responseObjectName:"Nom de l'objet réponse",responseHeaderObjectName:"Nom de l'objet header réponse",fireAndForget:"Envoyer et oublier",batchCalls:"Appels en lot",iterationObjectName:"Nom de l'objet itération",prePostInstructions:"Instructions pré/post",preRequest:"Pré-requête",postResponse:"Post-réponse",removeCall:"Supprimer l'appel",noCalls:"Aucun appel HTTP configuré",actions:"Actions déclencheurs",noActions:"Aucune action",actionPlaceholder:"ex. get_weather"},Bbt={tasks:"Tâches LLM",addTask:"Ajouter une tâche",noTasks:"Aucune tâche LangChain configurée",removeTask:"Supprimer la tâche",taskId:"ID de tâche",description:"Description",descriptionPlaceholder:"Ce que fait cette tâche",triggerActions:"Actions déclencheurs",noActions:"Aucune action",actionPlaceholder:"ex. help, chat",systemPrompt:"Prompt système",systemPromptPlaceholder:"Tu es un assistant serviable...",modelParams:"Paramètres du modèle",addParam:"Ajouter un paramètre",agentMode:"Mode agent",enableBuiltInTools:"Activer les outils intégrés",toolWhitelist:"Whitelist d'outils (vide = tous)",enableHttpCallTools:"Découverte auto des outils HTTP Call",enableHttpCallToolsDesc:"Exposer automatiquement toutes les extensions httpcall du workflow comme outils LLM",httpCallTools:"URIs d'outils HTTP",httpCallToolsHint:"URIs httpcall explicites (en plus des auto-découvertes)",addTool:"Ajouter une URI d'outil",mcpServers:"Serveurs MCP",mcpServersDesc:"Serveurs MCP externes dont les outils deviennent disponibles pour le LLM",addMcpServer:"Ajouter un serveur MCP",mcpUrlPlaceholder:"http://localhost:7070/mcp",mcpName:"Nom",mcpApiKey:"API Key / réf. vault",historyLimit:"Limite d'historique",historyLimitHint:"(-1 = illimité)",budgetPerf:"Budget et performances",maxBudget:"Budget max ($)",costTracking:"Suivi des coûts",toolCaching:"Mise en cache des outils",rateLimiting:"Limitation de débit",defaultRate:"Débit par défaut (req/min)",prePostInstructions:"Instructions pré/post",preRequest:"Pré-requête",postResponse:"Post-réponse",enableMcpCallTools:"Découverte auto des outils MCP",enableMcpCallToolsDesc:"Expose automatiquement toutes les extensions mcpcalls du workflow en tant qu’outils LLM",a2aAgents:"Agents A2A",a2aAgentsDesc:"Agents distants compatibles A2A dont les compétences deviennent des outils LLM",addA2aAgent:"Ajouter un agent A2A",a2aUrlPlaceholder:"https://remote.example.com/a2a/agents/...",a2aName:"Nom d’affichage",a2aApiKey:"${vault:my-a2a-key}",a2aTimeout:"Délai max. (ms)",a2aSkillsFilter:"Filtre de compétences (vide = toutes)",cascade:"Cascade de modèles",cascadeDesc:"Try a cheap/fast model first. If confidence is too low, automatically escalate to a more powerful (and expensive) model.",cascadeEnable:"Activer la cascade",cascadeStrategy:"Stratégie",strategyCascade:"Escalade séquentielle",strategyParallel:"Parallèle (futur)",cascadeStrategyHint:"Commence par le modèle le moins cher, escalade si la confiance est faible",cascadeEvalStrategy:"Évaluation de confiance",cascadeEvalHint:"Comment juger si la réponse est satisfaisante",evalStructured:"Sortie structurée (JSON)",evalHeuristic:"Heuristique (détection d’hésitation)",evalJudge:"Modèle juge (sous-LLM)",evalNone:"Aucune (toujours accepter)",cascadeInAgent:"Utiliser aussi la cascade en mode agent (avec outils)",cascadeSteps:"Cascade Steps",cascadeStepsDesc:"Order matters: first step tried first. Last step is always accepted.",cascadeModelName:"ex. claude-sonnet-4-6",cascadeConfidence:"Min. Confidence (0-1)",cascadeConfidencePlaceholder:"vide = toujours accepter",cascadeTimeout:"Délai max. (ms)",addCascadeStep:"Ajouter une étape",parallelExecution:"Exécution parallèle des outils",parallelExecutionDesc:"Run independent tool calls concurrently",parallelTimeout:"Délai max. (ms)",maxToolIterations:"Itérations max. d’outils",maxToolIterationsHint:"(par défaut 10)",toolRateLimits:"Limites de débit par outil",toolRateLimitsDesc:"Override default rate for specific tools",toolName:"Nom de l’outil",addToolRate:"Ajouter une limite",retryConfig:"Configuration des tentatives",retryDesc:"Configure automatic retries with exponential backoff.",retryMaxAttempts:"Tentatives max.",retryDelay:"Délai initial (ms)",retryMultiplier:"Facteur de backoff",retryMaxDelay:"Délai max. (ms)",ragConfig:"RAG (recherche de connaissances)",ragDesc:"Augment LLM responses with retrieved documents.",ragHttpCall:"URI d’appel HTTP",ragEmbeddingModel:"Modèle d’embedding",ragEmbeddingModelPlaceholder:"ex. text-embedding-3-small",ragEmbeddingStore:"Stockage d’embeddings",ragEmbeddingStorePlaceholder:"ex. pgvector, qdrant",ragMaxResults:"Résultats max.",ragMinScore:"Min Similarity Score (0-1)",moveDown:"Descendre",moveUp:"Monter",execution:"Exécution",budgetCosts:"Budget & coûts",preRequestDesc:"Définir ou transformer les propriétés avant lexécution du LLM.",postResponseDesc:"Traiter la sortie du LLM : définir les propriétés, construire des messages de sortie et générer des réponses rapides.",postPropertyInstructions:"Instructions de propriétés",postOutputInstructions:"Instructions de sortie",postQrInstructions:"Instructions de réponses rapides",allSkills:"Toutes les compétences",skillPlaceholder:"ex. order-tracking",modeAgent:"Agent",modeChat:"Chat",perMinute:"/min",allTools:"Tous les outils",selectSpecific:"Sélection manuelle",allToolsInfo:"Les {{count}} outils intégrés sont accessibles au LLM. Choisissez « Sélection manuelle » pour restreindre les outils exposés.",availableTools:"Outils disponibles",toolCount:"{{selected}} sur {{total}} sélectionnés",toolSources:"Sources d’outils du workflow",toolSourcesInfo:"Les deux sources sont actives par défaut — tous les appels HTTP et MCP du workflow sont automatiquement exposés en tant qu’outils LLM. Désactivez une source pour l’exclure.",included:"Inclus"},Hbt={language:"Langue",langPlaceholder:"ex. en, fr",outputSets:"Jeux de sorties",addOutputSet:"Ajouter un jeu de sorties",noOutputSets:"Aucun jeu de sorties configuré",actionName:"Nom de l'action",timesOccurred:"×",removeOutput:"Supprimer",outputs:"Sorties",alternativeGroup:"Groupe alternatif",addAlternative:"Ajouter une alternative",addOutputGroup:"Ajouter un groupe de sorties",textPlaceholder:"Texte de sortie...",urlPlaceholder:"URL…",delayMs:"Délai (ms)",quickReplies:"Réponses rapides",noQuickReplies:"Aucune Quick Reply",addQuickReply:"Ajouter une Quick Reply",qrValue:"Texte du bouton",qrExpressions:"Expressions",default:"Par défaut"},Wbt={setters:"Définisseurs de propriétés",addSetter:"Ajouter un setter",noSetters:"Aucun Property Setter configuré",removeSetter:"Supprimer",triggerActions:"Actions déclencheurs",noActions:"Aucune action",actionPlaceholder:"ex. greet, fallback",properties:"Propriétés",noProperties:"Aucune propriété",addProperty:"Ajouter une propriété",propName:"Nom de la propriété",propValue:"Valeur / expression",fromPath:"Chemin source",fromObjectPath:"fromObjectPath",override:"Remplacer",propsCount:"prop.",untitled:"(aucune action)"},Vbt={language:"Langue",langPlaceholder:"ex. en, fr",words:"Mots",addWord:"Ajouter un mot",wordPlaceholder:"ex. bonjour",phrases:"Expressions",addPhrase:"Ajouter une phrase",phrasePlaceholder:"ex. bon matin",regExs:"Expressions régulières",addRegEx:"Ajouter une RegEx",regexPlaceholder:"Expression régulière",expressionPlaceholder:"ex. greeting(hello)",frequency:"Fréquence",none:"Aucune définie"},zbt={title:"Tableau de bord du coordinateur",subtitle:"Surveiller le traitement des conversations et gérer les entrées dead-letter",type:"Type de coordinateur",connection:"Connexion",processed:"Tâches traitées",deadLettered:"Lettres mortes",activeQueues:"Files actives",queued:"en file",deadLetterTitle:"File de lettres mortes",noDeadLetters:"Aucune entrée dead-letter",colId:"ID",colConversation:"Conversation",colError:"Erreur",colTime:"Heure",colActions:"Actions",replay:"Rejouer",discard:"Supprimer",purgeAll:"Tout purger",confirmPurge:"Tout purger ?",yes:"Oui",cancel:"Annuler",replaySuccess:"Dead-letter rejouée",replayError:"Échec de la relecture",discardSuccess:"Dead-letter supprimée",discardError:"Échec de la suppression",purgeSuccess:"Toutes les entrées dead-letter supprimées",purgeError:"Échec de la purge",empty:"Aucune donnée du coordinateur disponible",emptyHint:"Le service coordinateur est peut-être encore en cours de démarrage. Les données apparaîtront automatiquement."},Ubt={expand:"Agrandir",expandHint:"Plein écran (Ctrl+Maj+F)",close:"Terminé",lines:"lignes",chars:"caractères",fullscreenTitle:"Éditeur de contenu",fullscreenDescription:"Éditeur plein écran. Échap pour fermer."},$bt={title:"Journaux",description:"Surveiller le flux de logs en temps réel ou rechercher dans l'historique.",tabLive:"En direct",tabHistory:"Historique",connected:"Connecté",disconnected:"Déconnecté",filterAgent:"ID de l’agent…",filterConversation:"ID de conversation...",filterInstance:"ID d'instance...",allLevels:"Tous les niveaux",pause:"Pause",resume:"Reprendre",clear:"Effacer",search:"Rechercher",waitingForLogs:"En attente de logs...",connectingStream:"Connexion au stream...",noHistoryLogs:"Aucun log historique trouvé.",entryCount:"{{count}} entrées",showStacktrace:"Afficher la stacktrace ({{count}} frames)",hideStacktrace:"Masquer la stacktrace",allAgents:"Tous les agents",allConversations:"Toutes les conversations",waitingHint:"Les logs apparaîtront ici au fur et à mesure qu'ils arrivent du backend.",noHistoryHint:"Essayez d'ajuster les filtres ou de rechercher un autre agent ou conversation.",searchConversations:"Rechercher par ID, agent, utilisateur…",stepsCount:"{{count}} étapes",noConversationsFound:"Aucune conversation trouvée",useConversationId:"Utiliser l'ID: {{id}}",searchLogs:"Rechercher les logs…",errors:"erreurs",warnings:"avertissements",infos:"info",debugs:"débogage",filteredCount:"{{shown}} sur {{total}} entrées",copyEntry:"Copier l'entrée de log",export:"Exporter",stateReady:"Prêt",stateActive:"Actif",stateError:"Erreur",stateEnded:"Terminé"},qbt={title:"Coffre-fort des secrets",description:"Gérer les secrets chiffrés dans le vault. Les valeurs ne sont jamais exposées.",tenantId:"ID du locataire",refresh:"Charger les secrets",create:"Ajouter un secret",createTitle:"Ajouter un secret",keyName:"Nom de la clé",keyNameLabel:"Nom de la clé",keyNamePlaceholder:"ex. apiKey, dbPassword",valueLabel:"Valeur du secret",valuePlaceholder:"Entrer la valeur du secret…",storeWarning:"La valeur sera chiffrée. Elle ne pourra pas être récupérée une fois enregistrée.",store:"Enregistrer le secret",storeSuccess:'Secret "{{key}}" enregistré',deleteSuccess:'Secret "{{key}}" supprimé',created:"Créé",lastAccessed:"Dernier accès",checksum:"Somme de contrôle",actions:"Actions",confirmDeleteTitle:"Supprimer le secret",confirmDeleteMessage:'Êtes-vous sûr de vouloir supprimer définitivement "{{key}}" ? Cette action est irréversible.',empty:"Aucun secret trouvé",emptyHint:"Créez un secret ou modifiez les filtres de namespace ci-dessus.",vaultUp:"Vault en ligne",vaultDown:"Vault hors ligne",descriptionLabel:"Description (facultatif)",descriptionPlaceholder:"ex. Clé API OpenAI pour la production",descriptionCol:"Description",reference:"Référence",willUseRef:"Référence :",copyRef:"Copier la référence coffre-fort",refCopied:"Copié : {{ref}}",lastRotated:"Dernière rotation",scopeExplanation:"Les secrets sont limités par locataire et partagés entre tous les agents. Référencez-les avec ${vault:keyName}. L'accès est contrôlé par l'auteur de la configuration.",creatingFor:'Stockage dans le locataire "{{tenant}}" — accessible à tous les agents',vaultNotConfigured:"Le coffre-fort de secrets n'est pas configuré",viewDocs:"Voir la documentation",selectAgentFirst:"Veuillez d'abord sélectionner un agent",tableTitle:'{{count}} secret(s) dans le locataire "{{tenant}}"'},Kbt={title:"Journal d’audit",description:"Parcourir le registre d'audit immuable pour la conformité et le débogage.",byConversation:"Par conversation",byAgent:"Par agent",conversationIdPlaceholder:"Entrer l'ID de conversation...",agentIdPlaceholder:"Entrer l'agent ID...",versionPlaceholder:"Version (facultatif)",search:"Rechercher",entries:"entrées",totalDuration:"total",totalCost:"coût total",step:"Étape",tasks:"tâches",input:"Entrée",output:"Sortie",llmDetail:"Détail LLM",toolCalls:"Appels d'outils",hmacIntegrity:"Intégrité HMAC vérifiée",empty:"Rechercher des entrées d'audit",emptyHint:"Entrez un ID de conversation ou d'agent ci-dessus pour parcourir l'audit trail.",noResults:"Aucune entrée d'audit trouvée",noResultsHint:"Essayez un autre ID ou vérifiez que la conversation a été traitée.",loadMore:"Charger plus",selectAgent:"Select an agent…",conversations:"conversations",emptyAgent:"Select an agent to view its audit trail",emptyAgentHint:"Choose a deployed agent from the dropdown above to see all its audit records.",export:"Export",autoRefreshToggle:"Toggle auto-refresh (every 10s)",autoRefreshOn:"Auto",autoRefreshOff:"Auto",integrityVerified:"All entries cryptographically signed",integrityVerifiedDesc:"{{count}} of {{total}} entries have HMAC-SHA256 signatures",integrityPass:"SIGNED",integrityPartial:"Partially signed audit trail",integrityPartialDesc:"{{count}} of {{total}} entries have HMAC signatures",integrityNone:"Unsigned audit entries",integrityNoneDesc:"Configure a vault master key to enable automatic HMAC-SHA256 signing on all future audit entries.",signed:"Signed",allSigned:"All signed"},Gbt={title:"Planifications",subtitle:"Gérer les déclencheurs programmés — Cron et Heartbeats",create:"Créer une planification",createTitle:"Créer une planification",createSuccess:"Planification créée avec succès",createError:"Échec de la création de la planification",creating:"Création...",name:"Nom",namePlaceholder:"ex. Vérification quotidienne",triggerType:"Type de déclencheur",cronExpression:"Expression Cron",interval:"Intervalle (secondes)",agentId:"Agent ID",agentIdPlaceholder:"Entrer l'agent ID...",environment:"Environnement",message:"Message",messagePlaceholder:"Message à envoyer à l'agent",conversationStrategy:"Stratégie de conversation",total:"Planifications totales",active:"Actives",failedCount:"Échouées / Dead-Lettered",nextFireLabel:"Prochaine exécution",tableTitle:"Toutes les planifications",empty:"Aucune planification",emptyHint:"Créez une planification pour automatiser les déclencheurs d'agents.",colName:"Nom",colType:"Type",colSchedule:"Planification",colAgent:"Agent",colStatus:"Statut",colNextFire:"Prochaine exéc.",colLastFired:"Dernière exéc.",colActions:"Actions",enable:"Activer",disable:"Désactiver",enabled:"Planification activée",disabled:"Planification désactivée",toggleError:"Échec du changement d'état",fireNow:"Exécuter maintenant",fired:"Planification exécutée avec succès",fireError:"Échec de l'exécution",retry:"Réessayer",retrySuccess:"Planification remise en file",retryError:"Échec de la relance",deleteSuccess:"Planification supprimée",deleteError:"Échec de la suppression",fireHistory:"Historique d'exécution"},Ybt={title:"Débogage",tabPipeline:"Pipeline",tabCosts:"Coûts",tabMemory:"Mémoire",tabLogs:"Journaux",tabPrompt:"Prompt",turn:"Tour",latest:"Dernier",noPipeline:"Envoyez un message pour voir la trace du pipeline",processing:"Traitement...",actions:"Actions",confidence:"Confiance",duration:"Durée"},Qbt={thisTurn:"Ce tour",conversationTotal:"Total conversation",tokens:"Tokens",cost:"Coût",duration:"Durée",model:"Modèle",toolCalls:"Appels d'outils",toolUsage:"Utilisation d'outils",cacheStats:"Cache",hitRate:"Taux de réussite",empty:"Envoyez un message pour voir les coûts",in:"entrants",out:"sortants",total:"total",calls:"appels"},Xbt={title:"Mémoire de conversation",noConversation:"Démarrez une discussion pour inspecter la mémoire",empty:"Aucune donnée de mémoire",properties:"Propriétés",step:"Étape",keys:"clés",input:"Entrée"},Zbt={noAgent:"Sélectionnez un agent pour voir les journaux",search:"Rechercher...",pause:"Pause",resume:"Reprendre",clear:"Effacer",waiting:"En attente des journaux...",connected:"Connecté",disconnected:"Déconnecté",logOutput:"Sortie du journal"},Jbt={noConversation:"Démarrez une discussion pour inspecter les prompts",noLlm:"Aucune interaction LLM détectée",turn:"Tour",latest:"Dernier",tokens:"Tokens",model:"Modèle",cost:"Coût",copy:"Copier le prompt",copied:"Copié !",replay:"Rejouer ce tour",toolCalls:"Appels d'outils",step:"Étape",roleSystem:"Prompt système",roleUser:"Utilisateur",roleAssistant:"Assistant",roleTool:"Résultat d'outil"},ext={preview:"Aperçu",edit:"Éditer",switchToPreview:"Aperçu du prompt résolu",switchToEdit:"Passer en édition",refresh:"Actualiser",sampleData:"Données d’exemple (sans conversation)",disclaimerReal:"L’aperçu utilise le moteur Qute avec des données de conversation réelles.",disclaimerSample:"L’aperçu utilise le moteur Qute avec des données d’exemple. Sélectionnez une conversation pour les valeurs réelles.",resolvedPrompt:"Prompt résolu",copy:"Copier",copied:"Copié !",error:"Erreur de résolution de modèle",loading:"Résolution du modèle…",availableVariables:"Variables disponibles",copyVariable:"Cliquer pour copier la référence",varProperties:"Propriétés",varMemory:"Mémoire",varContext:"Contexte",varSnippets:"Extraits",varUserInfo:"Info utilisateur",varConversationInfo:"Info conversation",varInput:"Entrée",varConversationLog:"Journal de conversation"},txt={title:"Studio Agent",subtitle:"Concevez, testez et déboguez vos agents dans un seul espace",pipeline:"Pipeline",editor:"Éditeur",debug:"Debug & Chat",selectStage:"Cliquez sur une étape pour ouvrir son éditeur",openInStudio:"Ouvrir dans le Studio",loading:"Chargement...",notFound:"Agent introuvable",hideChat:"Masquer le chat",showChat:"Afficher le chat",openEditor:"Ouvrir dans l'éditeur",editorComingSoon:"Intégration de l'éditeur bientôt disponible",noPipeline:"Aucune étape de pipeline",type:{parser:"Analyseur",rules:"Règles",property:"Définisseur de propriétés",apicalls:"Appels API",llm:"LLM",output:"Sortie","output.template":"Modèle de sortie",mcpcalls:"Appels MCP",rag:"Bases de connaissances",dictionary:"Dictionnaire"},landingDescription:"Sélectionnez un agent pour ouvrir l’éditeur visuel, le débogueur et le chat en direct",noAgents:"Aucun agent trouvé — créez-en un sur la page Agents",chat:"Chat",backToAgent:"Retour à l’agent",selectStageHint:"Sélectionnez une extension du pipeline pour afficher et modifier sa configuration",noConfig:"Cette étape n’a pas d’URI de configuration",unsupportedType:"Éditeur non disponible pour ce type d’extension"},nxt={general:"Général",kbName:"Nom de la base de connaissances",kbNamePlaceholder:"Ex: docs-produit, faq, wiki-interne",kbNameHint:"Utilisé pour référencer cette base dans les tâches LLM",embeddingModel:"Modèle d'Embedding",provider:"Fournisseur",embeddingParams:"Paramètres du fournisseur",embeddingParamsHint:"Clé API (utilisez ${vault:...} pour les secrets), URL, etc.",vectorStore:"Stockage vectoriel",storeType:"Type de stockage",storeParams:"Paramètres de connexion",chunking:"Découpage de documents",chunkStrategy:"Stratégie",chunkSize:"Taille",chunkOverlap:"Chevauchement",overlapHint:"Aide à maintenir le contexte entre les sections",chunkPreview:"Aperçu du découpage",chunkBlocks:"{{count}} sections d'environ {{size}} car, {{overlap}} car de chevauchement",retrievalDefaults:"Options de récupération par défaut",retrievalHint:"Peuvent être surchargés dans chaque tâche LLM.",maxResults:"Résultats max (top-K)",minScore:"Score de similarité min",ingestion:"Ingestion de documents",dropFiles:"Glissez-déposez des documents ici",dropHint:"Fichiers textes ou Markdown",browse:"Parcourir",pasteText:"Ou coller du texte brut",pastePlaceholder:"Collez le contenu ici...",ingestText:"Ingérer le texte",ingestionHistory:"Statut d'ingestion",saveFirstIngestion:"Enregistrez d'abord cette base pour autoriser l'ingestion.",addParam:"Ajout paramètre"},ixt={welcome:{title:"Bienvenue sur EDDI",subtitle:"Votre centre de commande d'agents IA",introText:"EDDI Manager est votre outil pour créer, tester et gérer vos agents conversationnels.",capabilitiesTitle:"Ce que vous pouvez accomplir",capabilitiesSubtitle:"Tout ce dont vous avez besoin pour des agents en production",buildAgents:"Créer des agents",buildAgentsDesc:"Configurez des agents via l'assistant ou depuis zéro",designWorkflows:"Concevoir des workflows",designWorkflowsDesc:"Éditeur visuel pour processus LLM, appels API et outils",testRealtime:"Tester en temps réel",testRealtimeDesc:"Discutez avec vos agents avec flux de réponses et débogage",monitorOperate:"Gérer et superviser",monitorOperateDesc:"Retrouvez vos quotas, historiques, journaux et secrets au même endroit",readyTitle:"Prêt à commencer ?",readySubtitle:"Vous pourrez relancer cette visite depuis le menu Aide",startTour:"Lancer la visite guidée",exploreOwn:"Explorer par moi-même"},tour:{back:"Retour",next:"Suivant",skip:"Passer",finish:"Terminer",stepOf:"Étape {{current}} sur {{total}}",dashboard:{title:"Visite du Tableau de Bord",step1Title:"Votre centre de pilotage",step1Desc:"La barre latérale s'organise en trois volets: Gestion, Développement et Opérations.",step2Title:"Résumé de plateforme",step2Desc:"Statistiques en temps réel de vos agents, workflows et conversations.",step3Title:"Actions rapides",step3Desc:"Lancez l'assistant de création pour monter un agent en moins de deux minutes.",step4Title:"Personnalisez l'UI",step4Desc:"Basculez vers les thèmes clair/sombre et paramétrez votre langage."},agents:{title:"Visite des Agents",step1Title:"Assistant agent",step1Desc:"L'assistant compile toutes les étapes: Modèles IA, personnalités et outils LLM.",step2Title:"Création manuelle",step2Desc:"Pour les configurations fines basées sur JSON directement interfacées avec le serveur.",step3Title:"Rechercher",step3Desc:"Trouvez rapidement vos agents par nom via un filtre textuel simple.",step4Title:"Flotte",step4Desc:"Parcourez chaque carte Agent pour accéder au déploiement, au chat ou au pipeline de workflow de l'agent."},workflows:{title:"Visite des Workflows",step1Title:"Pipeline d'exécution",step1Desc:"Créer une cascade définie de tâches telles que des règles ou des API HTTP.",step2Title:"Connexion aux agents",step2Desc:"Liez chaque agent à un workflow pour valider son comportement conversationnel.",step3Title:"Trier la liste",step3Desc:"Basculez de la grille aux tableaux et explorez les ressources connectées."},chat:{title:"Visite de Chat",step1Title:"Déployer puis parler",step1Desc:"Lancez des échanges concrets avec vos LLM.",step2Title:"Diffusion temps réel",step2Desc:"Activez le Token Streaming pour apprécier des retours immédiats, mot à mot.",step3Title:"Historique des sessions",step3Desc:"Relisez toutes les conversations inachevées ou archivées pour audit direct.",step4Title:"Exécution d'outils",step4Desc:"Soumettez une requête; le LLM résoudra automatiquement l'appel d'outil nécessaire."},channels:{title:"Canaux",subtitle:"Connecter des agents et groupes à des plateformes comme Slack"},resources:{title:"Visite des Ressources",step1Title:"Bibliothèque",step1Desc:"Éditez individuellement les briques fonctionnelles d'un workflow Agent.",step2Title:"Configuration LLM",step2Desc:"Intégrez des modèles précis de base de connaissances et de Cascade avancée LLM.",step3Title:"Règles",step3Desc:"Utilisez le formateur JSON de réponses ou reliez un flux à de simples déclarations If/Else."},conversations:{title:"Visite des Conversations",step1Title:"Moteur de recherche",step1Desc:"Retrouvez n'importe quel texte ou identifiant issu du client conversationnel.",step2Title:"Triage",step2Desc:"Isolez les dialogues terminés, actifs ou en défaut pour résolution.",step3Title:"Mode débug",step3Desc:"La lecture fine d'une conversation déverrouille une suite de debugging des prompts d'agent LLM."},groups:{title:"Visite des Groupes",step1Title:"Création",step1Desc:"Connectez vos différents agents dans des clusters de discussion collectifs.",step2Title:"Filtrage",step2Desc:"Identifiez rapidement l'ensemble de vos hubs multi-agents.",step3Title:"Contrôle global",step3Desc:"Affichez, supprimez et réorganisez vos environnements de concert LLM."},logs:{title:"Visite des Logs Systèmes",step1Title:"Surveiller",step1Desc:"Supervisez vos instances en basculant des flux live aux bases archivées.",step2Title:"Niveaux",step2Desc:"Dédiez votre vigilance sur les rapports Warning ou Erreur.",step3Title:"Exporter",step3Desc:"Générez un fichier complet selon vos tris et gardez une trace de développement LLM."},secrets:{title:"Visite des Secrets",step1Title:"Intégration",step1Desc:"Acheminez en sécurité des Clés API vers vos instances d'outils d'Agent.",step2Title:"Localisation Locataire",step2Desc:"Ajustez vos informations pour conserver une sécurité propre à chaque Tenant Cloud.",step3Title:"Injection dynamique",step3Desc:"Équipez un noeud complet sans trahir une seule information secrète via ${vault:...}."},audit:{title:"Visite de l'Audit Ledger",step1Title:"Trace Immutable",step1Desc:"Inspectez toutes les manipulations passées, classées par Conversation ou Agent.",step2Title:"Investigation",step2Desc:"Vérifiez que toutes les communications de plateforme sont validées et conformes.",step3Title:"Extraction Complète",step3Desc:"Copiez tous ces rapports au format JSON structuré certifiant de bonnes pratiques."},schedules:{title:"Visite des Plannings",step1Title:"Job d'automatisation",step1Desc:"Éveillez et exécutez de manière chronométrée vos tâches asynchrones d'Agent.",step2Title:"Supervision Cron",step2Desc:"Constatez globalement toutes les pannes chronologiques via l'utilitaire d'erreurs.",step3Title:"Pilote temps réel",step3Desc:"Démarrez et interrompez une activité en direct aux horaires des serveurs intégrés."},quotas:{title:"Visite des Quotas",step1Title:"Règlements limites",step1Desc:"Plafonnez de potentielles brèches financières en plafonnant un compte Agent spécifique.",step2Title:"Usage temps réel",step2Desc:"Pistez combien d'appels d'outils un projet spécifique engendre.",step3Title:"Règles actives",step3Desc:"Protégez tout dépassement via un système proactif limitateur."},coordinator:{title:"Visite du Coordinateur",step1Title:"Interface temps réel",step1Desc:"Unifiez la totalité de l'orchestrateur au serveur frontal visuel.",step2Title:"Déroulé de queue",step2Desc:"Administrez des paquets colossaux d'actions serveurs dispatchés en ligne.",step3Title:"Lettres mortes",step3Desc:"Restituez d'anciennes interruptions, retirez-les ou soumettez-les à un exécuteur pour validation."},orphans:{title:"Visite des Objets Orphelins",step1Title:"Exploration complète",step1Desc:"Localisez instantanément vos données devenues errantes au sein des configurations.",step2Title:"Poubelle numérique",step2Desc:"Récupérez les agents signalés mais abandonnés des derniers nettoyages.",step3Title:"Purge globale",step3Desc:"Détruisez irrémédiablement d'inutiles enregistrements de mémoire saturant ce cloud LLM."}},help:{title:"Aide & Visite",platformTour:"Démarrer la visite guidée",resetAll:"Réinitialiser les visites",resetConfirm:"Remettre à zéro l'historique des visites guidées ?"},offer:{message:"Nouveau par ici ? Suivez la {{page}}",accept:"Afficher",dontAsk:"Ne plus demander"}},sxt={status:"État de la plateforme",online:"En ligne",offline:"Hors ligne",checking:"Vérification…",connected:"Connecté",disconnected:"Déconnecté",instance:"Instance",latency:"Latence",lastChecked:"Dernière vérification",justNow:"à l'instant",secondsAgo:"il y a {{count}}s"},rxt={live:"En direct",reconnecting:"Reconnexion…"},oxt={title:"Nouveau {{type}}",newAgent:"Nouvel Agent",newGroup:"Nouveau Groupe",quickCreate:"Création rapide",quickCreateTitle:"Création rapide de {{type}}",quickCreateDesc:"Définissez un nom, puis configurez plus tard.",guidedSetup:"Assistant de configuration",guidedSetupDesc:"Configuration pas à pas : fournisseur LLM, prompts et déploiement."},axt={empty:"Aucun groupe",emptyDescription:"Les groupes permettent à plusieurs agents de collaborer lors de discussions structurées.",createGroup:"Créer un groupe",unnamed:"Groupe sans nom",count_one:"{{count}} groupe",count_other:"{{count}} groupes",confirmDelete:"Supprimer ce groupe ?",confirmDeleteDesc:"La configuration du groupe sera définitivement supprimée.",duplicateSuccess:"Groupe dupliqué",noDescription:"Aucune description",members:"membres",discussionStyle:"Style de discussion",maxRounds:"Tours max."},lxt={title:"Mémoire utilisateur",subtitle:"Parcourir et gérer les souvenirs persistants stockés par les agents",userIdPlaceholder:"Saisir l’ID utilisateur…",searchPlaceholder:"Rechercher dans les souvenirs…",enterUserId:"Saisissez un ID utilisateur pour parcourir ses souvenirs",totalEntries:"Total des entrées",preferences:"Préférences",facts:"Faits",conflicts:"Conflits",cat_all:"Tout",cat_preference:"Préférences",cat_fact:"Faits",cat_context:"Contexte",deleteAll:"Tout supprimer",deleteAllTitle:"Supprimer tous les souvenirs",deleteAllDesc:"Tous les souvenirs de cet utilisateur seront définitivement supprimés. Cette action est irréversible.",deleteAllConfirm:"Tout supprimer",entryDeleted:"Entrée supprimée",allDeleted:"Tous les souvenirs de l’utilisateur supprimés",noResults:"Aucune entrée trouvée",value:"Valeur",sourceAgent:"Agent source",accessCount:"Accès",created:"Créé",updated:"Mis à jour",sourceConversation:"Conversation source",conflicted:"En conflit"},cxt={title:"Propriétés utilisateur",subtitle:"Parcourir et gérer les propriétés longTerm stockées par utilisateur",userIdPlaceholder:"Saisir l’ID utilisateur…",searchPlaceholder:"Filtrer les propriétés…",enterUserId:"Saisissez un ID utilisateur pour voir ses propriétés",key:"Clé",type:"Type",value:"Valeur",deleteAll:"Tout supprimer",deleteAllTitle:"Supprimer toutes les propriétés",deleteAllDesc:"Toutes les propriétés de cet utilisateur seront définitivement supprimées.",deleted:"Propriétés supprimées",noResults:"Aucune propriété trouvée",showingCount:"{{count}} propriétés"},dxt={title:"Déclencheurs d’agents",subtitle:"Associer des intentions aux déploiements d’agents pour le routage automatique",create:"Nouveau déclencheur",createTitle:"Créer un déclencheur",editTitle:"Modifier le déclencheur",intent:"Intention",deployments:"Déploiements d’agents",addDeployment:"Ajouter un agent",agents:"agents",empty:"Aucun déclencheur configuré",created:"Déclencheur créé",updated:"Déclencheur mis à jour",deleted:"Déclencheur supprimé",deleteTitle:"Supprimer le déclencheur",deleteDesc:"Supprimer définitivement le déclencheur pour l’intention « {{intent}} » ?",searchPlaceholder:"Filtrer par intention ou ID d’agent…"},uxt={title:"Découverte des capacités",subtitle:"Rechercher des agents par compétences et capacités déclarées",searchPlaceholder:"Rechercher des compétences…",strategyHighest:"Confiance la plus élevée",strategyAll:"Tous les résultats",registeredSkills:"Compétences enregistrées",noSkills:"Aucune compétence trouvée",matchingAgents:"Agents correspondants",noMatches:"Aucun agent trouvé pour cette compétence"},hxt={title:"Exporter l'agent",loading:"Chargement de l'arbre de ressources…",selectResources:"Sélectionner les ressources à exporter",required:"Requis",snippets:"Extraits",allSelected:"Toutes les ressources sélectionnées",countSelected:"{{count}} sur {{total}} ressources sélectionnées",exportSelected:"Exporter la sélection"},gxt={title:"Importer un agent",dropZone:"Déposez un fichier .zip ici ou cliquez pour parcourir",dropZoneHint:"Archive d'agent exportée (.zip)",strategyLabel:"Stratégie d'import",createNew:"Créer comme nouvel agent",createNewDesc:"Crée une copie avec de nouveaux identifiants. Idéal pour un premier import.",mergeSync:"Fusionner avec l'existant",mergeSyncDesc:"Met à jour les ressources existantes. Crée les ressources manquantes.",upgradeExisting:"Mettre à jour un agent existant",upgradeDesc:"Fait correspondre les ressources structurellement avec un agent cible. Idéal pour la promotion entre environnements.",syncRemote:"Synchroniser depuis une instance distante",syncDesc:"Connectez-vous à une autre instance EDDI et synchronisez un agent en direct.",importNow:"Importer maintenant",previewChanges:"Aperçu des modifications",selectTargetAgent:"Sélectionner l'agent cible",upgradeTargetHint:"Les ressources importées seront mises en correspondance structurelle avec cet agent.",chooseAgent:"— Choisir un agent —",sourceAgent:"Agent source (distant)",targetAgent:"Agent cible (local)",createNewTarget:"Créer un nouvel agent",resource:"Ressource",type:"Type",match:"Correspondance",action:"Action",new:"nouveau",updated:"mis à jour",unchanged:"inchangé",selected:"sélectionnés",mergeNow:"Importer la sélection",syncNow:"Synchroniser maintenant",upgradeNow:"Mettre à jour",importing:"Import de l'agent en cours…",contentIdentical:"Contenu identique",targetContent:"Cible",sourceContent:"Source"},fxt={title:"Synchronisation d'agents",subtitle:"Synchroniser les agents entre les instances EDDI",connection:"Instance source",sourceUrl:"URL de l'instance EDDI source",authToken:"Jeton d'autorisation",authHint:"Facultatif. Envoyé comme en-tête X-Source-Authorization.",connect:"Connecter",connected:"Connecté",agentsFound:"agents",connectionFailed:"Échec de la connexion",agentMapping:"Correspondance des agents",previewAll:"Tout prévisualiser",syncSelected:"Synchroniser la sélection",remote:"Distant",createNew:"Créer",changes:"modifications",agentsSelected:"agents sélectionnés",totalResources:"ressources",syncSuccess:"Synchronisation terminée",syncError:"Échec de la synchronisation",empty:"Connectez-vous à une instance source pour commencer la synchronisation des agents.",autoMatched:"Correspondance automatique",previewFirst:"Aperçu des modifications avant synchronisation"},pxt={actionCreate:"Nouveau",actionUpdate:"Mettre à jour",actionSkip:"À jour",actionConflict:"Conflit"},mxt={title:"Conversations utilisateur",subtitle:"Gérer les liaisons intent → utilisateur → conversation",lookup:"Recherche",intent:"Intention",userId:"ID utilisateur",agentId:"ID agent",environment:"Environnement",conversationId:"ID conversation",binding:"Liaison active",enterBoth:"Entrez l'intent et l'ID utilisateur",notFound:"Aucune liaison trouvée",create:"Créer une liaison",createTitle:"Créer une liaison",created:"Liaison créée",deleteTitle:"Supprimer la liaison",deleteDesc:`Supprimer la liaison pour l'intent "{{intent}}" et l'utilisateur "{{userId}}" ?`,deleted:"Liaison supprimée"},bxt={placeholder:"Rechercher pages, agents, actions…",noResults:"Aucun résultat.",recent:"Récents",navigate:"Navigation",agents:"Agents",actions:"Actions rapides",createAgent:"Créer un agent",openChat:"Ouvrir le chat",kbdNavigate:"naviguer",kbdSelect:"sélectionner",kbdClose:"fermer"},xxt={title:"Assistant de groupe",subtitle:"Composez une équipe de conseillers IA pour discuter de vos questions",backToGroups:"Retour aux groupes",templateTitle:"Commencer avec un modèle",templateDesc:"Choisissez une configuration prédéfinie ou partez de zéro.",startBlank:"Partir de zéro",blankDesc:"Tout configurer manuellement",configTitle:"Configuration du groupe",configDesc:"Nommez votre groupe et choisissez le style de discussion",namePlaceholder:"Ex. Conseil consultatif",descPlaceholder:"À quoi sert ce groupe ?",membersTitle:"Composez votre équipe",membersDesc:"Pour chaque place, choisissez un agent existant ou créez-en un nouveau.",addMember:"Ajouter un membre",refreshAgents:"Actualiser la liste",existingAgents:"agents existants",displayName:"Nom de l'agent",displayNamePlaceholder:"Donnez un nom à cet agent…",rolePlaceholder:"Rôle (ex. Marketing, Ingénierie)",useExisting:"Utiliser existant",createNew:"Créer nouveau",selectAgent:"Sélectionner un agent…",systemPrompt:"Prompt système",provider:"Fournisseur LLM",model:"Modèle",apiKey:"Clé API",apiKeyPlaceholder:"sk-…",createThisAgent:"Créer l'agent",creatingAgent:"Création de l'agent…",agentReady:"Agent créé et déployé",agentCreated:'Agent "{{name}}" créé',agentCreateFailed:"Échec de la création: {{error}}",moderator:"Modérateur",moderatorHint:"Synthétise la discussion",addModerator:"Ajouter un modérateur",removeModerator:"Supprimer le modérateur",createModerator:"Créer un agent modérateur",moderatorReady:"Agent modérateur prêt",moderatorCreated:"Agent modérateur créé",creatingModerator:"Création du modérateur…",creatingSlot:"Création de {{name}}…",creatingGroup:"Création du groupe…",needMembers:"Ajoutez au moins 2 membres pour continuer",reviewTitle:"Vérifier et créer",reviewDesc:"Vérifiez la configuration de votre groupe avant de le créer.",reviewMembers:"Membres",autoCreateNotice:"{{count}} agents seront créés automatiquement",autoCreateHint:"Chaque agent sera créé et déployé automatiquement avant l'assemblage du groupe.",unassignedWarning:"{{count}} membres sans agent assigné",unassignedHint:"Ces membres seront ignorés lors des discussions. Revenez pour assigner des agents.",flowPreview:"Flux de discussion",createGroup:"Créer le groupe",created:"Groupe créé !",viewGroup:"Ouvrir le groupe",createAnother:"Créer un autre",success:"Groupe créé avec succès !"},vxt={advisoryBoard:"Conseil consultatif",advisoryBoardDesc:"Un panel de conseillers experts pour les décisions stratégiques.",codeReview:"Panel de revue de code",codeReviewDesc:"Revue de code structurée avec opinions indépendantes et critique par les pairs.",riskAssessment:"Évaluation des risques",riskAssessmentDesc:"Panel avec un avocat du diable qui remet en question les hypothèses.",forecasting:"Panel de prévision",forecastingDesc:"Délibération anonyme de style Delphi pour des estimations impartiales.",proCon:"Débat pour/contre",proConDesc:"Débat structuré avec équipes pour et contre, suivi de réfutations.",roles:{marketingExpert:"Expert marketing",techLead:"Lead technique",financeDirector:"Directeur financier",legalCounsel:"Conseiller juridique",strategyConsultant:"Consultant en stratégie",seniorEngineer:"Ingénieur senior",architect:"Architecte",securityReviewer:"Réviseur sécurité",riskAnalyst:"Analyste risques",domainExpert:"Expert domaine",devilsAdvocate:"Avocat du diable",analystA:"Analyste A",analystB:"Analyste B",analystC:"Analyste C",analystD:"Analyste D",proAdvocate1:"Avocat pour 1",proAdvocate2:"Avocat pour 2",conAdvocate1:"Avocat contre 1",conAdvocate2:"Avocat contre 2"}},_xt={agentIdPlaceholder:"ID de l’agent pour traiter les messages",botToken:"Jeton de bot",botTokenHint:"Jeton OAuth du bot. Utilisez une référence coffre-fort pour la sécurité.",botTokenPlaceholder:"xoxb-… ou ${vault:slack-bot-token}",channel:"canal",channelId:"ID du canal Slack",channelIdCol:"ID du canal",channelIdHint:"Clic droit sur un canal Slack → Afficher les détails → copier l’ID du canal",channelsPlural:"canaux",channelType:"Type de canal",confirmDelete:"Supprimer le canal ?",confirmDeleteDesc:"Cette intégration de canal sera définitivement supprimée.",create:"Créer un canal",createTitle:"Créer une intégration de canal",defaultAgentId:"ID de l’agent par défaut",defaultTargetHint:"La cible par défaut traite tous les messages ne correspondant à aucun mot-clé déclencheur. Vous pouvez ajouter d’autres cibles après la création.",empty:"Aucun canal",emptyDesc:"Créez une intégration de canal pour connecter des agents à Slack.",name:"Nom",namePlaceholder:"ex. Engineering AI Hub",openSlackApps:"Ouvrir le tableau de bord Slack App",searchPlaceholder:"Rechercher des canaux…",signingSecret:"Secret de signature",signingSecretHint:"Depuis la page Informations de base de votre application Slack.",signingSecretPlaceholder:"Chaîne hex ou ${vault:slack-signing-secret}",slackSetupGuide:"Guide de configuration Slack",slackSetupSummary:"Créez une application Slack, configurez les portées du jeton de bot (app_mentions:read, chat:write, im:history, channels:history, groups:history), puis collez les identifiants ici.",target:"cible",targets:"cibles",targetsCol:"Cibles",type:"Type",unnamed:"Canal sans nom",version:"Version"},yxt={addTarget:"Ajouter une cible",addTrigger:"Ajouter un déclencheur…",agentId:"ID de l’agent",botToken:"Jeton de bot",channelId:"ID du canal Slack",cooldown:"Délai (s)",general:"Général",groupId:"ID du groupe",isDefault:"par défaut",maxCost:"Max €/jour",maxDaily:"Max/jour",name:"Nom",observe:"Observer",observeDesc:"Surveiller passivement et répondre sélectivement",observeKeywords:"Mots-clés déclencheurs",observeMimeTypes:"Types MIME déclencheurs",observeMode:"Mode observation",observeSettings:"Paramètres du mode observation",platformConfig:"Configuration de la plateforme",rawConfig:"Configuration brute",removeTarget:"Supprimer",requiredEvents:"Abonnements d’événements requis :",requiredScopes:"Portées de jeton de bot requises :",setDefault:"Définir par défaut",signingSecret:"Secret de signature",targetName:"Nom",targets:"Cibles de routage des messages",targetType:"Type",triggerHint:"Les utilisateurs saisissent « mot-clé : message » pour router vers cette cible",triggerKeywords:"Mots-clés déclencheurs",triggers:"déclencheurs",type:"Type de canal",webhookHint:"Collez cette URL dans le champ Request URL des Event Subscriptions de votre application Slack.",webhookUrl:"URL du webhook"},wxt={app:xbt,auth:vbt,nav:_bt,theme:ybt,language:wbt,pages:Cbt,common:Sbt,agents:kbt,agentDetail:Nbt,wizard:Ebt,setupWizard:Lbt,packages:Dbt,packageDetail:Tbt,packageEditor:Ibt,conversations:Abt,conversationDetail:Rbt,chat:Mbt,resources:Pbt,editor:Obt,rulesEditor:jbt,apiCallsEditor:Fbt,llmEditor:Bbt,outputEditor:Hbt,propertySetterEditor:Wbt,dictionaryEditor:Vbt,coordinator:zbt,contentEditor:Ubt,logs:$bt,secrets:qbt,audit:Kbt,schedules:Gbt,debugDrawer:Ybt,costDashboard:Qbt,memoryInspector:Xbt,logViewer:Zbt,promptViewer:Jbt,promptPreview:ext,studio:txt,ragEditor:nxt,onboarding:ixt,platform:sxt,stream:rxt,createOrWizard:oxt,groups:axt,memories:lxt,properties:cxt,triggers:dxt,capabilities:uxt,exportDialog:hxt,importDialog:gxt,syncPage:fxt,sync:pxt,userConversations:mxt,commandPalette:bxt,groupWizard:xxt,groupTemplates:vxt,channels:_xt,channelDetail:yxt},Cxt={title:"EDDI Manager",description:"Panel de administración de la plataforma de IA EDDI"},Sxt={login:"Iniciar sesión",logout:"Cerrar sesión",loading:"Autenticando…",sessionExpired:"Sesión expirada. Inicie sesión de nuevo.",profile:"Perfil",guest:"Invitado",userMenu:"Menú de usuario"},kxt={dashboard:"Panel",agents:"Agentes",packages:"Flujos de trabajo",conversations:"Conversaciones",coordinator:"Coordinador",schedules:"Programaciones",logs:"Registros",orphans:"Huérfanos",secrets:"Secretos",audit:"Registro de auditoría",quotas:"Cuotas",groups:"Grupos",chat:"Chat",resources:"Recursos",sectionManagement:"Gestión",sectionDevelopment:"Desarrollo",sectionOperations:"Operaciones",mainNavigation:"Navegación principal",openMenu:"Abrir menú de navegación",sectionCore:"Principal",sectionBuild:"Crear y probar",sectionMonitor:"Supervisión",sectionAdmin:"Administración",studio:"Estudio",gdpr:"Privacidad",memories:"Memoria del usuario",properties:"Propiedades",triggers:"Disparadores",capabilities:"Capacidades",sync:"Sincronización",channels:"Canales",userConversations:"Conversaciones de usuario",userData:"Datos del usuario",variables:"Variables"},Nxt={light:"Claro",dark:"Oscuro",system:"Sistema"},Ext={label:"Idioma",en:"English",de:"Deutsch",fr:"Français",es:"Español",ar:"العربية",zh:"中文",th:"ไทย",ja:"日本語",ko:"한국어",pt:"Português",hi:"हिन्दी"},Lxt={dashboard:{title:"Panel",subtitle:"Resumen de sus agents y conversaciones EDDI",activeAgents:"Agents activos",totalWorkflows:"Flujos de trabajo",totalResources:"Recursos",totalConversations:"Conversaciones",quickActions:"Acciones rápidas",recentAgents:"Agents recientes",noRecentAgents:"Aún no hay agents. ¡Cree su primer agent!"},agents:{title:"Agentes",subtitle:"Gestione sus agents de IA conversacional"},packages:{title:"Flujos de trabajo",subtitle:"Configure workflows y extensiones de agents"},conversations:{title:"Conversaciones",subtitle:"Vea y gestione las conversaciones de los agents"},resources:{title:"Recursos",subtitle:"Gestione reglas de comportamiento, diccionarios, salidas y más"},chat:{title:"Chat",subtitle:"Hable con sus agents desplegados"},channels:{title:"Canales",subtitle:"Conecte agentes y grupos a plataformas de mensajería como Slack"},groups:{title:"Grupos",subtitle:"Grupos de discusión multi-agente para debate estructurado y colaboración"}},Dxt={loading:"Cargando...",error:"Algo salió mal",retry:"Reintentar",save:"Guardar",cancel:"Cancelar",delete:"Eliminar",create:"Crear",edit:"Editar",search:"Buscar...",noResults:"No se encontraron resultados",duplicate:"Duplicar",close:"Cerrar",skipToMain:"Ir al contenido principal",opensNewTab:"abre en nueva pestaña",moreActions:"Más acciones",sortByName:"Ordenar por nombre",sortByVersion:"Ordenar por versión",sortByModified:"Ordenar por fecha de modificación",apply:"Aplicar",copied:"Copiado",copy:"Copiar",saving:"Guardando…",showMore:"Show More",showLess:"Show Less",copyFailed:"Error al copiar al portapapeles"},Txt={deploy:"Desplegar",undeploy:"Retirar",createAgent:"Crear agent",createTitle:"Crear nuevo agent",name:"Nombre",namePlaceholder:"Mi Agent",description:"Descripción",descriptionPlaceholder:"Describa qué hace este agent...",empty:"Aún no hay agents. ¡Cree su primer agent!",confirmDelete:"¿Está seguro de que desea eliminar este agent?",count_one:"{{count}} agente",count_other:"{{count}} agentes",export:"Exportar",exporting:"Exportando...",exportSuccess:"Agent exportado con éxito",import:"Importar agent",importing:"Importando...",importSuccess:"Agent importado con éxito",importError:"Error al importar el agent",emptyDescription:"Use el asistente para crear un agente completamente configurado en minutos.",chat:"Chat",deployAndChat:"Desplegar y chatear",openExternalChat:"Abrir en nueva pestaña"},Ixt={title:"Detalles del agent",backToAgents:"Volver a Agents",packages:"Flujos de trabajo",noWorkflows:"Aún no se han añadido workflows",addWorkflow:"Añadir workflow",selectWorkflow:"Seleccionar workflow para añadir",rawConfig:"Configuración sin procesar",editName:"Editar nombre",editDescription:"Editar descripción",clickToEdit:"Clic para editar",noDescription:"Sin descripción",duplicate:"Duplicar",duplicating:"Duplicando...",duplicateSuccess:"Agent duplicado con éxito",environments:"Entornos",envProduction:"Producción",envTest:"Prueba",savingAgent:"Guardando agent...",savedAgent:"Agent guardado con éxito",saveError:"Error al guardar el agent",deployToEnv:"Desplegar en {{env}}",undeployFromEnv:"Retirar de {{env}}",openStudio:"Abrir en el Estudio",maxKeyLength:"Longitud máx. de clave",maxValueLength:"Longitud máx. de valor",maxWritesPerTurn:"Escrituras máx./turno",dreamSchedule:"Programación (cron)",dreamLlmProvider:"Proveedor LLM",dreamLlmModel:"Modelo LLM",dreamMaxCost:"Coste máx./ejecución ($)",dreamPruneDays:"Limpieza tras (días)",dreamBatchSize:"Tamaño del lote",detectContradictions:"Detectar contradicciones",summarizeInteractions:"Resumir interacciones",confidenceLow:"Bajo",confidenceMedium:"Medio",confidenceHigh:"Alto",visibilitySelf:"Propio",visibilityGlobal:"Global",onCapEvict:"Eliminar el más antiguo",onCapReject:"Rechazar",recallMostRecent:"Más reciente",recallMostRelevant:"Más relevante",channels:"Conectores de canal",channelsDesc:"Conecta este agente a canales de Slack. Cada conector se configura de forma independiente con sus propias credenciales, soportando configuraciones multi-workspace.",noChannels:"No hay canales configurados",noChannelsDesc:"Añade un canal de Slack para que los usuarios interactúen con este agente desde Slack.",addSlackChannel:"Añadir canal de Slack",slackChannel:"Canal de Slack",removeChannel:"Eliminar canal",removeChannelConfirm:"¿Eliminar este conector de canal de Slack?",removeChannelDesc:"This action will permanently disconnect this channel.",channelId:"ID del canal",channelIdHint:"Los ID de canal comienzan con C seguido de caracteres alfanuméricos en mayúsculas",botToken:"Token del bot",botTokenPlaceholder:"xoxb-… o ${vault:slack-bot-token}",botTokenHint:"Token OAuth de usuario bot de Slack. Use una referencia de vault para mayor seguridad.",signingSecret:"Secreto de firma",signingSecretPlaceholder:"Cadena hexadecimal o ${vault:slack-signing-secret}",signingSecretHint:"De la página Basic Information de tu aplicación Slack. Usa una referencia de vault para seguridad.",groupIdOptional:"ID de grupo (opcional)",groupIdPlaceholder:"ID de configuración de grupo multi-agente",groupIdHint:'Activa discusiones multi-agente "group: pregunta" desde este canal de Slack.',slackSetupGuide:"Guía de configuración de Slack",slackWebhookUrl:"URL del webhook",slackWebhookCopied:"URL del webhook copiada",slackStep1:"Crea una aplicación Slack en api.slack.com/apps e instálala en tu workspace.",slackStep2:"Copia el token del bot (xoxb-…) y el secreto de firma en el vault de EDDI y configura los canales abajo.",slackStep3:"Luego activa Event Subscriptions en tu aplicación Slack, pega la URL del webhook arriba y suscríbete a:",slackSetupNote:"Importante: Configura el canal abajo antes de activar Event Subscriptions — Slack envía un desafío de verificación de URL que requiere que el secreto de firma esté configurado en EDDI.",slackRequiredScopes:"Permisos requeridos para el token del bot"},Axt={title:"Asistente de Agent"},Rxt={title:"Asistente de creación de agent",subtitle:"Cree un agent completamente configurado en minutos",backToAgents:"Volver a Agents",next:"Siguiente",back:"Atrás",createOnly:"Solo crear",createAndDeploy:"Crear y desplegar",typeTitle:"¿Qué tipo de agent?",typeDesc:"Elija el tipo de agent que desea crear",standardAgent:"Agente estándar",apiAgent:"Agente API",standardDesc:"IA conversacional con LLM, herramientas opcionales, Quick Replies y análisis de sentimiento",apiDesc:"Importe una especificación OpenAPI/Swagger para generar automáticamente un agent API",infoTitle:"Identidad del agent",infoDesc:"Dé un nombre y personalidad a su agent",agentName:"Nombre del agent",namePlaceholder:"ej. Bot de atención al cliente",systemPrompt:"Prompt del sistema",promptPlaceholder:"Eres un asistente de IA útil que...",promptHint:"Esta instrucción define cómo se comporta y responde su agent.",llmTitle:"Configuración LLM",llmDesc:"Elija el modelo de IA que impulsa su agent",provider:"Proveedor",model:"Modelo",apiKey:"Clave API",baseUrl:"URL base",baseUrlPlaceholder:"URL de endpoint personalizado",optional:"opcional",apiSpecTitle:"Especificación OpenAPI",apiSpecDesc:"Proporcione la especificación OpenAPI/Swagger de su API",specByUrl:"URL",specByFile:"Archivo",specByPaste:"Pegar",fetch:"Obtener",specFetched:"¡Especificación cargada!",specFetchError:"Error al obtener la especificación",dropFile:"Arrastre su archivo OpenAPI aquí",dropHint:"Formato JSON o YAML",browse:"Buscar archivos",pasteSpec:"Pegue su JSON o YAML OpenAPI/Swagger aquí...",specLoaded:"Archivo cargado: {{name}}",specReady:"Especificación cargada ({{chars}} caracteres)",apiBaseUrlLabel:"URL base de la API",apiAuthLabel:"Cabecera de autenticación API",endpointFilter:"Filtro de endpoints",endpointFilterPlaceholder:"Separados por comas: GET /users, POST /orders",featuresTitle:"Funciones y opciones",featuresDesc:"Personalice las capacidades de su agent",introMessage:"Mensaje de bienvenida",introMessageDesc:"Mensaje mostrado al inicio de una conversación",quickReplies:"Respuestas rápidas",quickRepliesDesc:"El LLM genera sugerencias de respuestas clicables",sentiment:"Análisis de sentimiento",sentimentDesc:"Detectar el ánimo, intención y urgencia del usuario en tiempo real",structuredOutput:"Salida estructurada",structuredOutputDesc:"El LLM responde con un objeto JSON en lugar de texto plano",structuredOutputInfo:"Al activar esto, el LLM responde con un objeto JSON con campos estructurados. Se añade un esquema JSON al prompt del sistema y el modelo se configura en modo de respuesta JSON.",builtInTools:"Herramientas integradas",builtInToolsDesc:"Activar la biblioteca de herramientas integradas de EDDI (calculadora, fecha/hora, etc.)",toolsWhitelist:"Whitelist (vacío = todas)",mcpServers:"Servidores MCP",mcpServersDesc:"Servidores Model Context Protocol para herramientas externas",autoDeploy:"Despliegue automático",autoDeployDesc:"Desplegar el agent inmediatamente después de crearlo",environment:"Entorno",envProduction:"Producción",envTest:"Prueba",reviewTitle:"Revisar y crear",reviewDesc:"Revise su configuración antes de crear",reviewType:"Tipo",reviewName:"Nombre",reviewPrompt:"Prompt del sistema",reviewProvider:"Proveedor",reviewModel:"Modelo",reviewSpec:"Espec. OpenAPI",reviewIntro:"Mensaje de bienvenida",reviewDeploy:"Desplegar",success:"¡Agent creado con éxito!",agentCreated:"¡Agent creado!",deployed:"Desplegado",endpointsParsed:"{{count}} endpoints API analizados",viewAgent:"Ver agent",createAnother:"Crear otro",allTools:"Todas las herramientas",selectSpecific:"Selección manual",allToolsInfo:"Las {{count}} herramientas integradas estarán disponibles para su agente. Elija «Selección manual» para limitar las herramientas activas.",availableTools:"Herramientas disponibles",toolCount:"{{selected}} de {{total}} seleccionadas"},Mxt={createWorkflow:"Crear workflow",createTitle:"Crear nuevo workflow",name:"Nombre",namePlaceholder:"Mi Workflow",description:"Descripción",descriptionPlaceholder:"Describa qué hace este workflow...",noDescription:"Sin descripción",empty:"Aún no hay workflows. ¡Cree su primer workflow!",confirmDelete:"¿Está seguro de que desea eliminar este workflow?",count_one:"{{count}} flujo de trabajo",count_other:"{{count}} flujos de trabajo",emptyDescription:"Los workflows definen el pipeline de procesamiento de sus agentes."},Pxt={title:"Detalles del workflow",backToWorkflows:"Volver a Workflows",extensions:"Extensiones",noExtensions:"No hay extensiones en este workflow",rawConfig:"Configuración sin procesar"},Oxt={title:"Editor de workflow",pipeline:"Pipeline de extensiones",addHint:"Añada extensiones para construir su pipeline",addHintDialog:"Seleccione un tipo de extensión para añadir",reorder:"Reordenar extensión",saved:"Workflow guardado con éxito",saveError:"Error al guardar el workflow",noTasks:"No hay tareas en este workflow",addTask:"Añadir tarea"},jxt={searchPlaceholder:"Buscar por ID de conversación...",id:"Conversación",agent:"Agente",state:"Estado",lastActivity:"Última actividad",actions:"Acciones",empty:"Aún no hay conversaciones. ¡Despliegue un agent y comience a chatear!",confirmDelete:"¿Está seguro de que desea eliminar esta conversación?",count_one:"{{count}} conversación",count_other:"{{count}} conversaciones",emptyDescription:"Despliegue un agente e inicie una conversación desde la página Chat."},Fxt={continueChat:"Continuar en el chat",searchTranscript:"Buscar en la conversación…",exportMd:"Exportar como Markdown",toolSummary:"Uso de herramientas",totalCost:"Coste total",cacheHitRate:"Tasa de acierto de caché"},Bxt={selectAgent:"Seleccione un agent...",noAgents:"No hay agents desplegados disponibles. Despliegue un agent primero.",placeholder:"Escriba un mensaje...",send:"Enviar",newConversation:"Nueva conversación",endConversation:"Finalizar conversación",streaming:"Streaming",thinking:"Pensando...",connectionError:"Error de conexión. Intente de nuevo.",empty:"¡Seleccione un agent y comience a chatear!",history:"Historial",undo:"Deshacer último mensaje",redo:"Rehacer mensaje",continueConversation:"Continuar",noHistory:"Sin historial de conversaciones.",attach:"Adjuntar archivo",attachUploading:"Subiendo...",attachSuccess:"Archivo adjuntado",attachError:"Error al subir archivo",retry:"Reintentar último paso",retrySuccess:"Paso re-ejecutado",retryError:"Reintento fallido",showActivity:"Mostrar actividad",hideActivity:"Ocultar actividad",scrollToBottom:"Ir al final",copyMessage:"Copiar mensaje",copied:"¡Copiado!",activity:{processing:"Procesando…",steps:"pasos",toolCalls:"llamadas a herramientas",toolCall:"Llamada a herramienta",toolResult:"Resultado"},channels:{title:"Canales",subtitle:"Conectar agentes y grupos a plataformas como Slack"},context:{conversationId:"ID de conversación",agentVersion:"Versión del agente",startTime:"Inicio",stepCount:"Pasos",show:"Mostrar info de la conversación",hide:"Ocultar info de la conversación"},agentTyping:"El agente está escribiendo"},Hxt={unnamed:"Recurso sin nombre",noDescription:"Sin descripción",backToResources:"Volver a Recursos",backToList:"Volver a {{type}}",unknownType:"Tipo de recurso desconocido",rawConfig:"Configuración sin procesar",rawConfigHint:"Configuración JSON de este recurso",create:"Crear {{type}}",createTitle:"Crear {{type}}",createDescription:"Crear una configuración {{type}} vacía. Puede editarla después.",confirmDelete:"¿Está seguro de que desea eliminar este/a {{type}}?",empty:"Aún no hay recursos {{type}}.",itemCount_one:"{{count}} elemento",itemCount_other:"{{count}} elementos",count_one:"{{count}} recurso",count_other:"{{count}} recursos",types:{rules:{name:"Reglas de comportamiento",description:"Definir reglas de flujo de conversación y lógica de decisión"},apicalls:{name:"Llamadas HTTP",description:"Configurar integraciones de API externas y webhooks"},output:{name:"Conjuntos de salida",description:"Gestionar plantillas de respuesta y variantes de salida"},dictionary:{name:"Diccionarios",description:"Definir patrones de reconocimiento de palabras y frases"},llm:{name:"LLM",description:"Configurar modelos de IA, prompts y enlaces de herramientas"},propertysetter:{name:"Definidor de propiedades",description:"Configurar propiedades de conversación y gestionar slots"},mcpcalls:{name:"Llamadas MCP",description:"Configurar conexiones MCP y llamadas de herramientas deterministas"},rag:{name:"Bases de conocimiento",description:"Configurar bases de conocimiento RAG para recuperación de documentos"},snippets:{name:"Fragmentos de prompt",description:"Bloques reutilizables para la composicion de prompts del sistema"}},emptyDescription:"Cree su primer(a) {{type}} para usarlo en workflows."},Wxt={formTab:"Formulario",jsonTab:"JSON",save:"Guardar",discard:"Descartar",saving:"Guardando...",saved:"Guardado correctamente",saveError:"Error al guardar",dirty:"Cambios sin guardar",version:"Versión",versionPicker:"Seleccionar versión",readOnly:"Solo lectura",formPlaceholder:"Editor visual próximamente. Use la pestaña JSON para editar.",jsonSchema:"Validación de esquema activa",cascadeMode:"Los cambios se propagarán al workflow y agent padre",usedInAgents:"Usado en {{count}} agent(s)",updateUsageHint:"¿Actualizar los workflows y agents seleccionados a la nueva versión?",updateUsage:"Actualizar seleccionados",skipUpdate:"Omitir",cascading:"Actualizando...",cascadeSuccess:"Actualización en cascada completada",invalidJson:"JSON no válido — cambie a la pestaña JSON para corregir."},Vxt={appendActions:"Añadir acciones",expressionsAsActions:"Expresiones como acciones",groups:"Grupos de comportamiento",addGroup:"Añadir grupo",groupName:"Nombre del grupo",executionStrategy:"Estrategia de ejecución",rules:"Reglas",addRule:"Añadir regla",ruleName:"Nombre de regla",actions:"Acciones",noActions:"Sin acciones",addAction:"Añadir",actionPlaceholder:"ej. greet, get_weather",conditions:"Condiciones",addCondition:"Añadir condición",conditionType:"Tipo de condición",nestedConditions:"Condiciones anidadas",configKey:"Clave",configValue:"Valor",addConfig:"Añadir config",removeRule:"Eliminar regla",removeGroup:"Eliminar grupo",removeCondition:"Eliminar condición",noGroups:"No hay grupos de comportamiento definidos",noRules:"No hay reglas en este grupo",noConditions:"Sin condiciones"},zxt={targetServerUrl:"URL del servidor destino",targetServerUrlPlaceholder:"https://api.example.com",calls:"Llamadas HTTP",addCall:"Añadir llamada HTTP",callName:"Nombre de llamada",callDescription:"Descripción",descriptionPlaceholder:"Descripción en lenguaje natural para agents LLM",request:"Solicitud",method:"Método",path:"Ruta",pathPlaceholder:"/api/endpoint",headers:"Cabeceras",addHeader:"Añadir header",queryParams:"Parámetros de consulta",addQueryParam:"Añadir parámetro",contentType:"Tipo de contenido",body:"Cuerpo de la solicitud",bodyPlaceholder:"Plantilla de cuerpo JSON...",parameters:"Parámetros (para agents LLM)",paramName:"Nombre del parámetro",paramDescription:"Descripción",addParam:"Añadir parámetro",options:"Opciones",saveResponse:"Guardar respuesta",responseObjectName:"Nombre del objeto respuesta",responseHeaderObjectName:"Nombre del objeto header respuesta",fireAndForget:"Enviar y olvidar",batchCalls:"Llamadas en lote",iterationObjectName:"Nombre del objeto iteración",prePostInstructions:"Instrucciones pre/post",preRequest:"Pre-petición",postResponse:"Post-respuesta",removeCall:"Eliminar llamada",noCalls:"No hay llamadas HTTP configuradas",actions:"Acciones desencadenantes",noActions:"Sin acciones",actionPlaceholder:"ej. get_weather"},Uxt={tasks:"Tareas LLM",addTask:"Añadir tarea",noTasks:"No hay tareas LangChain configuradas",removeTask:"Eliminar tarea",taskId:"ID de tarea",description:"Descripción",descriptionPlaceholder:"Qué hace esta tarea",triggerActions:"Acciones desencadenantes",noActions:"Sin acciones",actionPlaceholder:"ej. help, chat",systemPrompt:"Prompt del sistema",systemPromptPlaceholder:"Eres un asistente útil...",modelParams:"Parámetros del modelo",addParam:"Añadir parámetro",agentMode:"Modo agente",enableBuiltInTools:"Activar herramientas integradas",toolWhitelist:"Whitelist de herramientas (vacío = todas)",enableHttpCallTools:"Auto-descubrimiento de herramientas HTTP Call",enableHttpCallToolsDesc:"Exponer automáticamente todas las extensiones httpcall del workflow como herramientas LLM",httpCallTools:"URIs de herramientas HTTP",httpCallToolsHint:"URIs httpcall explícitas (además de las auto-descubiertas)",addTool:"Añadir URI de herramienta",mcpServers:"Servidores MCP",mcpServersDesc:"Servidores MCP externos cuyas herramientas estarán disponibles para el LLM",addMcpServer:"Añadir servidor MCP",mcpUrlPlaceholder:"http://localhost:7070/mcp",mcpName:"Nombre",mcpApiKey:"API Key / ref. vault",historyLimit:"Límite de historial",historyLimitHint:"(-1 = ilimitado)",budgetPerf:"Presupuesto y rendimiento",maxBudget:"Presupuesto máx. ($)",costTracking:"Seguimiento de costes",toolCaching:"Caché de herramientas",rateLimiting:"Límite de tasa",defaultRate:"Tasa predeterminada (pet./min.)",prePostInstructions:"Instrucciones pre/post",preRequest:"Pre-petición",postResponse:"Post-respuesta",enableMcpCallTools:"Descubrimiento automático de herramientas MCP",enableMcpCallToolsDesc:"Expone automáticamente todas las extensiones mcpcalls del flujo como herramientas LLM",a2aAgents:"Agentes A2A",a2aAgentsDesc:"Agentes remotos compatibles con A2A cuyas habilidades se convierten en herramientas LLM",addA2aAgent:"Añadir agente A2A",a2aUrlPlaceholder:"https://remote.example.com/a2a/agents/...",a2aName:"Nombre visible",a2aApiKey:"${vault:my-a2a-key}",a2aTimeout:"Tiempo límite (ms)",a2aSkillsFilter:"Filtro de habilidades (vacío = todas)",cascade:"Cascada de modelos",cascadeDesc:"Try a cheap/fast model first. If confidence is too low, automatically escalate to a more powerful (and expensive) model.",cascadeEnable:"Activar cascada de modelos",cascadeStrategy:"Estrategia",strategyCascade:"Escalado secuencial",strategyParallel:"Paralelo (futuro)",cascadeStrategyHint:"Empieza por el modelo más económico y escala si la confianza es baja",cascadeEvalStrategy:"Evaluación de confianza",cascadeEvalHint:"Cómo determinar si la respuesta es suficiente",evalStructured:"Salida estructurada (JSON)",evalHeuristic:"Heurística (detección de vacilación)",evalJudge:"Modelo juez (sub-LLM)",evalNone:"Ninguna (aceptar siempre)",cascadeInAgent:"Usar cascada también en modo agente (con herramientas)",cascadeSteps:"Cascade Steps",cascadeStepsDesc:"Order matters: first step tried first. Last step is always accepted.",cascadeModelName:"p. ej. claude-sonnet-4-6",cascadeConfidence:"Min. Confidence (0-1)",cascadeConfidencePlaceholder:"vacío = aceptar siempre",cascadeTimeout:"Tiempo límite (ms)",addCascadeStep:"Añadir paso de cascada",parallelExecution:"Ejecución paralela de herramientas",parallelExecutionDesc:"Run independent tool calls concurrently",parallelTimeout:"Tiempo límite (ms)",maxToolIterations:"Máx. iteraciones de herramientas",maxToolIterationsHint:"(predeterminado 10)",toolRateLimits:"Límites de tasa por herramienta",toolRateLimitsDesc:"Override default rate for specific tools",toolName:"Nombre de herramienta",addToolRate:"Añadir límite",retryConfig:"Configuración de reintentos",retryDesc:"Configure automatic retries with exponential backoff.",retryMaxAttempts:"Máx. intentos",retryDelay:"Retardo inicial (ms)",retryMultiplier:"Factor de backoff",retryMaxDelay:"Retardo máx. (ms)",ragConfig:"RAG (búsqueda de conocimiento)",ragDesc:"Augment LLM responses with retrieved documents.",ragHttpCall:"URI de llamada HTTP",ragEmbeddingModel:"Modelo de embedding",ragEmbeddingModelPlaceholder:"p. ej. text-embedding-3-small",ragEmbeddingStore:"Almacén de embeddings",ragEmbeddingStorePlaceholder:"p. ej. pgvector, qdrant",ragMaxResults:"Máx. resultados",ragMinScore:"Min Similarity Score (0-1)",moveDown:"Bajar",moveUp:"Subir",execution:"Ejecución",budgetCosts:"Presupuesto y costes",preRequestDesc:"Establecer o transformar propiedades antes de que se ejecute el LLM.",postResponseDesc:"Procesar la salida del LLM: establecer propiedades, construir mensajes de salida y generar respuestas rápidas.",postPropertyInstructions:"Instrucciones de propiedades",postOutputInstructions:"Instrucciones de salida",postQrInstructions:"Instrucciones de respuestas rápidas",allSkills:"Todas las habilidades",skillPlaceholder:"p. ej. order-tracking",modeAgent:"Agente",modeChat:"Chat",perMinute:"/min",allTools:"Todas las herramientas",selectSpecific:"Selección manual",allToolsInfo:"Las {{count}} herramientas integradas están disponibles para el LLM. Elija «Selección manual» para limitar las herramientas expuestas.",availableTools:"Herramientas disponibles",toolCount:"{{selected}} de {{total}} seleccionadas",toolSources:"Fuentes de herramientas del flujo",toolSourcesInfo:"Ambas fuentes están activas por defecto — todas las llamadas HTTP y MCP del flujo se exponen automáticamente como herramientas LLM. Desactive una fuente para excluirla.",included:"Incluido"},$xt={language:"Idioma",langPlaceholder:"ej. en, es",outputSets:"Conjuntos de salida",addOutputSet:"Añadir conjunto de salida",noOutputSets:"No hay conjuntos de salida configurados",actionName:"Nombre de acción",timesOccurred:"×",removeOutput:"Eliminar",outputs:"Salidas",alternativeGroup:"Grupo alternativo",addAlternative:"Añadir alternativa",addOutputGroup:"Añadir grupo de salida",textPlaceholder:"Texto de salida...",urlPlaceholder:"URL…",delayMs:"Retardo (ms)",quickReplies:"Respuestas rápidas",noQuickReplies:"Sin Quick Replies",addQuickReply:"Añadir Quick Reply",qrValue:"Texto del botón",qrExpressions:"Expresiones",default:"Por defecto"},qxt={setters:"Definidores de propiedades",addSetter:"Añadir setter",noSetters:"No hay Property Setters configurados",removeSetter:"Eliminar",triggerActions:"Acciones desencadenantes",noActions:"Sin acciones",actionPlaceholder:"ej. greet, fallback",properties:"Propiedades",noProperties:"Sin propiedades",addProperty:"Añadir propiedad",propName:"Nombre de propiedad",propValue:"Valor / expresión",fromPath:"Ruta de origen",fromObjectPath:"fromObjectPath",override:"Sobrescribir",propsCount:"prop.",untitled:"(sin acciones)"},Kxt={language:"Idioma",langPlaceholder:"ej. en, es",words:"Palabras",addWord:"Añadir palabra",wordPlaceholder:"ej. hola",phrases:"Frases",addPhrase:"Añadir frase",phrasePlaceholder:"ej. buenos días",regExs:"Expresiones regulares",addRegEx:"Añadir RegEx",regexPlaceholder:"Expresión regular",expressionPlaceholder:"ej. greeting(hello)",frequency:"Frecuencia",none:"Ninguna definida"},Gxt={title:"Panel del coordinador",subtitle:"Supervisar el procesamiento de conversaciones y gestionar entradas dead-letter",type:"Tipo de coordinador",connection:"Conexión",processed:"Tareas procesadas",deadLettered:"Mensajes muertos",activeQueues:"Colas activas",queued:"en cola",deadLetterTitle:"Cola de mensajes muertos",noDeadLetters:"Sin entradas dead-letter",colId:"ID",colConversation:"Conversación",colError:"Error",colTime:"Hora",colActions:"Acciones",replay:"Reintentar",discard:"Descartar",purgeAll:"Purgar todo",confirmPurge:"¿Purgar todo?",yes:"Sí",cancel:"Cancelar",replaySuccess:"Dead-letter reintentada",replayError:"Error al reintentar",discardSuccess:"Dead-letter descartada",discardError:"Error al descartar",purgeSuccess:"Todas las entradas dead-letter eliminadas",purgeError:"Error al purgar",empty:"No hay datos del coordinador disponibles",emptyHint:"El servicio del coordinador puede estar iniciándose. Los datos aparecerán automáticamente."},Yxt={expand:"Expandir",expandHint:"Pantalla completa (Ctrl+Mayús+F)",close:"Hecho",lines:"líneas",chars:"caracteres",fullscreenTitle:"Editor de contenido",fullscreenDescription:"Editor en pantalla completa. Escape para cerrar."},Qxt={title:"Registros",description:"Supervisar el flujo de logs en tiempo real o buscar en el historial.",tabLive:"En vivo",tabHistory:"Historial",connected:"Conectado",disconnected:"Desconectado",filterAgent:"ID del agente…",filterConversation:"ID de conversación...",filterInstance:"ID de instancia...",allLevels:"Todos los niveles",pause:"Pausa",resume:"Reanudar",clear:"Limpiar",search:"Buscar",waitingForLogs:"Esperando logs...",connectingStream:"Conectando al stream...",noHistoryLogs:"No se encontraron logs históricos.",entryCount:"{{count}} entradas",showStacktrace:"Mostrar stacktrace ({{count}} frames)",hideStacktrace:"Ocultar stacktrace",allAgents:"Todos los agentes",allConversations:"Todas las conversaciones",waitingHint:"Los logs aparecerán aquí a medida que lleguen del backend.",noHistoryHint:"Intente ajustar los filtros o buscar un agente o conversación diferente.",searchConversations:"Buscar por ID, agente, usuario…",stepsCount:"{{count}} pasos",noConversationsFound:"No se encontraron conversaciones",useConversationId:"Usar ID: {{id}}",searchLogs:"Buscar logs…",errors:"errores",warnings:"advertencias",infos:"info",debugs:"depuración",filteredCount:"{{shown}} de {{total}} entradas",copyEntry:"Copiar entrada de log",export:"Exportar",stateReady:"Listo",stateActive:"Activo",stateError:"Error",stateEnded:"Finalizado"},Xxt={title:"Bóveda de secretos",description:"Gestionar secrets cifrados en el vault. Los valores nunca se exponen.",tenantId:"ID del inquilino",refresh:"Cargar secrets",create:"Añadir secret",createTitle:"Añadir secret",keyName:"Nombre de clave",keyNameLabel:"Nombre de clave",keyNamePlaceholder:"ej. apiKey, dbPassword",valueLabel:"Valor del secret",valuePlaceholder:"Introduzca el valor del secret…",storeWarning:"El valor será cifrado. No podrá recuperarse una vez almacenado.",store:"Almacenar secret",storeSuccess:'Secret "{{key}}" almacenado',deleteSuccess:'Secret "{{key}}" eliminado',created:"Creado",lastAccessed:"Último acceso",checksum:"Suma de verificación",actions:"Acciones",confirmDeleteTitle:"Eliminar secret",confirmDeleteMessage:'¿Está seguro de que desea eliminar permanentemente "{{key}}"? Esta acción no se puede deshacer.',empty:"No se encontraron secrets",emptyHint:"Cree un secret o cambie los filtros de namespace arriba.",vaultUp:"Vault en línea",vaultDown:"Vault fuera de línea",descriptionLabel:"Descripción (opcional)",descriptionPlaceholder:"p. ej. Clave API OpenAI para producción",descriptionCol:"Descripción",reference:"Referencia",willUseRef:"Referencia:",copyRef:"Copiar referencia del cofre",refCopied:"Copiado: {{ref}}",lastRotated:"Última rotación",scopeExplanation:"Los secretos están limitados por inquilino y se comparten entre todos los agentes. Refiérase a ellos con ${vault:keyName}. El acceso lo controla el autor de la configuración.",creatingFor:'Almacenando en el inquilino "{{tenant}}" — disponible para todos los agentes',vaultNotConfigured:"El cofre de secretos no está configurado",viewDocs:"Ver documentación",selectAgentFirst:"Seleccione primero un agente",tableTitle:'{{count}} secreto(s) en el inquilino "{{tenant}}"'},Zxt={title:"Registro de auditoría",description:"Explore el registro de auditoría inmutable para cumplimiento y depuración.",byConversation:"Por conversación",byAgent:"Por agent",conversationIdPlaceholder:"Introduzca ID de conversación...",agentIdPlaceholder:"Introduzca Agent ID...",versionPlaceholder:"Versión (opcional)",search:"Buscar",entries:"entradas",totalDuration:"total",totalCost:"coste total",step:"Paso",tasks:"tareas",input:"Entrada",output:"Salida",llmDetail:"Detalle LLM",toolCalls:"Llamadas a herramientas",hmacIntegrity:"Integridad HMAC verificada",empty:"Buscar entradas de auditoría",emptyHint:"Introduzca un ID de conversación o agent arriba para explorar el audit trail.",noResults:"No se encontraron entradas de auditoría",noResultsHint:"Pruebe con otro ID o verifique que la conversación ha sido procesada.",loadMore:"Cargar más",selectAgent:"Select an agent…",conversations:"conversations",emptyAgent:"Select an agent to view its audit trail",emptyAgentHint:"Choose a deployed agent from the dropdown above to see all its audit records.",export:"Export",autoRefreshToggle:"Toggle auto-refresh (every 10s)",autoRefreshOn:"Auto",autoRefreshOff:"Auto",integrityVerified:"All entries cryptographically signed",integrityVerifiedDesc:"{{count}} of {{total}} entries have HMAC-SHA256 signatures",integrityPass:"SIGNED",integrityPartial:"Partially signed audit trail",integrityPartialDesc:"{{count}} of {{total}} entries have HMAC signatures",integrityNone:"Unsigned audit entries",integrityNoneDesc:"Configure a vault master key to enable automatic HMAC-SHA256 signing on all future audit entries.",signed:"Signed",allSigned:"All signed"},Jxt={title:"Programaciones",subtitle:"Gestionar disparadores programados de agents — Cron y Heartbeats",create:"Crear programación",createTitle:"Crear programación",createSuccess:"Programación creada con éxito",createError:"Error al crear la programación",creating:"Creando...",name:"Nombre",namePlaceholder:"ej. Verificación diaria",triggerType:"Tipo de disparador",cronExpression:"Expresión Cron",interval:"Intervalo (segundos)",agentId:"Agent ID",agentIdPlaceholder:"Introduzca Agent ID...",environment:"Entorno",message:"Mensaje",messagePlaceholder:"Mensaje a enviar al agent",conversationStrategy:"Estrategia de conversación",total:"Programaciones totales",active:"Activas",failedCount:"Fallidas / Dead-Lettered",nextFireLabel:"Próxima ejecución",tableTitle:"Todas las programaciones",empty:"Aún no hay programaciones",emptyHint:"Cree una programación para automatizar disparadores de agents.",colName:"Nombre",colType:"Tipo",colSchedule:"Programación",colAgent:"Agente",colStatus:"Estado",colNextFire:"Próxima ejec.",colLastFired:"Última ejec.",colActions:"Acciones",enable:"Activar",disable:"Desactivar",enabled:"Programación activada",disabled:"Programación desactivada",toggleError:"Error al cambiar estado",fireNow:"Ejecutar ahora",fired:"Programación ejecutada con éxito",fireError:"Error en la ejecución",retry:"Reintentar",retrySuccess:"Programación reencolada",retryError:"Error al reintentar",deleteSuccess:"Programación eliminada",deleteError:"Error al eliminar la programación",fireHistory:"Historial de ejecución"},evt={title:"Depuración",tabPipeline:"Pipeline",tabCosts:"Costes",tabMemory:"Memoria",tabLogs:"Registros",tabPrompt:"Prompt",turn:"Turno",latest:"Último",noPipeline:"Envíe un mensaje para ver el rastreo del pipeline",processing:"Procesando...",actions:"Acciones",confidence:"Confianza",duration:"Duración"},tvt={thisTurn:"Este turno",conversationTotal:"Total de la conversación",tokens:"Tokens",cost:"Coste",duration:"Duración",model:"Modelo",toolCalls:"Llamadas de herramientas",toolUsage:"Uso de herramientas",cacheStats:"Caché",hitRate:"Tasa de aciertos",empty:"Envíe un mensaje para ver las métricas de costes",in:"entrada",out:"salida",total:"total",calls:"llamadas"},nvt={title:"Memoria de conversación",noConversation:"Inicie una conversación para inspeccionar la memoria",empty:"No hay datos de memoria disponibles",properties:"Propiedades",step:"Paso",keys:"claves",input:"Entrada"},ivt={noAgent:"Seleccione un agent para ver los registros",search:"Buscar...",pause:"Pausa",resume:"Reanudar",clear:"Limpiar",waiting:"Esperando registros...",connected:"Conectado",disconnected:"Desconectado",logOutput:"Salida de registro"},svt={noConversation:"Inicie una conversación para inspeccionar los prompts",noLlm:"Aún no se encontraron interacciones con LLM",turn:"Turno",latest:"Último",tokens:"Tokens",model:"Modelo",cost:"Coste",copy:"Copiar prompt",copied:"¡Copiado!",replay:"Reintentar este turno",toolCalls:"Llamadas de herramientas",step:"Paso",roleSystem:"Prompt del sistema",roleUser:"Usuario",roleAssistant:"Asistente",roleTool:"Resultado de herramienta"},rvt={preview:"Vista previa",edit:"Editar",switchToPreview:"Vista previa del prompt resuelto",switchToEdit:"Cambiar a edición",refresh:"Actualizar",sampleData:"Datos de ejemplo (sin conversación)",disclaimerReal:"La vista previa usa el motor Qute con datos reales de conversación.",disclaimerSample:"La vista previa usa el motor Qute con datos de ejemplo. Seleccione una conversación para valores reales.",resolvedPrompt:"Prompt resuelto",copy:"Copiar",copied:"¡Copiado!",error:"Error al resolver la plantilla",loading:"Resolviendo plantilla…",availableVariables:"Variables disponibles",copyVariable:"Clic para copiar referencia",varProperties:"Propiedades",varMemory:"Memoria",varContext:"Contexto",varSnippets:"Fragmentos",varUserInfo:"Info del usuario",varConversationInfo:"Info de conversación",varInput:"Entrada",varConversationLog:"Registro de conversación"},ovt={title:"Estudio de Agentes",subtitle:"Construya, pruebe y depure sus agents en un solo espacio de trabajo",pipeline:"Pipeline",editor:"Editor",debug:"Debug & Chat",selectStage:"Haga clic en una etapa del pipeline para abrir su editor",openInStudio:"Abrir en Studio",loading:"Cargando agent...",notFound:"Agent no encontrado",hideChat:"Ocultar chat",showChat:"Mostrar chat",openEditor:"Abrir en Editor",editorComingSoon:"Integración de editor en el lugar próximamente",noPipeline:"Sin etapas de pipeline",type:{parser:"Analizador",rules:"Reglas de comportamiento",property:"Definidor de propiedades",apicalls:"Llamadas API",llm:"LLM",output:"Salida","output.template":"Plantilla de salida",mcpcalls:"Llamadas MCP",rag:"Bases de conocimiento",dictionary:"Diccionario"},landingDescription:"Seleccione un agente para abrir el editor visual, el depurador y el chat en vivo",noAgents:"No se encontraron agentes — cree uno en la página de Agentes",chat:"Chat",backToAgent:"Volver al agente",selectStageHint:"Seleccione una extensión del pipeline para ver y editar su configuración directamente",noConfig:"Esta etapa del pipeline no tiene URI de configuración",unsupportedType:"Editor no disponible para este tipo de extensión"},avt={general:"General",kbName:"Nombre de la base de conocimiento",kbNamePlaceholder:"ej. docs-producto, faq, wiki-interna",kbNameHint:"Usado para referenciar esta base desde tareas de LLM",embeddingModel:"Modelo de Embedding",provider:"Proveedor",embeddingParams:"Parámetros del Provider",embeddingParamsHint:"Nombre de modelo, API key (use ${vault:...} para secrets), base URL, etc.",vectorStore:"Almacén vectorial",storeType:"Tipo de almacén",storeParams:"Parámetros de conexión",chunking:"Fragmentación de documentos",chunkStrategy:"Estrategia",chunkSize:"Tamaño del fragmento",chunkOverlap:"Superposición",overlapHint:"La superposición ayuda a mantener el contexto entre fragmentos",chunkPreview:"Vista previa (cómo se dividirá el documento)",chunkBlocks:"{{count}} fragmentos de ~{{size}} caracteres con {{overlap}} superpuestos",retrievalDefaults:"Opciones predeterminadas de recuperación",retrievalHint:"Estas opciones se pueden sobrescribir por tarea en la configuración del LLM.",maxResults:"Resultados máximos (top-K)",minScore:"Puntuación mínima de similitud",ingestion:"Ingesta de documentos",dropFiles:"Arrastre documentos aquí para ingerir",dropHint:"Texto, Markdown o cualquier archivo de texto",browse:"Buscar",pasteText:"O pegue el contenido del texto",pastePlaceholder:"Pegue el texto del documento aquí...",ingestText:"Ingerir texto",ingestionHistory:"Estado de ingesta",saveFirstIngestion:"Guarde esta base de conocimiento primero para activar la ingesta de documentos.",addParam:"Añadir parámetro"},lvt={welcome:{title:"Bienvenido a EDDI",subtitle:"Su centro de comando de agentes de IA",introText:"EDDI Manager es su centro de comando para crear, probar y operar agentes de IA conversacional.",capabilitiesTitle:"Lo que puede hacer",capabilitiesSubtitle:"Todo lo que necesita para crear agentes de IA listos para producción",buildAgents:"Crear agentes",buildAgentsDesc:"Cree y configure agentes de IA con el asistente o desde cero",designWorkflows:"Diseñar workflows",designWorkflowsDesc:"Constructor de pipelines de arrastrar y soltar con reglas de comportamiento, cadenas de LLM y herramientas",testRealtime:"Probar en tiempo real",testRealtimeDesc:"Chatee con sus agentes con respuestas en streaming y depuración integrada",monitorOperate:"Supervisar y operar",monitorOperateDesc:"Conversaciones, audit trails, secrets y cuotas: todo en un solo lugar",readyTitle:"¿Listo para comenzar?",readySubtitle:"Puede reiniciar cualquier tour desde el menú Ayuda en la barra lateral",startTour:"Iniciar el tour",exploreOwn:"Exploraré por mi cuenta"},tour:{back:"Atrás",next:"Siguiente",skip:"Omitir Tour",finish:"Finalizar",stepOf:"Paso {{current}} de {{total}}",dashboard:{title:"Tour del Dashboard",step1Title:"Su centro de comando",step1Desc:"La barra lateral organiza todo en tres zonas: Gestión, Desarrollo y Operaciones. Siempre sabrá dónde encontrar todo.",step2Title:"Vistazo a la plataforma",step2Desc:"Recuentos en vivo de sus agentes, workflows y conversaciones. Haga clic en cualquier tarjeta para ir directamente a esa sección.",step3Title:"Acciones rápidas",step3Desc:"Acceda rápidamente a tareas comunes. El Asistente de Agentes es la forma más rápida de crear su primer agente: toma menos de 2 minutos.",step4Title:"Personalice el espacio",step4Desc:"Cambie entre temas claro, oscuro y de sistema. EDDI Manager habla 11 idiomas: elija el suyo en el selector de idiomas."},agents:{title:"Tour de Agents",step1Title:"Asistente de agentes",step1Desc:"El asistente le guiará en la creación de un agente completamente configurado: elija un modelo, asigne una personalidad, active herramientas y despliegue.",step2Title:"Creación manual",step2Desc:"Para usuarios avanzados: cree un agente en blanco y configúrelo con control total por JSON. Perfecto para configuraciones avanzadas.",step3Title:"Buscar y filtrar",step3Desc:"Encuentre agentes al instante por nombre. Cambie entre la vista de tarjetas y la lista con el interruptor de la derecha.",step4Title:"Su flota de agentes",step4Desc:"Cada tarjeta muestra el nombre del agente, su versión y la fecha de modificación. Haga clic en cualquier agente para ver su página de detalles y controlar su despliegue, chat y workflows."},workflows:{title:"Tour de Workflows",step1Title:"Crear un workflow",step1Desc:"Los workflows definen el pipeline de procesamiento: una secuencia de tareas como llamadas de LLM, reglas de comportamiento e integraciones HTTP.",step2Title:"Sus Workflows",step2Desc:"Cada workflow se puede adjuntar a uno o más agentes. Haga clic para abrir el editor visual de arrastrar y soltar.",step3Title:"Organice su vista",step3Desc:"Busque por nombre y cambie entre la cuadrícula de tarjetas y las tablas ordenables."},chat:{title:"Tour de Chat",step1Title:"Elija un agente",step1Desc:"Seleccione un agente desplegado para iniciar una conversación. Aquí solo aparecen los agentes que se han desplegado.",step2Title:"Modo Streaming",step2Desc:"Active el flujo de tokens en tiempo real. Cuando está habilitado, la respuesta aparece palabra por palabra: excelente para verificar la latencia.",step3Title:"Historial de conversación",step3Desc:"Abra la barra lateral para explorar y reanudar conversaciones anteriores.",step4Title:"Empiece a chatear",step4Desc:"Escriba un mensaje y presione Enter. El agente responderá utilizando el LLM, las herramientas y los workflows que ha configurado."},channels:{title:"Canales",subtitle:"Conectar agentes y grupos a plataformas como Slack"},resources:{title:"Tour de Recursos",step1Title:"Biblioteca de extensiones",step1Desc:"Los recursos son los bloques de construcción de los workflows. Cada tipo controla una parte diferente del comportamiento del agente.",step2Title:"Configuraciones de LLM",step2Desc:"Defina qué modelo de IA potencia a su agente, su prompt de sistema, herramientas, servidores MCP y ajustes de cascading. Este es el cerebro del agente.",step3Title:"Reglas y Llamadas API",step3Desc:"Las Reglas de Comportamiento controlan el flujo de la conversación. Las Llamadas HTTP conectan a API externas. Ambas se pueden usar como herramientas de LLM."},conversations:{title:"Tour de Conversaciones",step1Title:"Búsqueda",step1Desc:"Encuentre conversaciones rápidamente por ID, agente o mensajes recientes de usuario.",step2Title:"Filtros de estado",step2Desc:"Filtre las sesiones por estado: Activa, En progreso, Finalizada o con Error.",step3Title:"Lista de conversaciones",step3Desc:"Explore todas las sesiones. Haga clic en la tarjeta de cualquier conversación para abrir el timeline y depurar el flujo."},groups:{title:"Tour de Grupos de Discusión",step1Title:"Crear grupo",step1Desc:"Cree un grupo de orquestación para permitir que varios agentes colaboren y debatan.",step2Title:"Buscar en grupos",step2Desc:"Busque fácilmente a través de sus clústeres multi-agente existentes.",step3Title:"Gestión de grupos",step3Desc:"Gestione sus entornos colaborativos, edite sus políticas o elimine los grupos antiguos."},logs:{title:"Tour de Registros de Sistema",step1Title:"Live vs Historial",step1Desc:"Cambie entre el flujo en tiempo real de los registros y la búsqueda en el historial.",step2Title:"Filtros de stream",step2Desc:"Filtre el flujo en vivo por agente o por un nivel de registro crítico.",step3Title:"Exportar",step3Desc:"Descargue los registros filtrados actuales como archivo de texto para analizarlos o guardarlos."},secrets:{title:"Tour del Secrets Vault",step1Title:"Crear Secret",step1Desc:"Almacene de forma segura una nueva API key, token o contraseña a la que sus agentes puedan acceder.",step2Title:"Aislamiento por Tenant",step2Desc:"Filtre la vista del Vault y asegúrese de que sus secrets estén vinculados a un Tenant ID específico.",step3Title:"Sintaxis de referencia",step3Desc:"Aprenda a inyectar secrets dinámicamente en sus configuraciones de LLM para evitar hardcodear información confidencial."},audit:{title:"Tour del Audit Trail",step1Title:"Modo de búsqueda",step1Desc:"Busque en el registro inmutable de auditoría por un ID de conversación específico o una versión de agente.",step2Title:"Ejecutar búsqueda",step2Desc:"Introduzca su ID y haga clic en buscar para extraer un historial de ejecución verificable.",step3Title:"Exportar ledger",step3Desc:"Exporte los registros auditables en formato JSON para informes y casos de cumplimiento de normativas."},schedules:{title:"Tour de Programaciones",step1Title:"Crear programación",step1Desc:"Configure una nueva tarea cron o heartbeat continuo para activar workflows de agentes de forma automatizada.",step2Title:"Estadísticas de salud",step2Desc:"Haga un seguimiento de las tareas totales, activas y fallidas por toda su plataforma.",step3Title:"Gestión",step3Desc:"Controle sus tareas automáticamente: pause, reanude, edite o fuerce su ejecución en cualquier momento."},quotas:{title:"Tour de Cuotas",step1Title:"Límites de uso",step1Desc:"Defina restricciones como máximo de agentes, conversaciones u otros límites de token para este Tenant.",step2Title:"Análisis de uso",step2Desc:"Inspeccione qué cantidad de la cuota asignada ha consumido cada tenant en tiempo real.",step3Title:"Aplicar cambios",step3Desc:"Guarde sus límites actualizados e inmediatamente la plataforma comenzará a bloquear tráfico que sobrepase estos umbrales."},coordinator:{title:"Tour del Coordinator",step1Title:"Conexión en vivo",step1Desc:"Vea las métricas de heartbeat y la conexión del evento sincronizada con su backend de coordinación.",step2Title:"Colas activas",step2Desc:"Monitoree las colas y las tareas procesándose actualmente a lo largo del clúster de agentes.",step3Title:"Mensajes muertos",step3Desc:"Inspeccione las tareas fallidas en la cola de dead-letter, descártelas o reinténtelas para mantener la plataforma estable."},orphans:{title:"Tour de Huérfanos",step1Title:"Escaneo de sistema",step1Desc:"Active el escaneo para buscar recursos o configuraciones que ya no estén conectadas ni utilizadas.",step2Title:"Historial y eliminados",step2Desc:"Si lo desea, active la inclusión de objetos previamente eliminados temporalmente para su purgación final.",step3Title:"Revisar y Purgar",step3Desc:"Compruebe todos los recursos reportados y use el botón de purgado total para reclamar memoria y espacio de la base de datos."}},help:{title:"Ayuda y Tour",platformTour:"Tour de la plataforma",resetAll:"Restablecer todos los tours",resetConfirm:"¿Restablecer el progreso de todos los tours?"},offer:{message:"¿Es su primera vez? Haga el {{page}}",accept:"Mostrar",dontAsk:"No volver a preguntar"}},cvt={status:"Estado de la plataforma",online:"En línea",offline:"Sin conexión",checking:"Verificando…",connected:"Conectado",disconnected:"Desconectado",instance:"Instancia",latency:"Latencia",lastChecked:"Última comprobación",justNow:"ahora mismo",secondsAgo:"hace {{count}}s"},dvt={live:"En vivo",reconnecting:"Reconectando…"},uvt={title:"Nuevo {{type}}",newAgent:"Nuevo Agent",newGroup:"Nuevo Grupo",quickCreate:"Creación rápida",quickCreateTitle:"Creación rápida de {{type}}",quickCreateDesc:"Establezca un nombre y descripción, configure los detalles más tarde.",guidedSetup:"Configuración guiada",guidedSetupDesc:"Asistente paso a paso con proveedor de LLM, prompts y despliegue."},hvt={empty:"Sin grupos aún",emptyDescription:"Los grupos permiten que múltiples agentes colaboren en discusiones estructuradas.",createGroup:"Crear grupo",unnamed:"Grupo sin nombre",count_one:"{{count}} grupo",count_other:"{{count}} grupos",confirmDelete:"¿Eliminar este grupo?",confirmDeleteDesc:"La configuración del grupo se eliminará permanentemente.",duplicateSuccess:"Grupo duplicado",noDescription:"Sin descripción",members:"miembros",discussionStyle:"Estilo de discusión",maxRounds:"Rondas máx."},gvt={title:"Memoria del usuario",subtitle:"Explorar y gestionar los recuerdos persistentes almacenados por los agentes",userIdPlaceholder:"Introduzca el ID de usuario…",searchPlaceholder:"Buscar en los recuerdos…",enterUserId:"Introduzca un ID de usuario para explorar sus recuerdos",totalEntries:"Total de entradas",preferences:"Preferencias",facts:"Hechos",conflicts:"Conflictos",cat_all:"Todo",cat_preference:"Preferencias",cat_fact:"Hechos",cat_context:"Contexto",deleteAll:"Eliminar todo",deleteAllTitle:"Eliminar todos los recuerdos",deleteAllDesc:"Se eliminarán permanentemente todos los recuerdos de este usuario. Esta acción no se puede deshacer.",deleteAllConfirm:"Eliminar todo",entryDeleted:"Entrada eliminada",allDeleted:"Todos los recuerdos del usuario eliminados",noResults:"No se encontraron entradas",value:"Valor",sourceAgent:"Agente de origen",accessCount:"Accesos",created:"Creado",updated:"Actualizado",sourceConversation:"Conversación de origen",conflicted:"En conflicto"},fvt={title:"Propiedades del usuario",subtitle:"Explorar y gestionar las propiedades longTerm almacenadas por usuario",userIdPlaceholder:"Introduzca el ID de usuario…",searchPlaceholder:"Filtrar propiedades…",enterUserId:"Introduzca un ID de usuario para ver sus propiedades",key:"Clave",type:"Tipo",value:"Valor",deleteAll:"Eliminar todo",deleteAllTitle:"Eliminar todas las propiedades",deleteAllDesc:"Se eliminarán permanentemente todas las propiedades de este usuario.",deleted:"Propiedades eliminadas",noResults:"No se encontraron propiedades",showingCount:"{{count}} propiedades"},pvt={title:"Disparadores de agentes",subtitle:"Asociar intenciones a despliegues de agentes para enrutamiento automático",create:"Nuevo disparador",createTitle:"Crear disparador",editTitle:"Editar disparador",intent:"Intención",deployments:"Despliegues de agentes",addDeployment:"Añadir agente",agents:"agentes",empty:"Aún no hay disparadores configurados",created:"Disparador creado",updated:"Disparador actualizado",deleted:"Disparador eliminado",deleteTitle:"Eliminar disparador",deleteDesc:"¿Eliminar permanentemente el disparador para la intención «{{intent}}»?",searchPlaceholder:"Filtrar por intención o ID de agente…"},mvt={title:"Descubrimiento de capacidades",subtitle:"Descubrir agentes por sus habilidades y capacidades declaradas",searchPlaceholder:"Buscar habilidades…",strategyHighest:"Mayor confianza",strategyAll:"Todos los resultados",registeredSkills:"Habilidades registradas",noSkills:"No se encontraron habilidades",matchingAgents:"Agentes coincidentes",noMatches:"No se encontraron agentes para esta habilidad"},bvt={title:"Exportar agente",loading:"Cargando árbol de recursos…",selectResources:"Seleccionar recursos a exportar",required:"Requerido",snippets:"Fragmentos",allSelected:"Todos los recursos seleccionados",countSelected:"{{count}} de {{total}} recursos seleccionados",exportSelected:"Exportar seleccionados"},xvt={title:"Importar agente",dropZone:"Arrastre un archivo .zip aquí o haga clic para explorar",dropZoneHint:"Archivo de agente exportado (.zip)",strategyLabel:"Estrategia de importación",createNew:"Crear como nuevo agente",createNewDesc:"Crea una copia con nuevos identificadores. Ideal para la primera importación.",mergeSync:"Fusionar con existente",mergeSyncDesc:"Actualiza recursos existentes. Crea nuevos si no se encuentran.",upgradeExisting:"Actualizar agente existente",upgradeDesc:"Hacer coincidir recursos estructuralmente con un agente destino. Ideal para promover entre entornos.",syncRemote:"Sincronizar desde instancia remota",syncDesc:"Conéctese a otra instancia de EDDI y sincronice un agente en directo.",importNow:"Importar ahora",previewChanges:"Vista previa de cambios",selectTargetAgent:"Seleccionar agente destino",upgradeTargetHint:"Los recursos importados se harán coincidir estructuralmente con este agente.",chooseAgent:"— Elegir agente —",sourceAgent:"Agente origen (remoto)",targetAgent:"Agente destino (local)",createNewTarget:"Crear nuevo agente",resource:"Recurso",type:"Tipo",match:"Correspondencia",action:"Acción",new:"nuevo",updated:"actualizado",unchanged:"sin cambios",selected:"seleccionados",mergeNow:"Importar seleccionados",syncNow:"Sincronizar ahora",upgradeNow:"Actualizar ahora",importing:"Importando agente…",contentIdentical:"Contenido idéntico",targetContent:"Destino",sourceContent:"Origen"},vvt={title:"Sincronización de agentes",subtitle:"Sincronizar agentes entre instancias de EDDI",connection:"Instancia origen",sourceUrl:"URL de la instancia EDDI de origen",authToken:"Token de autorización",authHint:"Opcional. Se envía como encabezado X-Source-Authorization.",connect:"Conectar",connected:"Conectado",agentsFound:"agentes",connectionFailed:"Error de conexión",agentMapping:"Mapeo de agentes",previewAll:"Vista previa de todo",syncSelected:"Sincronizar seleccionados",remote:"Remoto",createNew:"Crear nuevo",changes:"cambios",agentsSelected:"agentes seleccionados",totalResources:"recursos",syncSuccess:"Sincronización completada",syncError:"Error de sincronización",empty:"Conéctese a una instancia de origen para comenzar la sincronización de agentes.",autoMatched:"Correspondencia automática",previewFirst:"Vista previa de los cambios antes de sincronizar"},_vt={actionCreate:"Nuevo",actionUpdate:"Actualizar",actionSkip:"Actualizado",actionConflict:"Conflicto"},yvt={title:"Conversaciones de usuario",subtitle:"Gestionar vínculos de intent → usuario → conversación",lookup:"Búsqueda",intent:"Intención",userId:"ID de usuario",agentId:"ID de agente",environment:"Entorno",conversationId:"ID de conversación",binding:"Vínculo activo",enterBoth:"Ingrese intent e ID de usuario",notFound:"No se encontró vínculo",create:"Crear vínculo",createTitle:"Crear vínculo",created:"Vínculo creado",deleteTitle:"Eliminar vínculo",deleteDesc:'¿Eliminar el vínculo para intent "{{intent}}" y usuario "{{userId}}"?',deleted:"Vínculo eliminado"},wvt={placeholder:"Buscar páginas, agentes, acciones…",noResults:"Sin resultados.",recent:"Recientes",navigate:"Navegar",agents:"Agentes",actions:"Acciones rápidas",createAgent:"Crear nuevo agente",openChat:"Abrir chat",kbdNavigate:"navegar",kbdSelect:"seleccionar",kbdClose:"cerrar"},Cvt={title:"Asistente de grupo",subtitle:"Forme un equipo de asesores IA para discutir sus preguntas",backToGroups:"Volver a grupos",templateTitle:"Empezar con plantilla",templateDesc:"Elija una configuración predefinida o empiece desde cero.",startBlank:"Desde cero",blankDesc:"Configurar todo manualmente",configTitle:"Configuración del grupo",configDesc:"Nombre su grupo y elija el estilo de discusión",namePlaceholder:"Ej. Comité asesor",descPlaceholder:"¿Para qué es este grupo?",membersTitle:"Forme su equipo",membersDesc:"Para cada puesto, elija un agente existente o cree uno nuevo.",addMember:"Añadir miembro",refreshAgents:"Actualizar lista",existingAgents:"agentes existentes",displayName:"Nombre del agente",displayNamePlaceholder:"Dé un nombre a este agente…",rolePlaceholder:"Rol (ej. Marketing, Ingeniería)",useExisting:"Usar existente",createNew:"Crear nuevo",selectAgent:"Seleccionar agente…",systemPrompt:"Prompt del sistema",provider:"Proveedor LLM",model:"Modelo",apiKey:"Clave API",apiKeyPlaceholder:"sk-…",createThisAgent:"Crear agente",creatingAgent:"Creando agente…",agentReady:"Agente creado y desplegado",agentCreated:'Agente "{{name}}" creado',agentCreateFailed:"Error al crear agente: {{error}}",moderator:"Moderador",moderatorHint:"Sintetiza la discusión",addModerator:"Añadir moderador",removeModerator:"Quitar moderador",createModerator:"Crear agente moderador",moderatorReady:"Agente moderador listo",moderatorCreated:"Agente moderador creado",creatingModerator:"Creando moderador…",creatingSlot:"Creando {{name}}…",creatingGroup:"Creando grupo…",needMembers:"Añada al menos 2 miembros",reviewTitle:"Revisar y crear",reviewDesc:"Revise la configuración antes de crear.",reviewMembers:"Miembros",autoCreateNotice:"{{count}} agentes se crearán automáticamente",autoCreateHint:"Cada agente será creado y desplegado automáticamente.",unassignedWarning:"{{count}} miembros sin agente asignado",unassignedHint:"Estos miembros serán omitidos. Vuelva para asignar agentes.",flowPreview:"Flujo de discusión",createGroup:"Crear grupo",created:"¡Grupo creado!",viewGroup:"Abrir grupo",createAnother:"Crear otro",success:"¡Grupo creado exitosamente!"},Svt={advisoryBoard:"Comité asesor",advisoryBoardDesc:"Un panel de expertos para decisiones estratégicas.",codeReview:"Panel de revisión de código",codeReviewDesc:"Revisión estructurada con opiniones independientes y crítica entre pares.",riskAssessment:"Evaluación de riesgos",riskAssessmentDesc:"Panel con un abogado del diablo que cuestiona las suposiciones.",forecasting:"Panel de pronóstico",forecastingDesc:"Deliberación anónima estilo Delphi para estimaciones imparciales.",proCon:"Debate a favor/en contra",proConDesc:"Debate estructurado con equipos a favor y en contra.",roles:{marketingExpert:"Experto en marketing",techLead:"Líder técnico",financeDirector:"Director financiero",legalCounsel:"Asesor legal",strategyConsultant:"Consultor de estrategia",seniorEngineer:"Ingeniero senior",architect:"Arquitecto",securityReviewer:"Revisor de seguridad",riskAnalyst:"Analista de riesgos",domainExpert:"Experto de dominio",devilsAdvocate:"Abogado del diablo",analystA:"Analista A",analystB:"Analista B",analystC:"Analista C",analystD:"Analista D",proAdvocate1:"Defensor a favor 1",proAdvocate2:"Defensor a favor 2",conAdvocate1:"Defensor en contra 1",conAdvocate2:"Defensor en contra 2"}},kvt={agentIdPlaceholder:"ID del agente para gestionar mensajes",botToken:"Token del bot",botTokenHint:"Token OAuth del bot. Use una referencia de bóveda para mayor seguridad.",botTokenPlaceholder:"xoxb-… o ${vault:slack-bot-token}",channel:"canal",channelId:"ID del canal de Slack",channelIdCol:"ID del canal",channelIdHint:"Clic derecho en un canal de Slack → Ver detalles del canal → copiar el ID del canal",channelsPlural:"canales",channelType:"Tipo de canal",confirmDelete:"¿Eliminar canal?",confirmDeleteDesc:"Esta integración de canal se eliminará permanentemente.",create:"Crear canal",createTitle:"Crear integración de canal",defaultAgentId:"ID del agente predeterminado",defaultTargetHint:"El destino predeterminado gestiona todos los mensajes que no coinciden con una palabra clave de activación. Puede agregar más destinos después de la creación.",empty:"Aún no hay canales",emptyDesc:"Cree una integración de canal para conectar agentes a Slack.",name:"Nombre",namePlaceholder:"p. ej. Engineering AI Hub",openSlackApps:"Abrir panel de Slack App",searchPlaceholder:"Buscar canales…",signingSecret:"Secreto de firma",signingSecretHint:"Desde la página de Información básica de su aplicación Slack.",signingSecretPlaceholder:"Cadena hex o ${vault:slack-signing-secret}",slackSetupGuide:"Guía de configuración de Slack",slackSetupSummary:"Cree una aplicación Slack, configure los permisos del token del bot (app_mentions:read, chat:write, im:history, channels:history, groups:history) y pegue las credenciales aquí.",target:"destino",targets:"destinos",targetsCol:"Destinos",type:"Tipo",unnamed:"Canal sin nombre",version:"Versión"},Nvt={addTarget:"Agregar destino",addTrigger:"Agregar activador…",agentId:"ID del agente",botToken:"Token del bot",channelId:"ID del canal de Slack",cooldown:"Enfriamiento (s)",general:"General",groupId:"ID del grupo",isDefault:"predeterminado",maxCost:"Máx. $/día",maxDaily:"Máx./día",name:"Nombre",observe:"Observar",observeDesc:"Supervisar pasivamente y responder selectivamente",observeKeywords:"Palabras clave de activación",observeMimeTypes:"Tipos MIME de activación",observeMode:"Modo observación",observeSettings:"Configuración del modo observación",platformConfig:"Configuración de la plataforma",rawConfig:"Configuración sin procesar",removeTarget:"Eliminar",requiredEvents:"Suscripciones de eventos requeridas:",requiredScopes:"Permisos de token del bot requeridos:",setDefault:"Establecer como predeterminado",signingSecret:"Secreto de firma",targetName:"Nombre",targets:"Destinos de enrutamiento de mensajes",targetType:"Tipo",triggerHint:'Los usuarios escriben "palabra clave: mensaje" para enrutar a este destino',triggerKeywords:"Palabras clave de activación",triggers:"activadores",type:"Tipo de canal",webhookHint:"Pegue esta URL en el campo Request URL de Event Subscriptions de su aplicación Slack.",webhookUrl:"URL del webhook"},Evt={app:Cxt,auth:Sxt,nav:kxt,theme:Nxt,language:Ext,pages:Lxt,common:Dxt,agents:Txt,agentDetail:Ixt,wizard:Axt,setupWizard:Rxt,packages:Mxt,packageDetail:Pxt,packageEditor:Oxt,conversations:jxt,conversationDetail:Fxt,chat:Bxt,resources:Hxt,editor:Wxt,rulesEditor:Vxt,apiCallsEditor:zxt,llmEditor:Uxt,outputEditor:$xt,propertySetterEditor:qxt,dictionaryEditor:Kxt,coordinator:Gxt,contentEditor:Yxt,logs:Qxt,secrets:Xxt,audit:Zxt,schedules:Jxt,debugDrawer:evt,costDashboard:tvt,memoryInspector:nvt,logViewer:ivt,promptViewer:svt,promptPreview:rvt,studio:ovt,ragEditor:avt,onboarding:lvt,platform:cvt,stream:dvt,createOrWizard:uvt,groups:hvt,memories:gvt,properties:fvt,triggers:pvt,capabilities:mvt,exportDialog:bvt,importDialog:xvt,syncPage:vvt,sync:_vt,userConversations:yvt,commandPalette:wvt,groupWizard:Cvt,groupTemplates:Svt,channels:kvt,channelDetail:Nvt},Lvt={title:"مدير EDDI",description:"لوحة تحكم منصة EDDI للذكاء الاصطناعي"},Dvt={login:"تسجيل الدخول",logout:"تسجيل الخروج",loading:"جارٍ المصادقة…",sessionExpired:"انتهت الجلسة. يرجى تسجيل الدخول مجدداً.",profile:"الملف الشخصي",guest:"زائر",userMenu:"قائمة المستخدم"},Tvt={dashboard:"لوحة التحكم",agents:"الوكلاء",packages:"مسارات العمل",conversations:"محادثات",coordinator:"المنسق",schedules:"الجداول",logs:"السجلات",orphans:"يتيمة",secrets:"الأسرار",audit:"سجل التدقيق",quotas:"الحصص",groups:"مجموعات",chat:"دردشة",resources:"الموارد",sectionManagement:"الإدارة",sectionDevelopment:"التطوير",sectionOperations:"العمليات",mainNavigation:"التنقل الرئيسي",openMenu:"فتح قائمة التنقل",sectionCore:"الأساسي",sectionBuild:"البناء والاختبار",sectionMonitor:"المراقبة",sectionAdmin:"الإدارة",studio:"الاستوديو",gdpr:"الخصوصية",memories:"ذاكرة المستخدم",properties:"الخصائص",triggers:"المشغلات",capabilities:"القدرات",sync:"المزامنة",channels:"القنوات",userConversations:"محادثات المستخدم",userData:"بيانات المستخدم",variables:"المتغيرات"},Ivt={light:"فاتح",dark:"داكن",system:"نظام"},Avt={label:"اللغة",en:"English",de:"Deutsch",fr:"Français",es:"Español",ar:"العربية",zh:"中文",th:"ไทย",ja:"日本語",ko:"한국어",pt:"Português",hi:"हिन्दी"},Rvt={dashboard:{title:"لوحة التحكم",subtitle:"نظرة عامة على Agents EDDI والمحادثات",activeAgents:"Agents نشطة",totalWorkflows:"مسارات العمل",totalResources:"الموارد",totalConversations:"محادثات",quickActions:"إجراءات سريعة",recentAgents:"أحدث Agents",noRecentAgents:"لا توجد Agents بعد. أنشئ أول Agent!"},agents:{title:"الوكلاء",subtitle:"إدارة Agents الذكاء الاصطناعي"},packages:{title:"مسارات العمل",subtitle:"تكوين Workflows وإضافات Agents"},conversations:{title:"محادثات",subtitle:"عرض وإدارة محادثات Agents"},resources:{title:"الموارد",subtitle:"إدارة قواعد السلوك والقواميس والمخرجات والمزيد"},chat:{title:"دردشة",subtitle:"تحدث مع Agents المنشورة"},channels:{title:"القنوات",subtitle:"قم بربط الوكلاء والمجموعات بمنصات المراسلة مثل Slack"},groups:{title:"مجموعات",subtitle:"مجموعات نقاش متعددة الوكلاء للنقاش المنظم والتعاون"}},Mvt={loading:"جارٍ التحميل...",error:"حدث خطأ ما",retry:"إعادة المحاولة",save:"حفظ",cancel:"إلغاء",delete:"حذف",create:"إنشاء",edit:"تعديل",search:"بحث...",noResults:"لم يتم العثور على نتائج",duplicate:"تكرار",close:"إغلاق",skipToMain:"انتقل إلى المحتوى الرئيسي",opensNewTab:"يفتح في علامة تبويب جديدة",moreActions:"المزيد من الإجراءات",sortByName:"ترتيب حسب الاسم",sortByVersion:"ترتيب حسب الإصدار",sortByModified:"ترتيب حسب تاريخ التعديل",apply:"تطبيق",copied:"تم النسخ",copy:"نسخ",saving:"جارٍ الحفظ…",showMore:"Show More",showLess:"Show Less",copyFailed:"فشل النسخ إلى الحافظة"},Pvt={deploy:"نشر",undeploy:"إلغاء النشر",createAgent:"إنشاء Agent",createTitle:"إنشاء Agent جديد",name:"الاسم",namePlaceholder:"Agent الخاص بي",description:"الوصف",descriptionPlaceholder:"صف ما يفعله هذا Agent...",empty:"لا توجد Agents بعد. أنشئ أول Agent!",confirmDelete:"هل أنت متأكد من حذف هذا Agent؟",count_one:"وكيل واحد",count_other:"{{count}} وكلاء",export:"تصدير",exporting:"جارٍ التصدير...",exportSuccess:"تم تصدير Agent بنجاح",import:"استيراد Agent",importing:"جارٍ الاستيراد...",importSuccess:"تم استيراد Agent بنجاح",importError:"فشل استيراد Agent",emptyDescription:"استخدم المعالج لإنشاء وكيل مكوّن بالكامل في دقائق.",chat:"محادثة",deployAndChat:"نشر ومحادثة",openExternalChat:"فتح في تبويب جديد"},Ovt={title:"تفاصيل Agent",backToAgents:"العودة إلى Agents",packages:"مسارات العمل",noWorkflows:"لم يتم إضافة Workflows بعد",addWorkflow:"إضافة Workflow",selectWorkflow:"اختر Workflow للإضافة",rawConfig:"التكوين الخام",editName:"تعديل الاسم",editDescription:"تعديل الوصف",clickToEdit:"انقر للتعديل",noDescription:"بدون وصف",duplicate:"تكرار",duplicating:"جارٍ التكرار...",duplicateSuccess:"تم تكرار Agent بنجاح",environments:"البيئات",envProduction:"إنتاج",envTest:"اختبار",savingAgent:"جارٍ حفظ Agent...",savedAgent:"تم حفظ Agent بنجاح",saveError:"فشل حفظ Agent",deployToEnv:"نشر في {{env}}",undeployFromEnv:"إزالة من {{env}}",openStudio:"فتح في الاستوديو",maxKeyLength:"أقصى طول للمفتاح",maxValueLength:"أقصى طول للقيمة",maxWritesPerTurn:"أقصى عمليات كتابة/دورة",dreamSchedule:"الجدولة (cron)",dreamLlmProvider:"مزود LLM",dreamLlmModel:"نموذج LLM",dreamMaxCost:"أقصى تكلفة/تشغيل ($)",dreamPruneDays:"التنظيف بعد (أيام)",dreamBatchSize:"حجم الدفعة",detectContradictions:"اكتشاف التناقضات",summarizeInteractions:"تلخيص التفاعلات",confidenceLow:"منخفض",confidenceMedium:"متوسط",confidenceHigh:"مرتفع",visibilitySelf:"ذاتي",visibilityGlobal:"عام",onCapEvict:"إزالة الأقدم",onCapReject:"رفض",recallMostRecent:"الأحدث",recallMostRelevant:"الأكثر صلة",channels:"موصلات القنوات",channelsDesc:"اربط هذا الوكيل بقنوات Slack. كل موصل قناة يُعد بشكل مستقل ببيانات اعتماد خاصة، مما يدعم إعدادات مساحات العمل المتعددة.",noChannels:"لا توجد قنوات مُعدة",noChannelsDesc:"أضف قناة Slack للسماح للمستخدمين بالتفاعل مع هذا الوكيل من Slack.",addSlackChannel:"إضافة قناة Slack",slackChannel:"قناة Slack",removeChannel:"إزالة القناة",removeChannelConfirm:"إزالة موصل قناة Slack هذا؟",removeChannelDesc:"This action will permanently disconnect this channel.",channelId:"معرف القناة",channelIdHint:"تبدأ معرفات القنوات بحرف C متبوعاً بأحرف أبجدية رقمية كبيرة",botToken:"رمز البوت",botTokenPlaceholder:"xoxb-… أو ${vault:slack-bot-token}",botTokenHint:"رمز OAuth لمستخدم بوت Slack. استخدم مرجع الخزنة للأمان.",signingSecret:"سر التوقيع",signingSecretPlaceholder:"سلسلة سداسية عشرية أو ${vault:slack-signing-secret}",signingSecretHint:"من صفحة المعلومات الأساسية لتطبيق Slack الخاص بك. استخدم مرجع الخزنة للأمان.",groupIdOptional:"معرف المجموعة (اختياري)",groupIdPlaceholder:"معرف تكوين المجموعة متعددة الوكلاء",groupIdHint:'فعّل مناقشات "group: سؤال" متعددة الوكلاء من قناة Slack هذه.',slackSetupGuide:"دليل إعداد Slack",slackWebhookUrl:"عنوان Webhook",slackWebhookCopied:"تم نسخ عنوان Webhook",slackStep1:"أنشئ تطبيق Slack على api.slack.com/apps وثبّته في مساحة عملك.",slackStep2:"انسخ رمز البوت (xoxb-…) وسر التوقيع إلى خزنة EDDI وأعد تكوين القنوات أدناه.",slackStep3:"ثم فعّل Event Subscriptions في تطبيق Slack الخاص بك، والصق عنوان Webhook أعلاه واشترك في:",slackSetupNote:"مهم: أعد تكوين القناة أدناه قبل تفعيل Event Subscriptions — يرسل Slack تحدي تحقق URL يتطلب تكوين سر التوقيع في EDDI.",slackRequiredScopes:"أذونات رمز البوت المطلوبة"},jvt={title:"معالج Agent"},Fvt={title:"معالج إنشاء Agent",subtitle:"أنشئ Agent مكتمل التكوين في دقائق",backToAgents:"العودة إلى Agents",next:"التالي",back:"رجوع",createOnly:"إنشاء فقط",createAndDeploy:"إنشاء ونشر",typeTitle:"ما نوع Agent؟",typeDesc:"اختر نوع Agent الذي تريد إنشاءه",standardAgent:"وكيل قياسي",apiAgent:"وكيل API",standardDesc:"ذكاء اصطناعي محادثاتي مدعوم بـ LLM مع أدوات اختيارية وردود سريعة وتحليل المشاعر",apiDesc:"استورد مواصفة OpenAPI/Swagger لإنشاء Agent API تلقائياً",infoTitle:"هوية Agent",infoDesc:"امنح Agent اسماً وشخصية",agentName:"اسم Agent",namePlaceholder:"مثال: بوت دعم العملاء",systemPrompt:"موجه النظام",promptPlaceholder:"أنت مساعد ذكاء اصطناعي مفيد يقوم بـ...",promptHint:"هذه التعليمات تحدد كيف يتصرف ويستجيب Agent.",llmTitle:"تكوين LLM",llmDesc:"اختر نموذج الذكاء الاصطناعي الذي يشغل Agent",provider:"المزود",model:"النموذج",apiKey:"مفتاح API",baseUrl:"الرابط الأساسي",baseUrlPlaceholder:"رابط endpoint مخصص",optional:"اختياري",apiSpecTitle:"مواصفة OpenAPI",apiSpecDesc:"قدم مواصفة OpenAPI/Swagger الخاصة بـ API",specByUrl:"رابط (URL)",specByFile:"ملف",specByPaste:"لصق",fetch:"جلب",specFetched:"تم تحميل المواصفة!",specFetchError:"فشل جلب المواصفة",dropFile:"اسحب ملف OpenAPI هنا",dropHint:"تنسيق JSON أو YAML",browse:"تصفح الملفات",pasteSpec:"الصق JSON أو YAML من OpenAPI/Swagger هنا...",specLoaded:"تم تحميل الملف: {{name}}",specReady:"تم تحميل المواصفة ({{chars}} حرف)",apiBaseUrlLabel:"الرابط الأساسي لـ API",apiAuthLabel:"رأس مصادقة API",endpointFilter:"فلتر Endpoints",endpointFilterPlaceholder:"مفصولة بفواصل: GET /users, POST /orders",featuresTitle:"الميزات والخيارات",featuresDesc:"خصص قدرات Agent",introMessage:"رسالة ترحيب",introMessageDesc:"رسالة تُعرض عند بدء المحادثة",quickReplies:"ردود سريعة",quickRepliesDesc:"يولد LLM اقتراحات ردود قابلة للنقر",sentiment:"تحليل المشاعر",sentimentDesc:"تتبع مزاج وقصد وإلحاح المستخدم في الوقت الفعلي",structuredOutput:"إخراج منظم",structuredOutputDesc:"يستجيب النموذج بكائن JSON بدلاً من نص عادي",structuredOutputInfo:"عند التفعيل، يستجيب النموذج بكائن JSON مع حقول منظمة. يتم إلحاق مخطط JSON بتعليمات النظام، ويتم ضبط النموذج على وضع استجابة JSON.",builtInTools:"أدوات مدمجة",builtInToolsDesc:"تفعيل مكتبة أدوات EDDI المدمجة (آلة حاسبة، تاريخ/وقت، إلخ)",toolsWhitelist:"قائمة بيضاء (فارغ = الكل)",mcpServers:"خوادم MCP",mcpServersDesc:"خوادم Model Context Protocol لأدوات خارجية",autoDeploy:"نشر تلقائي",autoDeployDesc:"نشر Agent فوراً بعد الإنشاء",environment:"البيئة",envProduction:"إنتاج",envTest:"اختبار",reviewTitle:"مراجعة وإنشاء",reviewDesc:"راجع التكوين قبل الإنشاء",reviewType:"النوع",reviewName:"الاسم",reviewPrompt:"موجه النظام",reviewProvider:"المزود",reviewModel:"النموذج",reviewSpec:"مواصفات OpenAPI",reviewIntro:"رسالة ترحيب",reviewDeploy:"نشر",success:"تم إنشاء Agent بنجاح!",agentCreated:"تم إنشاء Agent!",deployed:"تم النشر",endpointsParsed:"تم تحليل {{count}} endpoints API",viewAgent:"عرض Agent",createAnother:"إنشاء آخر",allTools:"جميع الأدوات",selectSpecific:"اختيار محدد",allToolsInfo:"جميع الأدوات المدمجة ({{count}}) ستكون متاحة لوكيلك. اختر «اختيار محدد» لتحديد الأدوات المفعلة.",availableTools:"الأدوات المتاحة",toolCount:"{{selected}} من {{total}} محددة"},Bvt={createWorkflow:"إنشاء Workflow",createTitle:"إنشاء Workflow جديد",name:"الاسم",namePlaceholder:"Workflow الخاص بي",description:"الوصف",descriptionPlaceholder:"صف ما يفعله هذا Workflow...",noDescription:"لا يوجد وصف",empty:"لا توجد Workflows بعد. أنشئ أول Workflow!",confirmDelete:"هل أنت متأكد من حذف هذا Workflow؟",count_one:"سير عمل واحد",count_other:"{{count}} سير عمل",emptyDescription:"تحدد مسارات العمل خط أنابيب المعالجة لوكلائك."},Hvt={title:"تفاصيل Workflow",backToWorkflows:"العودة إلى Workflows",extensions:"الإضافات",noExtensions:"لا توجد إضافات في هذا Workflow",rawConfig:"التكوين الخام"},Wvt={title:"محرر Workflow",pipeline:"Pipeline الإضافات",addHint:"أضف إضافات لبناء pipeline المعالجة",addHintDialog:"اختر نوع الإضافة للإضافة إلى pipeline",reorder:"إعادة ترتيب الإضافة",saved:"تم حفظ Workflow بنجاح",saveError:"فشل حفظ Workflow",noTasks:"[EN] No tasks in this workflow",addTask:"[EN] Add Task"},Vvt={searchPlaceholder:"البحث بمعرّف المحادثة...",id:"المحادثة",agent:"الوكيل",state:"الحالة",lastActivity:"آخر نشاط",actions:"إجراءات",empty:"لا توجد محادثات بعد. انشر Agent وابدأ الدردشة!",confirmDelete:"هل أنت متأكد من حذف هذه المحادثة؟",count_one:"محادثة واحدة",count_other:"{{count}} محادثات",emptyDescription:"انشر وكيلاً وابدأ محادثة من صفحة الدردشة."},zvt={continueChat:"متابعة في الدردشة",searchTranscript:"البحث في المحادثة…",exportMd:"تصدير كـ Markdown",toolSummary:"ملخص استخدام الأدوات",totalCost:"التكلفة الإجمالية",cacheHitRate:"معدل إصابة التخزين المؤقت"},Uvt={selectAgent:"اختر Agent...",noAgents:"لا توجد Agents منشورة متاحة. انشر Agent أولاً.",placeholder:"اكتب رسالة...",send:"إرسال",newConversation:"محادثة جديدة",endConversation:"إنهاء المحادثة",streaming:"بث",thinking:"يفكر...",connectionError:"خطأ في الاتصال. يرجى المحاولة مرة أخرى.",empty:"اختر Agent وابدأ الدردشة!",history:"السجل",undo:"تراجع عن آخر رسالة",redo:"إعادة الرسالة",continueConversation:"متابعة",noHistory:"لا يوجد سجل محادثات بعد.",attach:"إرفاق ملف",attachUploading:"...جارٍ الرفع",attachSuccess:"تم إرفاق الملف",attachError:"فشل في رفع الملف",retry:"إعادة محاولة الخطوة الأخيرة",retrySuccess:"تم إعادة تنفيذ الخطوة",retryError:"فشلت إعادة المحاولة",showActivity:"إظهار النشاط",hideActivity:"إخفاء النشاط",scrollToBottom:"التمرير للأسفل",copyMessage:"نسخ الرسالة",copied:"تم النسخ!",activity:{processing:"جارٍ المعالجة…",steps:"خطوات",toolCalls:"استدعاءات أدوات",toolCall:"استدعاء أداة",toolResult:"النتيجة"},channels:{title:"القنوات",subtitle:"ربط الوكلاء والمجموعات بمنصات المراسلة مثل Slack"},context:{conversationId:"معرف المحادثة",agentVersion:"إصدار الوكيل",startTime:"بدأ في",stepCount:"الخطوات",show:"إظهار معلومات المحادثة",hide:"إخفاء معلومات المحادثة"},agentTyping:"الوكيل يكتب"},$vt={unnamed:"مورد بدون اسم",noDescription:"لا يوجد وصف",backToResources:"العودة إلى الموارد",backToList:"العودة إلى {{type}}",unknownType:"نوع مورد غير معروف",rawConfig:"التكوين الخام",rawConfigHint:"تكوين JSON لهذا المورد",create:"إنشاء {{type}}",createTitle:"إنشاء {{type}}",createDescription:"إنشاء تكوين {{type}} فارغ. يمكنك تعديله بعد الإنشاء.",confirmDelete:"هل أنت متأكد من حذف {{type}} هذا؟",empty:"لا توجد موارد {{type}} بعد.",itemCount_one:"عنصر واحد",itemCount_other:"{{count}} عناصر",count_one:"{{count}} مورد",count_other:"{{count}} موارد",types:{rules:{name:"قواعد السلوك",description:"تحديد قواعد تدفق المحادثة ومنطق القرار"},apicalls:{name:"استدعاءات HTTP",description:"تكوين عمليات تكامل API الخارجية والويب هوك"},output:{name:"مجموعات المخرجات",description:"إدارة قوالب الاستجابة ومتغيرات المخرجات"},dictionary:{name:"القواميس",description:"تحديد أنماط التعرف على الكلمات والعبارات"},llm:{name:"LLM",description:"تكوين نماذج الذكاء الاصطناعي والتعليمات وربط الأدوات"},propertysetter:{name:"مُعيّن الخصائص",description:"تعيين خصائص المحادثة وإدارة ملء الفتحات"},mcpcalls:{name:"استدعاءات MCP",description:"تكوين اتصالات خادم MCP واستدعاءات الأدوات الحتمية"},rag:{name:"قواعد المعرفة",description:"تكوين قواعد المعرفة RAG لاسترجاع المستندات"},snippets:{name:"قصاصات التوجيه",description:"Reusable system prompt building blocks"}},emptyDescription:"أنشئ أول {{type}} لاستخدامه في مسارات العمل."},qvt={formTab:"نموذج",jsonTab:"JSON",save:"حفظ",discard:"تجاهل",saving:"جارٍ الحفظ...",saved:"تم الحفظ بنجاح",saveError:"فشل في الحفظ",dirty:"تغييرات غير محفوظة",version:"الإصدار",versionPicker:"اختر الإصدار",readOnly:"للقراءة فقط",formPlaceholder:"المحرر المرئي قريبًا. استخدم علامة تبويب JSON للتحرير.",jsonSchema:"التحقق من المخطط نشط",cascadeMode:"ستنتشر التغييرات إلى Workflow وAgent الأصل",usedInAgents:"مستخدم في {{count}} Agent(s)",updateUsageHint:"تحديث Workflows وAgents المحددة إلى الإصدار الجديد؟",updateUsage:"تحديث المحدد",skipUpdate:"تخطي",cascading:"جاري التحديث...",cascadeSuccess:"اكتمل التحديث المتتالي",invalidJson:"JSON غير صالح — انتقل إلى علامة تبويب JSON للإصلاح."},Kvt={appendActions:"إلحاق إجراءات",expressionsAsActions:"تعبيرات كإجراءات",groups:"مجموعات السلوك",addGroup:"إضافة مجموعة",groupName:"اسم المجموعة",executionStrategy:"استراتيجية التنفيذ",rules:"القواعد",addRule:"إضافة قاعدة",ruleName:"اسم القاعدة",actions:"إجراءات",noActions:"لا توجد إجراءات",addAction:"إضافة",actionPlaceholder:"مثال: greet, get_weather",conditions:"شروط",addCondition:"إضافة شرط",conditionType:"نوع الشرط",nestedConditions:"شروط متداخلة",configKey:"مفتاح",configValue:"قيمة",addConfig:"إضافة تكوين",removeRule:"إزالة القاعدة",removeGroup:"إزالة المجموعة",removeCondition:"إزالة الشرط",noGroups:"لم يتم تحديد مجموعات سلوك",noRules:"لا توجد قواعد في هذه المجموعة",noConditions:"لا توجد شروط"},Gvt={targetServerUrl:"URL الخادم الهدف",targetServerUrlPlaceholder:"https://api.example.com",calls:"استدعاءات HTTP",addCall:"إضافة استدعاء HTTP",callName:"اسم الاستدعاء",callDescription:"الوصف",descriptionPlaceholder:"وصف بلغة طبيعية لـ LLM Agents",request:"الطلب",method:"الطريقة",path:"المسار",pathPlaceholder:"/api/endpoint",headers:"الرؤوس",addHeader:"إضافة Header",queryParams:"معاملات الاستعلام",addQueryParam:"إضافة معامل",contentType:"نوع المحتوى",body:"جسم الطلب",bodyPlaceholder:"قالب نص JSON...",parameters:"معاملات (لـ LLM Agents)",paramName:"اسم المعامل",paramDescription:"الوصف",addParam:"إضافة معامل",options:"خيارات",saveResponse:"حفظ الاستجابة",responseObjectName:"اسم كائن الاستجابة",responseHeaderObjectName:"اسم كائن header الاستجابة",fireAndForget:"أرسل وانسَ",batchCalls:"استدعاءات دفعية",iterationObjectName:"اسم كائن التكرار",prePostInstructions:"تعليمات قبل/بعد",preRequest:"قبل الطلب",postResponse:"بعد الاستجابة",removeCall:"إزالة الاستدعاء",noCalls:"لم يتم تكوين استدعاءات HTTP",actions:"إجراءات مشغّلة",noActions:"لا توجد إجراءات",actionPlaceholder:"مثال: get_weather"},Yvt={tasks:"مهام LLM",addTask:"إضافة مهمة",noTasks:"لم يتم تكوين مهام LangChain",removeTask:"إزالة المهمة",taskId:"معرف المهمة",description:"الوصف",descriptionPlaceholder:"ما تفعله هذه المهمة",triggerActions:"إجراءات مشغّلة",noActions:"لا توجد إجراءات",actionPlaceholder:"مثال: help, chat",systemPrompt:"موجه النظام",systemPromptPlaceholder:"أنت مساعد مفيد...",modelParams:"معاملات النموذج",addParam:"إضافة معامل",agentMode:"وضع الوكيل",enableBuiltInTools:"تفعيل الأدوات المدمجة",toolWhitelist:"قائمة بيضاء (فارغ = الكل)",enableHttpCallTools:"اكتشاف تلقائي لأدوات HTTP Call",enableHttpCallToolsDesc:"عرض جميع إضافات httpcall من Workflow تلقائياً كأدوات LLM",httpCallTools:"روابط أدوات اتصال HTTP",httpCallToolsHint:"URIs httpcall صريحة (بالإضافة إلى المكتشفة تلقائياً)",addTool:"إضافة URI أداة",mcpServers:"خوادم MCP",mcpServersDesc:"خوادم MCP خارجية تصبح أدواتها متاحة لـ LLM",addMcpServer:"إضافة خادم MCP",mcpUrlPlaceholder:"http://localhost:7070/mcp",mcpName:"الاسم",mcpApiKey:"API Key / مرجع vault",historyLimit:"حد السجل",historyLimitHint:"(-1 = غير محدود)",budgetPerf:"الميزانية والأداء",maxBudget:"الميزانية القصوى ($)",costTracking:"تتبع التكاليف",toolCaching:"خبأ الأدوات",rateLimiting:"حدود المعدل",defaultRate:"المعدل الافتراضي (طلب/دقيقة)",prePostInstructions:"تعليمات قبل/بعد",preRequest:"قبل الطلب",postResponse:"بعد الاستجابة",enableMcpCallTools:"اكتشاف أدوات MCP تلقائياً",enableMcpCallToolsDesc:"كشف جميع إضافات mcpcalls من مسار العمل تلقائياً كأدوات LLM",a2aAgents:"وكلاء A2A",a2aAgentsDesc:"وكلاء عن بُعد متوافقون مع A2A تصبح مهاراتهم أدوات LLM",addA2aAgent:"إضافة وكيل A2A",a2aUrlPlaceholder:"https://remote.example.com/a2a/agents/...",a2aName:"الاسم المعروض",a2aApiKey:"${vault:my-a2a-key}",a2aTimeout:"المهلة (مللي ثانية)",a2aSkillsFilter:"فلتر المهارات (فارغ = الكل)",cascade:"تسلسل النماذج",cascadeDesc:"Try a cheap/fast model first. If confidence is too low, automatically escalate to a more powerful (and expensive) model.",cascadeEnable:"تفعيل تسلسل النماذج",cascadeStrategy:"الاستراتيجية",strategyCascade:"تصعيد تسلسلي",strategyParallel:"متوازي (مستقبلي)",cascadeStrategyHint:"يبدأ بالنموذج الأرخص ويُصعّد عند انخفاض الثقة",cascadeEvalStrategy:"تقييم الثقة",cascadeEvalHint:"كيفية تحديد ما إذا كانت الاستجابة كافية",evalStructured:"مخرجات منظمة (JSON)",evalHeuristic:"استدلالي (كشف التردد)",evalJudge:"نموذج حكم (LLM ثانوي)",evalNone:"بدون (قبول دائم)",cascadeInAgent:"استخدام التسلسل أيضاً في وضع الوكيل (مع الأدوات)",cascadeSteps:"Cascade Steps",cascadeStepsDesc:"Order matters: first step tried first. Last step is always accepted.",cascadeModelName:"مثال: claude-sonnet-4-6",cascadeConfidence:"Min. Confidence (0-1)",cascadeConfidencePlaceholder:"فارغ = قبول دائم",cascadeTimeout:"المهلة (مللي ثانية)",addCascadeStep:"إضافة مرحلة تسلسل",parallelExecution:"تنفيذ متوازي للأدوات",parallelExecutionDesc:"Run independent tool calls concurrently",parallelTimeout:"المهلة (مللي ثانية)",maxToolIterations:"أقصى تكرارات الأدوات",maxToolIterationsHint:"(افتراضي 10)",toolRateLimits:"حدود المعدل لكل أداة",toolRateLimitsDesc:"Override default rate for specific tools",toolName:"اسم الأداة",addToolRate:"إضافة حد معدل",retryConfig:"تكوين إعادة المحاولة",retryDesc:"Configure automatic retries with exponential backoff.",retryMaxAttempts:"أقصى عدد محاولات",retryDelay:"التأخير الأولي (مللي ثانية)",retryMultiplier:"مضاعف التراجع",retryMaxDelay:"أقصى تأخير (مللي ثانية)",ragConfig:"RAG (استرجاع المعرفة)",ragDesc:"Augment LLM responses with retrieved documents.",ragHttpCall:"عنوان استدعاء HTTP",ragEmbeddingModel:"نموذج التضمين",ragEmbeddingModelPlaceholder:"مثال: text-embedding-3-small",ragEmbeddingStore:"مخزن التضمين",ragEmbeddingStorePlaceholder:"مثال: pgvector, qdrant",ragMaxResults:"أقصى عدد نتائج",ragMinScore:"Min Similarity Score (0-1)",moveDown:"تحريك لأسفل",moveUp:"تحريك لأعلى",execution:"التنفيذ",budgetCosts:"الميزانية والتكاليف",preRequestDesc:"تعيين أو تحويل الخصائص قبل تنفيذ LLM.",postResponseDesc:"معالجة مخرجات LLM: تعيين الخصائص، وبناء رسائل المخرجات، وإنشاء ردود سريعة.",postPropertyInstructions:"تعليمات الخصائص",postOutputInstructions:"تعليمات المخرجات",postQrInstructions:"تعليمات الردود السريعة",allSkills:"جميع المهارات",skillPlaceholder:"مثال: order-tracking",modeAgent:"وكيل",modeChat:"دردشة",perMinute:"/دقيقة",allTools:"جميع الأدوات",selectSpecific:"اختيار محدد",allToolsInfo:"جميع الأدوات المدمجة ({{count}}) متاحة لـ LLM. اختر «اختيار محدد» لتحديد الأدوات المكشوفة.",availableTools:"الأدوات المتاحة",toolCount:"{{selected}} من {{total}} محددة",toolSources:"مصادر أدوات مسار العمل",toolSourcesInfo:"كلا المصدرين مفعلان افتراضياً — جميع استدعاءات HTTP وMCP في مسار العمل تُكشف تلقائياً كأدوات LLM. عطّل مصدراً لاستبعاده.",included:"مُضمّن"},Qvt={language:"اللغة",langPlaceholder:"مثال: en, ar",outputSets:"مجموعات المخرجات",addOutputSet:"إضافة مجموعة مخرجات",noOutputSets:"لم يتم تكوين مجموعات مخرجات",actionName:"اسم الإجراء",timesOccurred:"×",removeOutput:"إزالة",outputs:"المخرجات",alternativeGroup:"مجموعة بديلة",addAlternative:"إضافة بديل",addOutputGroup:"إضافة مجموعة مخرجات",textPlaceholder:"نص المخرج...",urlPlaceholder:"الرابط…",delayMs:"تأخير (مللي ثانية)",quickReplies:"ردود سريعة",noQuickReplies:"لا توجد Quick Replies",addQuickReply:"إضافة Quick Reply",qrValue:"نص الزر",qrExpressions:"التعبيرات",default:"افتراضي"},Xvt={setters:"معيني الخصائص",addSetter:"إضافة Setter",noSetters:"لم يتم تكوين Property Setters",removeSetter:"إزالة",triggerActions:"إجراءات مشغّلة",noActions:"لا توجد إجراءات",actionPlaceholder:"مثال: greet, fallback",properties:"الخصائص",noProperties:"لا توجد خصائص",addProperty:"إضافة خاصية",propName:"اسم الخاصية",propValue:"القيمة / التعبير",fromPath:"مسار المصدر",fromObjectPath:"fromObjectPath",override:"استبدال",propsCount:"خصائص",untitled:"(بدون إجراءات)"},Zvt={language:"اللغة",langPlaceholder:"مثال: en, ar",words:"الكلمات",addWord:"إضافة كلمة",wordPlaceholder:"مثال: مرحبا",phrases:"العبارات",addPhrase:"إضافة عبارة",phrasePlaceholder:"مثال: صباح الخير",regExs:"التعبيرات النظامية",addRegEx:"إضافة RegEx",regexPlaceholder:"تعبير نظامي",expressionPlaceholder:"مثال: greeting(hello)",frequency:"التكرار",none:"لم يتم تحديد أي"},Jvt={title:"لوحة تحكم المنسق",subtitle:"مراقبة معالجة المحادثات وإدارة إدخالات Dead-Letter",type:"نوع Coordinator",connection:"الاتصال",processed:"المهام المعالجة",deadLettered:"رسائل ميتة",activeQueues:"قوائم الانتظار النشطة",queued:"في الانتظار",deadLetterTitle:"الرسائل الميتة",noDeadLetters:"لا توجد إدخالات Dead-Letter",colId:"ID",colConversation:"محادثة",colError:"خطأ",colTime:"الوقت",colActions:"إجراءات",replay:"إعادة التشغيل",discard:"تجاهل",purgeAll:"حذف الكل",confirmPurge:"حذف الكل؟",yes:"نعم",cancel:"إلغاء",replaySuccess:"تم إعادة تشغيل Dead-Letter",replayError:"فشل إعادة التشغيل",discardSuccess:"تم تجاهل Dead-Letter",discardError:"فشل التجاهل",purgeSuccess:"تم حذف جميع إدخالات Dead-Letter",purgeError:"فشل الحذف",empty:"لا تتوفر بيانات المنسق",emptyHint:"قد تكون خدمة المنسق لا تزال في طور البدء. ستظهر البيانات تلقائيًا."},e_t={expand:"توسيع",expandHint:"ملء الشاشة (Ctrl+Shift+F)",close:"تم",lines:"سطور",chars:"أحرف",fullscreenTitle:"محرر المحتوى",fullscreenDescription:"محرر ملء الشاشة. اضغط Escape للإغلاق."},t_t={title:"السجلات",description:"مراقبة تدفق السجلات في الوقت الفعلي أو البحث في السجلات التاريخية.",tabLive:"مباشر",tabHistory:"السجل",connected:"متصل",disconnected:"غير متصل",filterAgent:"معرف الوكيل…",filterConversation:"معرّف المحادثة...",filterInstance:"معرّف المثيل...",allLevels:"جميع المستويات",pause:"إيقاف مؤقت",resume:"استئناف",clear:"مسح",search:"بحث",waitingForLogs:"بانتظار السجلات...",connectingStream:"جارٍ الاتصال بالبث...",noHistoryLogs:"لم يتم العثور على سجلات تاريخية.",entryCount:"{{count}} إدخال",showStacktrace:"عرض Stacktrace ({{count}} إطار)",hideStacktrace:"إخفاء Stacktrace",allAgents:"جميع الوكلاء",allConversations:"جميع المحادثات",waitingHint:"ستظهر السجلات هنا أثناء تدفقها من الخلفية.",noHistoryHint:"حاول تعديل الفلاتر أو البحث عن وكيل أو محادثة مختلفة.",searchConversations:"بحث بالمعرف أو الوكيل أو المستخدم…",stepsCount:"{{count}} خطوات",noConversationsFound:"لم يتم العثور على محادثات",useConversationId:"استخدام المعرف: {{id}}",searchLogs:"بحث في السجلات…",errors:"أخطاء",warnings:"تحذيرات",infos:"معلومات",debugs:"تصحيح",filteredCount:"{{shown}} من {{total}} إدخالات",copyEntry:"نسخ إدخال السجل",export:"تصدير",stateReady:"جاهز",stateActive:"نشط",stateError:"خطأ",stateEnded:"منتهي"},n_t={title:"خزنة الأسرار",description:"إدارة Secrets المشفرة في الخزنة. لا تُكشف القيم أبداً.",tenantId:"معرف المستأجر",refresh:"تحميل Secrets",create:"إضافة Secret",createTitle:"إضافة Secret",keyName:"اسم المفتاح",keyNameLabel:"اسم المفتاح",keyNamePlaceholder:"مثال: apiKey, dbPassword",valueLabel:"قيمة Secret",valuePlaceholder:"أدخل قيمة Secret…",storeWarning:"سيتم تشفير القيمة. لا يمكن استرجاعها بعد التخزين.",store:"تخزين Secret",storeSuccess:'تم تخزين Secret "{{key}}"',deleteSuccess:'تم حذف Secret "{{key}}"',created:"تاريخ الإنشاء",lastAccessed:"آخر وصول",checksum:"مجموع اختباري",actions:"إجراءات",confirmDeleteTitle:"حذف Secret",confirmDeleteMessage:'هل أنت متأكد من الحذف الدائم لـ "{{key}}"؟ لا يمكن التراجع عن هذا.',empty:"لم يتم العثور على Secrets",emptyHint:"أنشئ Secret أو غيّر فلاتر namespace أعلاه.",vaultUp:"Vault متصل",vaultDown:"Vault غير متصل",descriptionLabel:"الوصف (اختياري)",descriptionPlaceholder:"مثل: مفتاح API لـ OpenAI للإنتاج",descriptionCol:"الوصف",reference:"المرجع",willUseRef:"المرجع:",copyRef:"نسخ مرجع الخزنة",refCopied:"تم النسخ: {{ref}}",lastRotated:"آخر تدوير",scopeExplanation:"الأسرار محددة لكل مستأجر ومشتركة عبر جميع الوكلاء. استخدم ${vault:keyName} للرجوع إليها. الإدارة عن طريق كتابة الإعدادات.",creatingFor:'يحفظ في المستأجر "{{tenant}}" — متاح لجميع الوكلاء',vaultNotConfigured:"خزنة الأسرار غير مهيأة",viewDocs:"عرض المستندات",selectAgentFirst:"اختر وكيلاً أولاً",tableTitle:'{{count}} سر في المستأجر "{{tenant}}"'},i_t={title:"سجل التدقيق",description:"تصفح سجل التدقيق غير القابل للتغيير للامتثال والتصحيح.",byConversation:"حسب المحادثة",byAgent:"حسب Agent",conversationIdPlaceholder:"أدخل معرّف المحادثة...",agentIdPlaceholder:"أدخل Agent ID...",versionPlaceholder:"الإصدار (اختياري)",search:"بحث",entries:"إدخالات",totalDuration:"الإجمالي",totalCost:"التكلفة الإجمالية",step:"الخطوة",tasks:"مهام",input:"المدخلات",output:"المخرجات",llmDetail:"تفاصيل LLM",toolCalls:"مكالمات الأدوات",hmacIntegrity:"تم التحقق من سلامة HMAC",empty:"البحث في إدخالات التدقيق",emptyHint:"أدخل معرّف محادثة أو Agent أعلاه لتصفح Audit Trail.",noResults:"لم يتم العثور على إدخالات تدقيق",noResultsHint:"جرّب معرّفاً مختلفاً أو تحقق من معالجة المحادثة.",loadMore:"تحميل المزيد",selectAgent:"Select an agent…",conversations:"conversations",emptyAgent:"Select an agent to view its audit trail",emptyAgentHint:"Choose a deployed agent from the dropdown above to see all its audit records.",export:"Export",autoRefreshToggle:"Toggle auto-refresh (every 10s)",autoRefreshOn:"Auto",autoRefreshOff:"Auto",integrityVerified:"All entries cryptographically signed",integrityVerifiedDesc:"{{count}} of {{total}} entries have HMAC-SHA256 signatures",integrityPass:"SIGNED",integrityPartial:"Partially signed audit trail",integrityPartialDesc:"{{count}} of {{total}} entries have HMAC signatures",integrityNone:"Unsigned audit entries",integrityNoneDesc:"Configure a vault master key to enable automatic HMAC-SHA256 signing on all future audit entries.",signed:"Signed",allSigned:"All signed"},s_t={title:"الجداول",subtitle:"إدارة مشغلات Agent المجدولة — Cron وHeartbeats",create:"إنشاء جدول",createTitle:"إنشاء جدول",createSuccess:"تم إنشاء الجدول بنجاح",createError:"فشل إنشاء الجدول",creating:"جارٍ الإنشاء...",name:"الاسم",namePlaceholder:"مثال: فحص صحي يومي",triggerType:"نوع المشغل",cronExpression:"تعبير Cron",interval:"الفاصل (ثواني)",agentId:"Agent ID",agentIdPlaceholder:"أدخل Agent ID...",environment:"البيئة",message:"رسالة",messagePlaceholder:"رسالة لإرسالها إلى Agent",conversationStrategy:"استراتيجية المحادثة",total:"إجمالي الجداول",active:"نشط",failedCount:"فاشل / Dead-Lettered",nextFireLabel:"التنفيذ التالي",tableTitle:"جميع الجداول",empty:"لا توجد جداول بعد",emptyHint:"أنشئ جدولاً لأتمتة مشغّلات Agent.",colName:"الاسم",colType:"النوع",colSchedule:"الجدول",colAgent:"الوكيل",colStatus:"الحالة",colNextFire:"التنفيذ التالي",colLastFired:"آخر تنفيذ",colActions:"إجراءات",enable:"تفعيل",disable:"تعطيل",enabled:"تم تفعيل الجدول",disabled:"تم تعطيل الجدول",toggleError:"فشل تبديل الجدول",fireNow:"تنفيذ الآن",fired:"تم تنفيذ الجدول بنجاح",fireError:"فشل التنفيذ",retry:"إعادة المحاولة",retrySuccess:"تم إعادة إدراج الجدول",retryError:"فشل إعادة المحاولة",deleteSuccess:"تم حذف الجدول",deleteError:"فشل حذف الجدول",fireHistory:"سجل التنفيذ"},r_t={title:"تصحيح",tabPipeline:"المسار",tabCosts:"التكاليف",tabMemory:"الذاكرة",tabLogs:"سجلات",tabPrompt:"الموجه",turn:"الدور",latest:"الأحدث",noPipeline:"أرسل رسالة لرؤية تتبع المسار",processing:"جارٍ المعالجة...",actions:"إجراءات",confidence:"الثقة",duration:"المدة"},o_t={thisTurn:"هذا الدور",conversationTotal:"إجمالي المحادثة",tokens:"Tokens",cost:"التكلفة",duration:"المدة",model:"النموذج",toolCalls:"استدعاءات الأدوات",toolUsage:"استخدام الأدوات",cacheStats:"الذاكرة المخبئية",hitRate:"معدل الإصابة",empty:"أرسل رسالة لرؤية مقاييس التكلفة",in:"الداخلة",out:"الخارجة",total:"الإجمالي",calls:"الاستدعاءات"},a_t={title:"ذاكرة المحادثة",noConversation:"ابدأ محادثة لفحص الذاكرة",empty:"لا توجد بيانات ذاكرة متاحة",properties:"الخصائص",step:"الخطوة",keys:"المفاتيح",input:"الإدخال"},l_t={noAgent:"حدد وكيلاً لعرض السجلات",search:"بحث...",pause:"إيقاف مؤقت",resume:"استئناف",clear:"مسح",waiting:"بانتظار السجلات...",connected:"متصل",disconnected:"غير متصل",logOutput:"مخرجات السجل"},c_t={noConversation:"ابدأ محادثة لفحص المطالبات",noLlm:"لم يتم العثور على تفاعلات LLM بعد",turn:"الدور",latest:"الأحدث",tokens:"Tokens",model:"النموذج",cost:"التكلفة",copy:"نسخ المطالبة",copied:"تم النسخ!",replay:"إعادة تشغيل هذا الدور",toolCalls:"استدعاءات الأدوات",step:"الخطوة",roleSystem:"موجه النظام",roleUser:"مستخدم",roleAssistant:"المساعد",roleTool:"نتيجة الأداة"},d_t={preview:"معاينة",edit:"تحرير",switchToPreview:"معاينة الموجه المُحلّ",switchToEdit:"التبديل إلى التحرير",refresh:"تحديث",sampleData:"بيانات تجريبية (بدون محادثة)",disclaimerReal:"تستخدم المعاينة محرك Qute مع بيانات المحادثة الفعلية.",disclaimerSample:"تستخدم المعاينة محرك Qute مع بيانات تجريبية. اختر محادثة للقيم الحقيقية.",resolvedPrompt:"الموجه المُحلّ",copy:"نسخ",copied:"تم النسخ!",error:"خطأ في حل القالب",loading:"جارٍ حل القالب…",availableVariables:"المتغيرات المتاحة",copyVariable:"انقر لنسخ مرجع المتغير",varProperties:"الخصائص",varMemory:"الذاكرة",varContext:"السياق",varSnippets:"قصاصات",varUserInfo:"معلومات المستخدم",varConversationInfo:"معلومات المحادثة",varInput:"المدخلات",varConversationLog:"سجل المحادثة"},u_t={title:"استوديو الوكيل",subtitle:"قم ببناء واختبار واستكشاف أخطاء وكلائك في مساحة عمل واحدة",pipeline:"المسار",editor:"محرر",debug:"تصحيح ودردشة",selectStage:"انقر على مرحلة من المسار لفتح محررها",openInStudio:"افتح في الاستوديو",loading:"جاري تحميل الوكيل...",notFound:"لم يتم العثور على الوكيل",hideChat:"إخفاء الدردشة",showChat:"إظهار الدردشة",openEditor:"فتح في المحرر",editorComingSoon:"دمج المحرر الموضعي قريباً",noPipeline:"لا توجد مراحل في المسار",type:{parser:"المحلل اللغوي",rules:"قواعد",property:"معين الخصائص",apicalls:"استدعاءات API",llm:"LLM",output:"المخرجات","output.template":"قالب المخرجات",mcpcalls:"استدعاءات MCP",rag:"قواعد المعرفة",dictionary:"القاموس"},landingDescription:"اختر وكيلاً لفتح المحرر المرئي والمُصحح والدردشة المباشرة",noAgents:"لم يُعثر على وكلاء — أنشئ واحداً من صفحة الوكلاء",chat:"دردشة",backToAgent:"العودة إلى الوكيل",selectStageHint:"اختر أي إضافة في مسار العمل لعرض وتعديل إعداداتها مباشرة",noConfig:"هذه المرحلة ليس لها عنوان تكوين",unsupportedType:"المحرر غير متاح لهذا النوع من الإضافات"},h_t={general:"عام",kbName:"اسم قاعدة المعرفة",kbNamePlaceholder:"مثال: product-docs, faq, internal-wiki",kbNameHint:"يستخدم للإشارة إلى قاعدة المعرفة هذه من مهام LLM",embeddingModel:"نموذج التضمين (Embedding)",provider:"المزود",embeddingParams:"معلمات المزود",embeddingParamsHint:"اسم النموذج، مفتاح API (استخدم ${vault:...} للأسرار)، رابط الأساس، إلخ.",vectorStore:"مخزن المتجهات",storeType:"نوع القاعدة",storeParams:"معلمات الاتصال",chunking:"تجزئة المستندات",chunkStrategy:"استراتيجية التجزئة",chunkSize:"حجم الجزء",chunkOverlap:"تداخل الأجزاء",overlapHint:"يساعد التداخل في الحفاظ على السياق بين الأجزاء",chunkPreview:"معاينة (كيف يتم تقسيم المستند)",chunkBlocks:"{{count}} أجزاء من ~{{size}} حرف مع تداخل {{overlap}} حرف",retrievalDefaults:"الإعدادات الافتراضية للاسترجاع",retrievalHint:"يمكن تجاوز هذه الإعدادات الافتراضية لكل مهمة في تكوين LLM.",maxResults:"الحد الأقصى للنتائج (top-K)",minScore:"الحد الأدنى للتشابه",ingestion:"استيعاب المستندات",dropFiles:"أسقط المستندات هنا لاستيعابها",dropHint:"نص، ماركداون، أو أي ملف يعتمد على النصوص",browse:"تصفح",pasteText:"أو الصق محتوى نصي",pastePlaceholder:"الصق نص المستند هنا...",ingestText:"استيعاب النص",ingestionHistory:"حالة الاستيعاب",saveFirstIngestion:"احفظ قاعدة المعرفة هذه أولاً لتمكين استيعاب المستندات.",addParam:"إضافة معلمة"},g_t={welcome:{title:"مرحباً بك في EDDI",subtitle:"مركز قيادة وكلاء الذكاء الاصطناعي",introText:"EDDI Manager هو مركز القيادة الخاص بك لبناء واختبار وتشغيل وكلاء المحادثة الذكية.",capabilitiesTitle:"ما الذي يمكنك فعله",capabilitiesSubtitle:"كل ما تحتاجه لبناء وكلاء ذكاء اصطناعي جاهزين للإنتاج",buildAgents:"بناء الوكلاء",buildAgentsDesc:"أنشئ وقم بتكوين وكلاء الذكاء الاصطناعي باستخدام المعالج أو من الصفر",designWorkflows:"تصميم مسارات العمل",designWorkflowsDesc:"منشئ مسارات سحب وإفلات مع قواعد السلوك وسلاسل LLM والأدوات",testRealtime:"اختبار في الوقت الفعلي",testRealtimeDesc:"تحدث مع وكلائك بردود متدفقة وأدوات تصحيح مدمجة",monitorOperate:"المراقبة والتشغيل",monitorOperateDesc:"المحادثات، سجلات التدقيق، الأسرار، والحصص — كلها في مكان واحد",readyTitle:"هل أنت مستعد للبدء؟",readySubtitle:"يمكنك إعادة تشغيل الجولة في أي وقت من قائمة المساعدة في الشريط الجانبي",startTour:"بدء الجولة",exploreOwn:"سأستكشف بنفسي"},tour:{back:"الخلف",next:"التالي",skip:"تخطي الجولة",finish:"إنهاء",stepOf:"الخطوة {{current}} من {{total}}",dashboard:{title:"جولة لوحة القيادة",step1Title:"مركز القيادة الخاص بك",step1Desc:"ينظم الشريط الجانبي كل شيء في ثلاث مناطق: الإدارة، التطوير، والعمليات. ستعرف دائماً أين تجد ما تبحث عنه.",step2Title:"نظرة عامة على المنصة",step2Desc:"أعداد حية لوكلائك، مسارات عملك، ومحادثاتك. انقر على أي بطاقة للانتقال مباشرة إلى هذا القسم.",step3Title:"إجراءات سريعة",step3Desc:"انتقل مباشرة إلى المهام الشائعة. معالج الوكلاء هو أسرع طريقة لإنشاء وكيلك الأول — يستغرق الأمر أقل من دقيقتين.",step4Title:"خصصها لتناسبك",step4Desc:"بدّل بين المظهر الفاتح والداكن ومظهر النظام. يدعم EDDI Manager 11 لغة — اختر لغتك من محدد اللغات."},agents:{title:"جولة الوكلاء",step1Title:"مساعد الوكيل",step1Desc:"يأخذك المعالج خطوة بخطوة لإنشاء وكيل مكون بالكامل — اختر نموذجاً، واضبط الشخصية، وفعّل الأدوات، ثم انشر.",step2Title:"إنشاء يدوي",step2Desc:"للمستخدمين المتقدمين: أنشئ وكيلاً فارغاً وقم بتكوينه بتحكم كامل في JSON. مثالي للإعدادات المتقدمة.",step3Title:"بحث وتصفية",step3Desc:"ابحث عن الوكلاء فوراً بالاسم. قم بالتبديل بين طريقة العرض بشكل بطاقات أو قائمة باستخدام الزر على اليمين.",step4Title:"أسطول وكلائك",step4Desc:"تُظهر كل بطاقة اسم الوكيل، وإصداره، وآخر وقت للتعديل. انقر على أي وكيل لعرض صفحة تفاصيله مع خيارات النشر والدردشة والمسارات."},workflows:{title:"جولة المسارات",step1Title:"إنشاء مسار عمل",step1Desc:"تُعرّف مسارات العمل أنابيب المعالجة — وهي سلسلة من المهام مثل استدعاءات LLM وقواعد السلوك وتكامل HTTP.",step2Title:"مسارات عملك",step2Desc:"يمكن إرفاق كل مسار عمل بوكيل واحد أو أكثر. انقر لفتح محرر البناء المعتمد على السحب والإفلات.",step3Title:"نظم العرض",step3Desc:"ابحث بالاسم وقم بالتبديل بين شبكة البطاقات وعرض الجدول القابل للفرز."},chat:{title:"جولة الدردشة",step1Title:"أختر وكيلاً",step1Desc:"حدد وكيلاً منشوراً لبدء المحادثة. يظهر هنا الوكلاء المنشورون فقط.",step2Title:"وضع البث",step2Desc:"بدّل لتدفق الرموز في الوقت الفعلي. عند تفعيله، تظهر الاستجابة كلمة بكلمة — وهو ممتاز لتصحيح زمن الاستجابة.",step3Title:"سجل المحادثات",step3Desc:"افتح الشريط الجانبي لتصفح واستئناف المحادثات السابقة.",step4Title:"ابدأ الدردشة",step4Desc:"اكتب رسالة واضغط Enter. سيستجيب الوكيل باستخدام مسارات العمل والأدوات الداعمة ونموذج LLM الذي قمت بتكوينه."},channels:{title:"القنوات",subtitle:"ربط الوكلاء والمجموعات بمنصات المراسلة مثل Slack"},resources:{title:"جولة الموارد",step1Title:"مكتبة الإضافات",step1Desc:"الموارد هي كتل البناء لمسارات العمل. يتحكم كل نوع في جزء مختلف من سلوك الوكيل.",step2Title:"تكوينات LLM",step2Desc:"حدد أي نموذج ذكاء اصطناعي يشغل وكيلك ومطالبة النظام وأدواته وخوادم MCP وتكوينات التسلسل. هذا هو الدماغ.",step3Title:"القواعد واستدعاءات API",step3Desc:"تتحكم قواعد السلوك في تدفق المحادثة. تربط استدعاءات HTTP بـ APIs الخارجية. كلاهما يمكن استخدامه كأدوات LLM."},conversations:{title:"جولة المحادثات",step1Title:"البحث",step1Desc:"ابحث عن المحادثات بسرعة عبر المعرف الخاص بها أو الوكيل أو عن طريق الرسائل الحديثة من المستخدم.",step2Title:"فلاتر الحالة",step2Desc:"قم بتصفية المحادثات حسب الحالة: نشطة، قيد التقدم، منتهية، أو بها خطأ.",step3Title:"قائمة المحادثات",step3Desc:"تصفح كافة الجلسات. انقر على بطاقة محادثة لفتح الخط الزمني للمحادثة لتصور الأخطاء."},groups:{title:"جولة مجموعات النقاش",step1Title:"إنشاء مجموعة",step1Desc:"قم بإنشاء مجموعة إدارة من أجل السماح بتعاون العديد من الوكلاء بالنقاش والمداولة.",step2Title:"البحث داخل المجموعات",step2Desc:"ابحث داخل مجمعاتك الحالية لتعدد الوكلاء.",step3Title:"شبكة المجموعات",step3Desc:"إدارة البيئات التعاونية وتعديل سياساتها أو مسح مجموعات النظام البالية."},logs:{title:"جولة سجلات النظام",step1Title:"مباشرة في مواجهة السجلات",step1Desc:"التبديل بين تيار حي من سجلات النظام الخاص بك أو سجلات البحث التاريخية.",step2Title:"إعداد التصفية الحية",step2Desc:"فلتر تدفق حي حسب منشئ وكيل، او بالمستويات للخطورة المهمة.",step3Title:"تصدير",step3Desc:"تنزيل السجلات المنقحة حاليا كملف نص للتحليل الخارجي."},secrets:{title:"جولة خزانة الأسرار",step1Title:"قم بعمل أسرار",step1Desc:"احفظ بأمان مفاتيح API الخاصة بك وعلامات الإعتماد او كلمة السر لوكيليك من أجل إشارات موثوقة.",step2Title:"التقسيم عن المستأجر",step2Desc:"أظهر عرض الخزانة في مراجعة مخصصة لنطاق المستأجر لمفاتيحك.",step3Title:"صيغ الإشارة",step3Desc:"اكتشف كيف يمكنك إدراج السر للتحقق الديناميكي أثناء العمل بدلا من الشفرة الثابتة لمكون LLM (${vault:...})."},audit:{title:"جولة سجل التدقيق",step1Title:"طريقة البحث",step1Desc:"راجع تاريخ تدقيق السجلات عن طريق محادثة محددة أو بإصدار معين.",step2Title:"تشغيل البحث",step2Desc:"اضف الهوية (ID) وانقر لتنزيل وتأكد من التنفيذ للسجل.",step3Title:"تصدير السجل الدفتري",step3Desc:"نزل مراجعات النظام التي عثر عليها بصيغة (JSON) للقيام بالمتوافق والتقارير."},schedules:{title:"جولة المجدولين",step1Title:"صنع الجداول",step1Desc:"شغل أداة جدولة العمل Cron وأنجز النبضات بانتظام لتحميل الأعمال التلقائية للوكلاء.",step2Title:"نسب صحية",step2Desc:"راجع وراقب مجموع الفشل من الجدول للمشغلات لكامل المنصة.",step3Title:"التحكم بجدول التطبيقات",step3Desc:"راقب مشغليك ذاتيا واوقف تشغيلها وأكمل او حتى احذف منها للتحذير الخاص بك كاختبار فعلي لها."},quotas:{title:"جولة الحصص",step1Title:"معوقات البناء",step1Desc:"حدد قيوداً صريحة على استهلاك وكلاءك يومياً أو في المحادثات للحصص المضافة أو الرموز من هذا الحساب.",step2Title:"استطلاع الأداء",step2Desc:"راجع بانتظام مقدار مستأجرينك ما أتوا من هذه الكوته في الزمن الحقيقي.",step3Title:"تنفيذ القيود",step3Desc:"احفظ الحدود بعد التعديلات للمنصة، لحظر جميع الحمولات المرورية المعارضة لذلك التقييد."},coordinator:{title:"جولة فريق التنسيق",step1Title:"الروابط المباشرة",step1Desc:"عاين اتصالات المصادر المتدفقة من واجهات نبض النظام في عمليات خلفية فريق المنسقين.",step2Title:"تصرف قائمة المهام",step2Desc:"تدابير عمليات المهام أو نشاط التشغيل للبيئات الحقيقية بمجموعتك.",step3Title:"الرسائل الميتة",step3Desc:"تحقق من الأعمال البائسة وقرر الحذف تماما، أو العودة لإعادتها بغرض توازن واستكمال للنظام الخاص بنا."},orphans:{title:"جولة محطة اليتيمات",step1Title:"بحث مشعب",step1Desc:"تحضير و إعطـاء صلاحيات شاملة للمنصة و أكتشاف بيانات التكوينات التي ليست في أي وكالة.",step2Title:"عملية تتضمن الإزالة الناعمة",step2Desc:"تبديل الميزة لتحديد الملف المحذوفات مسبقاً تاريخيا في السجلات لحذف جذري.",step3Title:"مراجعة التنقيب الفعلي",step3Desc:"استطلاع تقييمي للبيان الخاص والمجرد من أجزاء مهملة لتأخذ إزالة شاملة وتنظيفا تاما وتحفظ مساحة كبيرة للبيانات لدينا."}},help:{title:"المساعدة والجولة",platformTour:"جولة المنصة",resetAll:"إعادة تعيين جميع الجولات",resetConfirm:"هل تريد إعادة تعيين تقدم الجولات؟"},offer:{message:"هل أنت جديد هنا؟ خذ {{page}}",accept:"أرني ذلك",dontAsk:"لا تسألني مرة أخرى"}},f_t={status:"حالة المنصة",online:"متصل",offline:"غير متصل",checking:"جارٍ التحقق…",connected:"متصل",disconnected:"غير متصل",instance:"مثيل",latency:"زمن الاستجابة",lastChecked:"آخر فحص",justNow:"الآن",secondsAgo:"منذ {{count}}ث"},p_t={live:"مباشر",reconnecting:"إعادة الاتصال…"},m_t={title:"جديد {{type}}",newAgent:"وكيل جديد",newGroup:"مجموعة جديدة",quickCreate:"إنشاء سريع",quickCreateTitle:"إنشاء سريع {{type}}",quickCreateDesc:"عيّن اسماً ووصفاً، ونفّذ التكوين الدقيق لاحقاً.",guidedSetup:"إعداد موجه",guidedSetupDesc:"معالج خطوة بخطوة من خيارات LLM والمطالبات والنشر."},b_t={empty:"لا توجد مجموعات بعد",emptyDescription:"تتيح المجموعات لعدة وكلاء التعاون في مناقشات منظمة.",createGroup:"إنشاء مجموعة",unnamed:"مجموعة بدون اسم",count_one:"مجموعة {{count}}",count_other:"{{count}} مجموعات",confirmDelete:"حذف هذه المجموعة؟",confirmDeleteDesc:"سيتم حذف تكوين المجموعة نهائيًا.",duplicateSuccess:"تم تكرار المجموعة",noDescription:"No description",members:"members",discussionStyle:"Discussion Style",maxRounds:"Max Rounds"},x_t={title:"ذاكرة المستخدم",subtitle:"تصفح وإدارة ذكريات المستخدم المخزنة بواسطة الوكلاء",userIdPlaceholder:"أدخل معرف المستخدم…",searchPlaceholder:"البحث في الذكريات…",enterUserId:"أدخل معرف مستخدم لتصفح ذكرياته",totalEntries:"إجمالي الإدخالات",preferences:"التفضيلات",facts:"الحقائق",conflicts:"المتعارضة",cat_all:"الكل",cat_preference:"التفضيلات",cat_fact:"الحقائق",cat_context:"السياق",deleteAll:"حذف الكل",deleteAllTitle:"حذف جميع الذكريات",deleteAllDesc:"سيتم حذف جميع ذكريات هذا المستخدم نهائياً. لا يمكن التراجع عن هذا الإجراء.",deleteAllConfirm:"حذف الكل",entryDeleted:"تم حذف إدخال الذاكرة",allDeleted:"تم حذف جميع ذكريات المستخدم",noResults:"لم يتم العثور على إدخالات ذاكرة",value:"القيمة",sourceAgent:"الوكيل المصدر",accessCount:"عدد الوصول",created:"تاريخ الإنشاء",updated:"تاريخ التحديث",sourceConversation:"المحادثة المصدر",conflicted:"متعارض"},v_t={title:"خصائص المستخدم",subtitle:"تصفح وإدارة خصائص longTerm المخزنة لكل مستخدم",userIdPlaceholder:"أدخل معرف المستخدم…",searchPlaceholder:"تصفية الخصائص…",enterUserId:"أدخل معرف مستخدم لعرض خصائصه",key:"المفتاح",type:"النوع",value:"القيمة",deleteAll:"حذف الكل",deleteAllTitle:"حذف جميع الخصائص",deleteAllDesc:"سيتم حذف جميع خصائص هذا المستخدم نهائياً.",deleted:"تم حذف الخصائص",noResults:"لم يتم العثور على خصائص",showingCount:"{{count}} خاصية"},__t={title:"مشغلات الوكلاء",subtitle:"ربط النوايا بنشر الوكلاء للتوجيه التلقائي",create:"مشغل جديد",createTitle:"إنشاء مشغل",editTitle:"تعديل المشغل",intent:"النية",deployments:"عمليات نشر الوكلاء",addDeployment:"إضافة وكيل",agents:"وكلاء",empty:"لم يتم تكوين مشغلات بعد",created:"تم إنشاء المشغل",updated:"تم تحديث المشغل",deleted:"تم حذف المشغل",deleteTitle:"حذف المشغل",deleteDesc:"هل تريد حذف المشغل للنية «{{intent}}» نهائياً؟",searchPlaceholder:"تصفية حسب النية أو معرف الوكيل…"},y_t={title:"اكتشاف القدرات",subtitle:"اكتشاف الوكلاء حسب مهاراتهم وقدراتهم المعلنة",searchPlaceholder:"البحث في المهارات…",strategyHighest:"أعلى ثقة",strategyAll:"جميع النتائج",registeredSkills:"المهارات المسجلة",noSkills:"لم يتم العثور على مهارات",matchingAgents:"الوكلاء المطابقون",noMatches:"لم يُعثر على وكلاء لهذه المهارة"},w_t={title:"تصدير الوكيل",loading:"يُحمل شجرة الموارد...",selectResources:"اختر الموارد للتصدير",required:"مطلوب",snippets:"القصاصات",allSelected:"تم تحديد جميع الموارد",countSelected:"{{count}} من {{total}} مورد محدد",exportSelected:"تصدير المحدد"},C_t={title:"استيراد وكيل",dropZone:"أسقط ملف .zip هنا أو انقر للتصفح",dropZoneHint:"أرشيف الوكيل المصدر (.zip)",strategyLabel:"استراتيجية الاستيراد",createNew:"إنشاء كوكيل جديد",createNewDesc:"إنشاء نسخة جديدة بـ IDs جديدة. الأفضل للاستيراد لأول مرة.",mergeSync:"دمج/مزامنة مع الموجود",mergeSyncDesc:"يحدث الموارد الموجودة إذا تم استيرادها مسبقاً. ينشئ جديدة إذا لم توجد.",upgradeExisting:"ترقية الوكيل الموجود",upgradeDesc:"مطابقة هيكلية للموارد ضد الوكيل الهدف. الأفضل للترقية بين البيئات.",syncRemote:"مزامنة من مثيل بعيد",syncDesc:"اتصل بمثيل EDDI آخر وقم بمزامنة وكيل محدد مباشرة.",importNow:"استيراد الآن",previewChanges:"معاينة التغييرات",selectTargetAgent:"اختر الوكيل الهدف",upgradeTargetHint:"سيتم مطابقة الموارد المستوردة هيكلياً مع هذا الوكيل.",chooseAgent:"— اختر وكيلًا —",sourceAgent:"الوكيل المصدر (عن بُعد)",targetAgent:"الوكيل الهدف (محلي)",createNewTarget:"إنشاء وكيل جديد",resource:"المورد",type:"النوع",match:"مطابقة",action:"إجراء",new:"جديد",updated:"مُحدث",unchanged:"بدون تغيير",selected:"محدد",mergeNow:"استيراد المحدد",syncNow:"مزامنة الآن",upgradeNow:"ترقية الآن",importing:"يتم استيراد الوكيل...",contentIdentical:"المحتوى متطابق",targetContent:"الهدف",sourceContent:"المصدر"},S_t={title:"مزامنة الوكلاء",subtitle:"قم بمزامنة الوكلاء بين مثيلات EDDI",connection:"المثيل المصدر",sourceUrl:"رابط EDDI المصدر",authToken:"رمز التفويض",authHint:"اختياري. يُرسل كترويسة X-Source-Authorization.",connect:"اتصال",connected:"متصل",agentsFound:"وكلاء",connectionFailed:"فشل الاتصال",agentMapping:"تخطيط الوكلاء",previewAll:"معاينة الكل",syncSelected:"مزامنة المحدد",remote:"عن بُعد",createNew:"إنشاء جديد",changes:"تغيير",agentsSelected:"وكلاء محددون",totalResources:"موارد",syncSuccess:"اكتملت المزامنة",syncError:"فشلت المزامنة",empty:"اتصل بالمثيل المصدر للبدء في مزامنة الوكلاء.",autoMatched:"مطابقة تلقائية",previewFirst:"معاينة التغييرات قبل المزامنة"},k_t={actionCreate:"جديد",actionUpdate:"تحديث",actionSkip:"محدّث",actionConflict:"تعارض"},N_t={title:"محادثات المستخدم",subtitle:"إدارة ربط النية → المستخدم → المحادثة",lookup:"بحث",intent:"النية",userId:"معرف المستخدم",agentId:"معرف الوكيل",environment:"البيئة",conversationId:"معرف المحادثة",binding:"الربط النشط",enterBoth:"أدخل النية ومعرف المستخدم",notFound:"لم يتم العثور على ربط",create:"إنشاء ربط",createTitle:"إنشاء ربط",created:"تم إنشاء الربط",deleteTitle:"حذف الربط",deleteDesc:'إزالة الربط للنية "{{intent}}" والمستخدم "{{userId}}"?',deleted:"تم حذف الربط"},E_t={placeholder:"البحث في الصفحات والوكلاء والإجراءات…",noResults:"لم يتم العثور على نتائج.",recent:"الأخيرة",navigate:"التنقل",agents:"الوكلاء",actions:"إجراءات سريعة",createAgent:"إنشاء وكيل جديد",openChat:"فتح الدردشة",kbdNavigate:"تنقل",kbdSelect:"تحديد",kbdClose:"إغلاق"},L_t={title:"Group Setup Wizard",subtitle:"Assemble a team of AI advisors to discuss your questions",backToGroups:"Back to Groups",templateTitle:"Start from a template",templateDesc:"Choose a preset group configuration or start from scratch.",startBlank:"Start from Scratch",blankDesc:"Configure everything manually",configTitle:"Group Configuration",configDesc:"Name your group and choose how the agents will discuss",namePlaceholder:"e.g. Advisory Board",descPlaceholder:"What is this group for?",membersTitle:"Assemble Your Team",membersDesc:"For each seat, choose an existing agent or create a new one on the fly.",addMember:"Add Member",refreshAgents:"Refresh agent list",existingAgents:"existing agents",displayName:"Agent Name",displayNamePlaceholder:"Give this agent a name…",rolePlaceholder:"Role (e.g. Marketing, Engineering)",useExisting:"Use Existing",createNew:"Create New",selectAgent:"Select agent…",systemPrompt:"System Prompt",provider:"LLM Provider",model:"Model",apiKey:"API Key",apiKeyPlaceholder:"sk-…",createThisAgent:"Create Agent",creatingAgent:"Creating agent…",agentReady:"Agent created & deployed",agentCreated:'Agent "{{name}}" created',agentCreateFailed:"Failed to create agent: {{error}}",moderator:"Moderator",moderatorHint:"Synthesizes the discussion",addModerator:"Add Moderator",removeModerator:"Remove moderator",createModerator:"Create Moderator Agent",moderatorReady:"Moderator agent ready",moderatorCreated:"Moderator agent created",creatingModerator:"Creating moderator…",creatingSlot:"Creating {{name}}…",creatingGroup:"Creating group…",needMembers:"Add at least 2 members to proceed",reviewTitle:"Review & Create",reviewDesc:"Review your group configuration before creating.",reviewMembers:"Members",autoCreateNotice:"{{count}} agents will be auto-created when you click Create Group",autoCreateHint:"Each agent will be created and deployed automatically before the group is assembled.",unassignedWarning:"{{count}} members set to 'Use Existing' but no agent selected",unassignedHint:"These members will be skipped during discussions. Go back to assign agents.",flowPreview:"Discussion Flow",createGroup:"Create Group",created:"Group Created!",viewGroup:"Open Group",createAnother:"Create Another",success:"Group created successfully!"},D_t={advisoryBoard:"Advisory Board",advisoryBoardDesc:"A panel of expert advisors consulting on strategic decisions.",codeReview:"Code Review Panel",codeReviewDesc:"Structured code review with independent opinions, peer critique, and revision.",riskAssessment:"Risk Assessment",riskAssessmentDesc:"A panel with a devil's advocate who challenges assumptions.",forecasting:"Forecasting Panel",forecastingDesc:"Delphi-style anonymous deliberation for unbiased estimates.",proCon:"Pro/Con Debate",proConDesc:"Formal debate with pro and con teams arguing their positions.",roles:{marketingExpert:"Marketing Expert",techLead:"Tech Lead",financeDirector:"Finance Director",legalCounsel:"Legal Counsel",strategyConsultant:"Strategy Consultant",seniorEngineer:"Senior Engineer",architect:"Architect",securityReviewer:"Security Reviewer",riskAnalyst:"Risk Analyst",domainExpert:"Domain Expert",devilsAdvocate:"Devil's Advocate",analystA:"Analyst A",analystB:"Analyst B",analystC:"Analyst C",analystD:"Analyst D",proAdvocate1:"Pro Advocate 1",proAdvocate2:"Pro Advocate 2",conAdvocate1:"Con Advocate 1",conAdvocate2:"Con Advocate 2"}},T_t={agentIdPlaceholder:"معرف الوكيل لمعالجة الرسائل",botToken:"رمز البوت",botTokenHint:"رمز OAuth للبوت. استخدم مرجع الخزنة لمزيد من الأمان.",botTokenPlaceholder:"xoxb-… أو ${vault:slack-bot-token}",channel:"قناة",channelId:"معرف قناة Slack",channelIdCol:"معرف القناة",channelIdHint:"انقر بزر اليمين على قناة Slack → عرض تفاصيل القناة → نسخ معرف القناة",channelsPlural:"قنوات",channelType:"نوع القناة",confirmDelete:"حذف القناة؟",confirmDeleteDesc:"ستتم إزالة تكامل القناة هذا نهائيًا.",create:"إنشاء قناة",createTitle:"إنشاء تكامل قناة",defaultAgentId:"معرف الوكيل الافتراضي",defaultTargetHint:"يعالج الهدف الافتراضي جميع الرسائل التي لا تتطابق مع كلمة مفتاحية. يمكنك إضافة أهداف أخرى بعد الإنشاء.",empty:"لا توجد قنوات بعد",emptyDesc:"أنشئ تكامل قناة لربط الوكلاء بـ Slack.",name:"الاسم",namePlaceholder:"مثلاً Engineering AI Hub",openSlackApps:"فتح لوحة تحكم تطبيق Slack",searchPlaceholder:"بحث في القنوات…",signingSecret:"سر التوقيع",signingSecretHint:"من صفحة المعلومات الأساسية لتطبيق Slack.",signingSecretPlaceholder:"سلسلة ست عشرية أو ${vault:slack-signing-secret}",slackSetupGuide:"دليل إعداد Slack",slackSetupSummary:"أنشئ تطبيق Slack، وكوّن نطاقات رمز البوت (app_mentions:read، chat:write، im:history، channels:history، groups:history)، ثم الصق بيانات الاعتماد هنا.",target:"هدف",targets:"أهداف",targetsCol:"الأهداف",type:"النوع",unnamed:"قناة بدون اسم",version:"الإصدار"},I_t={addTarget:"إضافة هدف",addTrigger:"إضافة مشغل…",agentId:"معرف الوكيل",botToken:"رمز البوت",channelId:"معرف قناة Slack",cooldown:"فترة التهدئة (ث)",general:"عام",groupId:"معرف المجموعة",isDefault:"افتراضي",maxCost:"الحد الأقصى $/يوم",maxDaily:"الحد الأقصى/يوم",name:"الاسم",observe:"مراقبة",observeDesc:"مراقبة سلبية واستجابة انتقائية",observeKeywords:"كلمات مفتاحية للتشغيل",observeMimeTypes:"أنواع MIME للتشغيل",observeMode:"وضع المراقبة",observeSettings:"إعدادات وضع المراقبة",platformConfig:"تكوين المنصة",rawConfig:"التكوين الخام",removeTarget:"إزالة",requiredEvents:"اشتراكات الأحداث المطلوبة:",requiredScopes:"نطاقات رمز البوت المطلوبة:",setDefault:"تعيين كافتراضي",signingSecret:"سر التوقيع",targetName:"الاسم",targets:"أهداف توجيه الرسائل",targetType:"النوع",triggerHint:'يكتب المستخدمون "كلمة مفتاحية: رسالة" للتوجيه إلى هذا الهدف',triggerKeywords:"كلمات مفتاحية للتشغيل",triggers:"مشغلات",type:"نوع القناة",webhookHint:"الصق هذا الرابط في حقل Request URL ضمن Event Subscriptions في تطبيق Slack.",webhookUrl:"رابط الويب هوك"},A_t={app:Lvt,auth:Dvt,nav:Tvt,theme:Ivt,language:Avt,pages:Rvt,common:Mvt,agents:Pvt,agentDetail:Ovt,wizard:jvt,setupWizard:Fvt,packages:Bvt,packageDetail:Hvt,packageEditor:Wvt,conversations:Vvt,conversationDetail:zvt,chat:Uvt,resources:$vt,editor:qvt,rulesEditor:Kvt,apiCallsEditor:Gvt,llmEditor:Yvt,outputEditor:Qvt,propertySetterEditor:Xvt,dictionaryEditor:Zvt,coordinator:Jvt,contentEditor:e_t,logs:t_t,secrets:n_t,audit:i_t,schedules:s_t,debugDrawer:r_t,costDashboard:o_t,memoryInspector:a_t,logViewer:l_t,promptViewer:c_t,promptPreview:d_t,studio:u_t,ragEditor:h_t,onboarding:g_t,platform:f_t,stream:p_t,createOrWizard:m_t,groups:b_t,memories:x_t,properties:v_t,triggers:__t,capabilities:y_t,exportDialog:w_t,importDialog:C_t,syncPage:S_t,sync:k_t,userConversations:N_t,commandPalette:E_t,groupWizard:L_t,groupTemplates:D_t,channels:T_t,channelDetail:I_t},R_t={title:"EDDI Manager",description:"EDDI 会话式 AI 平台管理面板"},M_t={login:"登录",logout:"退出",loading:"认证中…",sessionExpired:"会话已过期,请重新登录。",profile:"个人资料",guest:"访客",userMenu:"用户菜单"},P_t={dashboard:"仪表盘",agents:"代理",packages:"工作流",conversations:"对话",coordinator:"协调器",schedules:"定时任务",logs:"日志",orphans:"孤立项",secrets:"密钥",audit:"审计日志",quotas:"配额",groups:"群组",chat:"聊天",resources:"资源",sectionManagement:"管理",sectionDevelopment:"开发",sectionOperations:"运维",mainNavigation:"主导航",openMenu:"打开导航菜单",sectionCore:"核心",sectionBuild:"构建与测试",sectionMonitor:"监控",sectionAdmin:"管理",studio:"工作室",gdpr:"隐私",memories:"用户记忆",properties:"属性",triggers:"触发器",capabilities:"能力",sync:"同步",channels:"频道",userConversations:"用户对话",userData:"用户数据",variables:"变量"},O_t={light:"浅色",dark:"深色",system:"跟随系统"},j_t={label:"语言",en:"English",de:"Deutsch",fr:"Français",es:"Español",ar:"العربية",zh:"中文",th:"ไทย",ja:"日本語",ko:"한국어",pt:"Português",hi:"हिन्दी"},F_t={dashboard:{title:"仪表盘",subtitle:"EDDI Agents 和会话概览",activeAgents:"活跃 Agents",totalWorkflows:"工作流",totalResources:"资源",totalConversations:"对话",quickActions:"快捷操作",recentAgents:"最近的 Agents",noRecentAgents:"暂无 Agent,创建您的第一个 Agent!"},agents:{title:"代理",subtitle:"管理您的会话式 AI Agents"},packages:{title:"工作流",subtitle:"配置 Workflows 和扩展"},conversations:{title:"对话",subtitle:"查看和管理 Agent 会话"},resources:{title:"资源",subtitle:"管理行为规则、词典、输出集等"},chat:{title:"聊天",subtitle:"与已部署的 Agents 对话"},channels:{title:"频道",subtitle:"将代理和组连接到 Slack 等消息平台"},groups:{title:"群组",subtitle:"多 Agent 讨论组,用于结构化辩论和协作"}},B_t={loading:"加载中...",error:"出错了",retry:"重试",save:"保存",cancel:"取消",delete:"删除",create:"创建",edit:"编辑",search:"搜索...",noResults:"未找到结果",duplicate:"复制",close:"关闭",skipToMain:"跳至主要内容",opensNewTab:"在新标签页中打开",moreActions:"更多操作",sortByName:"按名称排序",sortByVersion:"按版本排序",sortByModified:"按修改日期排序",apply:"应用",copied:"已复制",copy:"复制",saving:"保存中…",showMore:"Show More",showLess:"Show Less",copyFailed:"复制到剪贴板失败"},H_t={deploy:"部署",undeploy:"取消部署",createAgent:"创建 Agent",createTitle:"创建新 Agent",name:"名称",namePlaceholder:"我的 Agent",description:"描述",descriptionPlaceholder:"描述此 Agent 的功能...",empty:"暂无 Agent。创建您的第一个 Agent!",confirmDelete:"确定要删除此 Agent 吗?",count_one:"{{count}} 个智能体",count_other:"{{count}} 个智能体",export:"导出",exporting:"正在导出...",exportSuccess:"Agent 导出成功",import:"导入 Agent",importing:"正在导入...",importSuccess:"Agent 导入成功",importError:"Agent 导入失败",emptyDescription:"使用向导在几分钟内创建一个完整配置的 Agent。",chat:"聊天",deployAndChat:"部署并聊天",openExternalChat:"在新标签页中打开"},W_t={title:"Agent 详情",backToAgents:"返回 Agents",packages:"工作流",noWorkflows:"尚未添加 Workflows",addWorkflow:"添加 Workflow",selectWorkflow:"选择要添加的 Workflow",rawConfig:"原始配置",editName:"编辑名称",editDescription:"编辑描述",clickToEdit:"点击编辑",noDescription:"无描述",duplicate:"复制",duplicating:"正在复制...",duplicateSuccess:"Agent 复制成功",environments:"环境",envProduction:"生产环境",envTest:"测试环境",savingAgent:"正在保存 Agent...",savedAgent:"Agent 保存成功",saveError:"Agent 保存失败",deployToEnv:"部署到{{env}}",undeployFromEnv:"从{{env}}移除",openStudio:"在工作室中打开",maxKeyLength:"最大键长度",maxValueLength:"最大值长度",maxWritesPerTurn:"每轮最大写入次数",dreamSchedule:"计划 (cron)",dreamLlmProvider:"LLM 提供商",dreamLlmModel:"LLM 模型",dreamMaxCost:"每次最大成本 ($)",dreamPruneDays:"清理间隔 (天)",dreamBatchSize:"批处理大小",detectContradictions:"检测矛盾",summarizeInteractions:"总结交互",confidenceLow:"低",confidenceMedium:"中等",confidenceHigh:"高",visibilitySelf:"自身",visibilityGlobal:"全局",onCapEvict:"淘汰最旧",onCapReject:"拒绝",recallMostRecent:"最新优先",recallMostRelevant:"最相关优先",channels:"频道连接器",channelsDesc:"将此代理连接到 Slack 频道。每个频道连接器都可以独立配置自己的凭据,支持多工作区设置。",noChannels:"未配置频道",noChannelsDesc:"添加 Slack 频道,让用户可以通过 Slack 与此代理交互。",addSlackChannel:"添加 Slack 频道",slackChannel:"Slack 频道",removeChannel:"移除频道",removeChannelConfirm:"移除此 Slack 频道连接器?",removeChannelDesc:"This action will permanently disconnect this channel.",channelId:"频道 ID",channelIdHint:"频道 ID 以 C 开头,后跟大写字母数字字符",botToken:"Bot 令牌",botTokenPlaceholder:"xoxb-… 或 ${vault:slack-bot-token}",botTokenHint:"Slack Bot 用户 OAuth 令牌。请使用保管库引用以确保安全。",signingSecret:"签名密钥",signingSecretPlaceholder:"十六进制字符串或 ${vault:slack-signing-secret}",signingSecretHint:"来自 Slack 应用的基本信息页面。请使用保管库引用以确保安全。",groupIdOptional:"群组 ID(可选)",groupIdPlaceholder:"多代理群组配置 ID",groupIdHint:'启用此 Slack 频道的 "group: 问题" 多代理讨论。',slackSetupGuide:"Slack 设置指南",slackWebhookUrl:"Webhook URL",slackWebhookCopied:"Webhook URL 已复制",slackStep1:"在 api.slack.com/apps 上创建一个 Slack 应用并将其安装到您的工作区。",slackStep2:"将 Bot 令牌 (xoxb-…) 和签名密钥复制到 EDDI 保管库中,并在下方配置频道。",slackStep3:"然后在 Slack 应用中启用 Event Subscriptions,粘贴上面的 Webhook URL,并订阅:",slackSetupNote:"重要提示:在启用 Event Subscriptions 之前,请先在下方配置频道 — Slack 会发送 URL 验证请求,需要在 EDDI 中配置签名密钥。",slackRequiredScopes:"所需的 Bot 令牌权限"},V_t={title:"Agent 向导"},z_t={title:"Agent 创建向导",subtitle:"几分钟内创建一个完全配置的 Agent",backToAgents:"返回 Agents",next:"下一步",back:"上一步",createOnly:"仅创建",createAndDeploy:"创建并部署",typeTitle:"选择 Agent 类型",typeDesc:"选择您要创建的 Agent 类型",standardAgent:"标准智能体",apiAgent:"API 智能体",standardDesc:"基于 LLM 的会话 AI,支持工具、Quick Replies 和情感分析",apiDesc:"导入 OpenAPI/Swagger 规范,自动生成 API Agent",infoTitle:"Agent 身份",infoDesc:"为您的 Agent 设置名称和个性",agentName:"Agent 名称",namePlaceholder:"例如:客户支持机器人",systemPrompt:"系统提示",promptPlaceholder:"你是一个有帮助的 AI 助手,负责...",promptHint:"此指令决定了您的 Agent 的行为和响应方式。",llmTitle:"LLM 配置",llmDesc:"选择驱动 Agent 的 AI 模型",provider:"提供商",model:"模型",apiKey:"API 密钥",baseUrl:"基础 URL",baseUrlPlaceholder:"自定义端点 URL",optional:"可选",apiSpecTitle:"OpenAPI 规范",apiSpecDesc:"提供您 API 的 OpenAPI/Swagger 规范",specByUrl:"链接(URL)",specByFile:"文件",specByPaste:"粘贴",fetch:"获取",specFetched:"规范已加载!",specFetchError:"获取规范失败",dropFile:"将 OpenAPI 文件拖放到此处",dropHint:"JSON 或 YAML 格式",browse:"浏览文件",pasteSpec:"在此粘贴 OpenAPI/Swagger JSON 或 YAML...",specLoaded:"文件已加载:{{name}}",specReady:"规范已加载({{chars}} 个字符)",apiBaseUrlLabel:"API 基础 URL",apiAuthLabel:"API 认证头",endpointFilter:"Endpoint 筛选",endpointFilterPlaceholder:"逗号分隔:GET /users, POST /orders",featuresTitle:"功能与选项",featuresDesc:"自定义 Agent 的能力",introMessage:"欢迎消息",introMessageDesc:"对话开始时显示的问候语",quickReplies:"快捷回复",quickRepliesDesc:"LLM 生成可点击的回复建议",sentiment:"情感分析",sentimentDesc:"实时跟踪用户情绪、意图和紧急程度",structuredOutput:"结构化输出",structuredOutputDesc:"LLM 以 JSON 对象而非纯文本形式响应",structuredOutputInfo:"启用此功能后,LLM 将以包含结构化字段的 JSON 对象进行响应。系统提示词中会附加 JSON 架构,并将模型设为 JSON 响应模式。",builtInTools:"内置工具",builtInToolsDesc:"启用 EDDI 内置工具库(计算器、日期时间等)",toolsWhitelist:"白名单(空 = 全部)",mcpServers:"MCP 服务器",mcpServersDesc:"用于外部工具的 Model Context Protocol 服务器",autoDeploy:"自动部署",autoDeployDesc:"创建后立即部署 Agent",environment:"环境",envProduction:"生产环境",envTest:"测试环境",reviewTitle:"审核并创建",reviewDesc:"创建前审核您的配置",reviewType:"类型",reviewName:"名称",reviewPrompt:"系统提示",reviewProvider:"提供商",reviewModel:"模型",reviewSpec:"OpenAPI 规范",reviewIntro:"欢迎消息",reviewDeploy:"部署",success:"Agent 创建成功!",agentCreated:"Agent 已创建!",deployed:"已部署",endpointsParsed:"已解析 {{count}} 个 API endpoints",viewAgent:"查看 Agent",createAnother:"创建另一个",allTools:"全部工具",selectSpecific:"手动选择",allToolsInfo:"所有 {{count}} 个内置工具将对您的代理可用。选择「手动选择」来限制启用的工具。",availableTools:"可用工具",toolCount:"已选 {{selected}}/{{total}}"},U_t={createWorkflow:"创建 Workflow",createTitle:"创建新 Workflow",name:"名称",namePlaceholder:"我的 Workflow",description:"描述",descriptionPlaceholder:"描述此 Workflow 的功能...",noDescription:"无描述",empty:"暂无 Workflow。创建您的第一个 Workflow!",confirmDelete:"确定要删除此 Workflow 吗?",count_one:"{{count}} 个工作流",count_other:"{{count}} 个工作流",emptyDescription:"Workflow 定义了 Agent 的处理流水线。"},$_t={title:"Workflow 详情",backToWorkflows:"返回 Workflows",extensions:"扩展",noExtensions:"此 Workflow 中没有扩展",rawConfig:"原始配置"},q_t={title:"Workflow 编辑器",pipeline:"扩展 Pipeline",addHint:"添加扩展以构建处理 Pipeline",addHintDialog:"选择要添加的扩展类型",reorder:"重新排序扩展",saved:"Workflow 保存成功",saveError:"保存工作流失败",noTasks:"此工作流中没有任务",addTask:"添加任务"},K_t={searchPlaceholder:"按会话 ID 搜索...",id:"对话",agent:"代理",state:"状态",lastActivity:"最近活动",actions:"操作",empty:"暂无会话。部署一个 Agent 并开始聊天!",confirmDelete:"确定要删除此会话吗?",count_one:"{{count}} 次对话",count_other:"{{count}} 次对话",emptyDescription:"部署 Agent 并在 Chat 页面中开始对话。"},G_t={continueChat:"在聊天中继续",searchTranscript:"在对话中搜索…",exportMd:"导出为 Markdown",toolSummary:"工具使用概览",totalCost:"总成本",cacheHitRate:"缓存命中率"},Y_t={selectAgent:"选择 Agent...",noAgents:"没有可用的已部署 Agent。请先部署一个 Agent。",placeholder:"输入消息...",send:"发送",newConversation:"新会话",endConversation:"结束会话",streaming:"流式传输",thinking:"思考中...",connectionError:"连接错误,请重试。",empty:"选择一个 Agent 并开始聊天!",history:"历史记录",undo:"撤销上一条消息",redo:"恢复消息",continueConversation:"继续",noHistory:"暂无会话历史。",attach:"附加文件",attachUploading:"上传中...",attachSuccess:"文件已附加",attachError:"文件上传失败",retry:"重试上一步",retrySuccess:"步骤已重新执行",retryError:"重试失败",showActivity:"显示活动",hideActivity:"隐藏活动",scrollToBottom:"滚动到底部",copyMessage:"复制消息",copied:"已复制!",activity:{processing:"处理中…",steps:"步骤",toolCalls:"工具调用",toolCall:"工具调用",toolResult:"结果"},channels:{title:"频道",subtitle:"将代理和群组连接到 Slack 等消息平台"},context:{conversationId:"对话 ID",agentVersion:"代理版本",startTime:"开始时间",stepCount:"步骤数",show:"显示对话信息",hide:"隐藏对话信息"},agentTyping:"代理正在输入"},Q_t={unnamed:"未命名资源",noDescription:"无描述",backToResources:"返回资源",backToList:"返回{{type}}",unknownType:"未知资源类型",rawConfig:"原始配置",rawConfigHint:"此资源的 JSON 配置",create:"创建{{type}}",createTitle:"创建{{type}}",createDescription:"创建一个空的{{type}}配置。创建后可编辑。",confirmDelete:"确定要删除此{{type}}吗?",empty:"暂无{{type}}资源。",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 个项目",count_one:"{{count}} 个资源",count_other:"{{count}} 个资源",types:{rules:{name:"行为规则",description:"定义会话流程规则和决策逻辑"},apicalls:{name:"HTTP 调用",description:"配置外部 API 集成和 Webhook"},output:{name:"输出集",description:"管理响应模板和输出变体"},dictionary:{name:"词典",description:"定义词语和短语识别模式"},llm:{name:"LLM",description:"配置 AI 模型、Prompt 和工具绑定"},propertysetter:{name:"属性设置器",description:"设置会话属性和管理 Slot 填充"},mcpcalls:{name:"MCP 调用",description:"配置 MCP 服务器连接和确定性工具调用"},rag:{name:"知识库",description:"配置 RAG 知识库以进行文档检索"},snippets:{name:"提示词片段",description:"Reusable system prompt building blocks"}},emptyDescription:"创建您的第一个 {{type}} 以在 Workflow 中使用。"},X_t={formTab:"表单",jsonTab:"JSON",save:"保存",discard:"放弃",saving:"保存中...",saved:"保存成功",saveError:"保存失败",dirty:"未保存的更改",version:"版本",versionPicker:"选择版本",readOnly:"只读",formPlaceholder:"可视化编辑器即将推出。请使用 JSON 标签页编辑。",jsonSchema:"Schema 验证已启用",cascadeMode:"更改将级联到父 Workflow 和 Agent",usedInAgents:"在 {{count}} 个 Agent 中使用",updateUsageHint:"将选中的 Workflows 和 Agents 更新到新版本?",updateUsage:"更新所选",skipUpdate:"跳过",cascading:"更新中...",cascadeSuccess:"级联更新完成",invalidJson:"JSON 无效 — 切换到 JSON 标签页修复。"},Z_t={appendActions:"附加操作",expressionsAsActions:"表达式作为操作",groups:"行为组",addGroup:"添加组",groupName:"组名称",executionStrategy:"执行策略",rules:"规则",addRule:"添加规则",ruleName:"规则名称",actions:"操作",noActions:"无操作",addAction:"添加",actionPlaceholder:"例如 greet, get_weather",conditions:"条件",addCondition:"添加条件",conditionType:"条件类型",nestedConditions:"嵌套条件",configKey:"键",configValue:"值",addConfig:"添加配置",removeRule:"移除规则",removeGroup:"移除组",removeCondition:"移除条件",noGroups:"未定义行为组",noRules:"此组中没有规则",noConditions:"无条件"},J_t={targetServerUrl:"目标服务器 URL",targetServerUrlPlaceholder:"https://api.example.com",calls:"HTTP 调用",addCall:"添加 HTTP 调用",callName:"调用名称",callDescription:"描述",descriptionPlaceholder:"为 LLM Agent 提供的自然语言描述",request:"请求",method:"方法",path:"路径",pathPlaceholder:"/api/endpoint",headers:"请求头",addHeader:"添加 Header",queryParams:"查询参数",addQueryParam:"添加参数",contentType:"内容类型",body:"请求体",bodyPlaceholder:"JSON 请求体模板...",parameters:"参数(用于 LLM Agent)",paramName:"参数名称",paramDescription:"描述",addParam:"添加参数",options:"选项",saveResponse:"保存响应",responseObjectName:"响应对象名称",responseHeaderObjectName:"响应 Header 对象名称",fireAndForget:"发送后不等待",batchCalls:"批量调用",iterationObjectName:"迭代对象名称",prePostInstructions:"前置/后置指令",preRequest:"请求前",postResponse:"响应后",removeCall:"移除调用",noCalls:"未配置 HTTP 调用",actions:"触发操作",noActions:"无操作",actionPlaceholder:"例如 get_weather"},e0t={tasks:"LLM 任务",addTask:"添加任务",noTasks:"未配置 LangChain 任务",removeTask:"移除任务",taskId:"任务 ID",description:"描述",descriptionPlaceholder:"此任务的功能",triggerActions:"触发操作",noActions:"无操作",actionPlaceholder:"例如 help, chat",systemPrompt:"系统提示",systemPromptPlaceholder:"你是一个有帮助的助手...",modelParams:"模型参数",addParam:"添加参数",agentMode:"代理模式",enableBuiltInTools:"启用内置工具",toolWhitelist:"工具白名单(空 = 全部)",enableHttpCallTools:"自动发现 HTTP Call 工具",enableHttpCallToolsDesc:"自动将 Workflow 中的所有 httpcall 扩展暴露为 LLM 工具",httpCallTools:"HTTP调用工具URI",httpCallToolsHint:"显式 httpcall URIs(在自动发现之外)",addTool:"添加工具 URI",mcpServers:"MCP 服务器",mcpServersDesc:"外部 MCP 服务器,其工具可供 LLM 使用",addMcpServer:"添加 MCP 服务器",mcpUrlPlaceholder:"http://localhost:7070/mcp",mcpName:"名称",mcpApiKey:"API Key / Vault 引用",historyLimit:"历史记录限制",historyLimitHint:"(-1 = 无限)",budgetPerf:"预算与性能",maxBudget:"最大预算 ($)",costTracking:"成本跟踪",toolCaching:"工具缓存",rateLimiting:"速率限制",defaultRate:"默认速率(请求/分钟)",prePostInstructions:"前置/后置指令",preRequest:"请求前",postResponse:"响应后",enableMcpCallTools:"自动发现 MCP 工具",enableMcpCallToolsDesc:"自动将工作流中的所有 mcpcalls 扩展公开为 LLM 工具",a2aAgents:"A2A 代理",a2aAgentsDesc:"远程 A2A 兼容代理,其技能成为 LLM 工具",addA2aAgent:"添加 A2A 代理",a2aUrlPlaceholder:"https://remote.example.com/a2a/agents/...",a2aName:"显示名称",a2aApiKey:"${vault:my-a2a-key}",a2aTimeout:"超时 (毫秒)",a2aSkillsFilter:"技能过滤 (空 = 全部)",cascade:"模型级联",cascadeDesc:"Try a cheap/fast model first. If confidence is too low, automatically escalate to a more powerful (and expensive) model.",cascadeEnable:"启用模型级联",cascadeStrategy:"策略",strategyCascade:"逐级升级",strategyParallel:"并行(未来)",cascadeStrategyHint:"先尝试低成本模型,置信度不足时升级",cascadeEvalStrategy:"置信度评估",cascadeEvalHint:"如何判断响应是否足够好",evalStructured:"结构化输出 (JSON)",evalHeuristic:"启发式(犹豫检测)",evalJudge:"裁判模型(辅助 LLM)",evalNone:"无(始终接受)",cascadeInAgent:"在代理模式(含工具)中也使用级联",cascadeSteps:"Cascade Steps",cascadeStepsDesc:"Order matters: first step tried first. Last step is always accepted.",cascadeModelName:"例如 claude-sonnet-4-6",cascadeConfidence:"Min. Confidence (0-1)",cascadeConfidencePlaceholder:"空 = 始终接受",cascadeTimeout:"超时 (毫秒)",addCascadeStep:"添加级联步骤",parallelExecution:"并行工具执行",parallelExecutionDesc:"Run independent tool calls concurrently",parallelTimeout:"超时 (毫秒)",maxToolIterations:"最大工具迭代次数",maxToolIterationsHint:"(默认 10)",toolRateLimits:"单工具速率限制",toolRateLimitsDesc:"Override default rate for specific tools",toolName:"工具名称",addToolRate:"添加速率限制",retryConfig:"重试配置",retryDesc:"Configure automatic retries with exponential backoff.",retryMaxAttempts:"最大尝试次数",retryDelay:"初始延迟 (毫秒)",retryMultiplier:"退避倍数",retryMaxDelay:"最大延迟 (毫秒)",ragConfig:"RAG(知识检索)",ragDesc:"Augment LLM responses with retrieved documents.",ragHttpCall:"HTTP 调用 URI",ragEmbeddingModel:"嵌入模型",ragEmbeddingModelPlaceholder:"例如 text-embedding-3-small",ragEmbeddingStore:"嵌入存储",ragEmbeddingStorePlaceholder:"例如 pgvector, qdrant",ragMaxResults:"最大结果数",ragMinScore:"Min Similarity Score (0-1)",moveDown:"下移",moveUp:"上移",execution:"执行",budgetCosts:"预算与成本",preRequestDesc:"在 LLM 执行前设置或转换属性。",postResponseDesc:"处理 LLM 输出:设置属性、构建输出消息和生成快速回复。",postPropertyInstructions:"属性指令",postOutputInstructions:"输出构建指令",postQrInstructions:"快速回复构建指令",allSkills:"全部技能",skillPlaceholder:"例如 order-tracking",modeAgent:"代理",modeChat:"聊天",perMinute:"/分钟",allTools:"全部工具",selectSpecific:"手动选择",allToolsInfo:"所有 {{count}} 个内置工具对 LLM 可用。选择「手动选择」来限制公开的工具。",availableTools:"可用工具",toolCount:"已选 {{selected}}/{{total}}",toolSources:"工作流工具来源",toolSourcesInfo:"默认启用两种来源 — 所有工作流 HTTP 调用和 MCP 调用自动公开为 LLM 工具。禁用某来源以排除。",included:"已包含"},t0t={language:"语言",langPlaceholder:"例如 en, zh",outputSets:"输出集",addOutputSet:"添加输出集",noOutputSets:"未配置输出集",actionName:"操作名称",timesOccurred:"×",removeOutput:"移除",outputs:"输出",alternativeGroup:"备选组",addAlternative:"添加备选",addOutputGroup:"添加输出组",textPlaceholder:"输出文本...",urlPlaceholder:"URL…",delayMs:"延迟(毫秒)",quickReplies:"快捷回复",noQuickReplies:"无 Quick Replies",addQuickReply:"添加 Quick Reply",qrValue:"按钮文本",qrExpressions:"表达式",default:"默认"},n0t={setters:"属性设置器",addSetter:"添加 Setter",noSetters:"未配置 Property Setters",removeSetter:"移除",triggerActions:"触发操作",noActions:"无操作",actionPlaceholder:"例如 greet, fallback",properties:"属性",noProperties:"无属性",addProperty:"添加属性",propName:"属性名称",propValue:"值 / 表达式",fromPath:"源路径",fromObjectPath:"fromObjectPath",override:"覆盖",propsCount:"属性",untitled:"(无操作)"},i0t={language:"语言",langPlaceholder:"例如 en, zh",words:"词语",addWord:"添加词语",wordPlaceholder:"例如 你好",phrases:"短语",addPhrase:"添加短语",phrasePlaceholder:"例如 早上好",regExs:"正则表达式",addRegEx:"添加正则表达式",regexPlaceholder:"正则表达式",expressionPlaceholder:"例如 greeting(hello)",frequency:"频率",none:"未定义"},s0t={title:"协调器仪表盘",subtitle:"监控会话处理并管理 Dead-Letter 条目",type:"Coordinator 类型",connection:"连接",processed:"已处理任务",deadLettered:"死信",activeQueues:"活跃队列",queued:"排队中",deadLetterTitle:"死信队列",noDeadLetters:"无 Dead-Letter 条目",colId:"ID",colConversation:"对话",colError:"错误",colTime:"时间",colActions:"操作",replay:"重放",discard:"丢弃",purgeAll:"全部清除",confirmPurge:"确定全部清除?",yes:"是",cancel:"取消",replaySuccess:"Dead-Letter 已重放",replayError:"重放失败",discardSuccess:"Dead-Letter 已丢弃",discardError:"丢弃失败",purgeSuccess:"已清除所有 Dead-Letter 条目",purgeError:"清除失败",empty:"没有可用的 Coordinator 数据",emptyHint:"Coordinator 服务可能仍在启动中,数据将自动出现。"},r0t={expand:"展开",expandHint:"全屏 (Ctrl+Shift+F)",close:"完成",lines:"行",chars:"字符",fullscreenTitle:"内容编辑器",fullscreenDescription:"全屏编辑器。按 Escape 关闭。"},o0t={title:"日志",description:"实时监控日志流或搜索历史日志。",tabLive:"实时",tabHistory:"历史",connected:"已连接",disconnected:"已断开",filterAgent:"代理 ID…",filterConversation:"会话 ID...",filterInstance:"实例 ID...",allLevels:"全部级别",pause:"暂停",resume:"继续",clear:"清除",search:"搜索",waitingForLogs:"等待日志...",connectingStream:"正在连接流...",noHistoryLogs:"未找到历史日志。",entryCount:"{{count}} 条记录",showStacktrace:"显示堆栈跟踪({{count}} 帧)",hideStacktrace:"隐藏堆栈跟踪",allAgents:"全部代理",allConversations:"全部对话",waitingHint:"日志将在从后端流式传输时显示在此处。",noHistoryHint:"尝试调整过滤器或搜索不同的 Agent 或对话。",searchConversations:"按ID、代理、用户搜索…",stepsCount:"{{count}} 步骤",noConversationsFound:"未找到对话",useConversationId:"使用ID: {{id}}",searchLogs:"搜索日志…",errors:"错误",warnings:"警告",infos:"信息",debugs:"调试",filteredCount:"{{shown}} / {{total}} 条",copyEntry:"复制日志条目",export:"导出",stateReady:"就绪",stateActive:"活跃",stateError:"错误",stateEnded:"已结束"},a0t={title:"密钥库",description:"管理 Vault 中的加密 Secrets。值不会被泄露。",tenantId:"租户 ID",refresh:"加载 Secrets",create:"添加 Secret",createTitle:"添加 Secret",keyName:"密钥名称",keyNameLabel:"密钥名称",keyNamePlaceholder:"例如 apiKey, dbPassword",valueLabel:"Secret 值",valuePlaceholder:"输入 Secret 值…",storeWarning:"值将被加密,存储后无法检索。",store:"存储 Secret",storeSuccess:'Secret "{{key}}" 已存储',deleteSuccess:'Secret "{{key}}" 已删除',created:"创建时间",lastAccessed:"最后访问",checksum:"校验和",actions:"操作",confirmDeleteTitle:"删除 Secret",confirmDeleteMessage:'确定要永久删除 "{{key}}" 吗?此操作无法撤销。',empty:"未找到 Secrets",emptyHint:"创建一个 Secret 或更改上方的命名空间筛选器。",vaultUp:"Vault 在线",vaultDown:"Vault 离线",descriptionLabel:"描述(可选)",descriptionPlaceholder:"例如 生产环境的 OpenAI API 密钥",descriptionCol:"描述",reference:"引用",willUseRef:"引用:",copyRef:"复制金钥引用",refCopied:"已复制: {{ref}}",lastRotated:"最后轮换",scopeExplanation:"密钥在租户级别内有效,所有智能体均可访问。配置中通过 ${vault:keyName} 引用。访问权限由编写配置的人控制。",creatingFor:"存储在租户“{{tenant}}”中 — 对所有智能体可见",vaultNotConfigured:"密钥保险库尚未配置",viewDocs:"查看文档",selectAgentFirst:"请先选定一个智能体",tableTitle:"租户“{{tenant}}”内有 {{count}} 个密钥"},l0t={title:"审计日志",description:"浏览不可变审计账本,用于合规和调试。",byConversation:"按会话",byAgent:"按 Agent",conversationIdPlaceholder:"输入会话 ID...",agentIdPlaceholder:"输入 Agent ID...",versionPlaceholder:"版本(可选)",search:"搜索",entries:"条记录",totalDuration:"总计",totalCost:"总成本",step:"步骤",tasks:"任务",input:"输入",output:"输出",llmDetail:"LLM 详情",toolCalls:"工具调用",hmacIntegrity:"HMAC 完整性已验证",empty:"搜索审计记录",emptyHint:"在上方输入会话或 Agent ID 以浏览审计日志。",noResults:"未找到审计记录",noResultsHint:"尝试其他 ID 或检查会话是否已处理。",loadMore:"加载更多",selectAgent:"Select an agent…",conversations:"conversations",emptyAgent:"Select an agent to view its audit trail",emptyAgentHint:"Choose a deployed agent from the dropdown above to see all its audit records.",export:"Export",autoRefreshToggle:"Toggle auto-refresh (every 10s)",autoRefreshOn:"Auto",autoRefreshOff:"Auto",integrityVerified:"All entries cryptographically signed",integrityVerifiedDesc:"{{count}} of {{total}} entries have HMAC-SHA256 signatures",integrityPass:"SIGNED",integrityPartial:"Partially signed audit trail",integrityPartialDesc:"{{count}} of {{total}} entries have HMAC signatures",integrityNone:"Unsigned audit entries",integrityNoneDesc:"Configure a vault master key to enable automatic HMAC-SHA256 signing on all future audit entries.",signed:"Signed",allSigned:"All signed"},c0t={title:"定时任务",subtitle:"管理 Agent 定时触发器 — Cron 和 Heartbeats",create:"创建定时任务",createTitle:"创建定时任务",createSuccess:"定时任务创建成功",createError:"定时任务创建失败",creating:"创建中...",name:"名称",namePlaceholder:"例如:每日健康检查",triggerType:"触发器类型",cronExpression:"Cron 表达式",interval:"间隔(秒)",agentId:"Agent ID",agentIdPlaceholder:"输入 Agent ID...",environment:"环境",message:"消息",messagePlaceholder:"发送给 Agent 的消息",conversationStrategy:"会话策略",total:"总定时任务",active:"活跃",failedCount:"失败 / Dead-Lettered",nextFireLabel:"下次执行",tableTitle:"所有定时任务",empty:"暂无定时任务",emptyHint:"创建定时任务以自动化 Agent 触发器。",colName:"名称",colType:"类型",colSchedule:"定时",colAgent:"智能体",colStatus:"状态",colNextFire:"下次执行",colLastFired:"上次执行",colActions:"操作",enable:"启用",disable:"禁用",enabled:"定时任务已启用",disabled:"定时任务已禁用",toggleError:"切换定时任务失败",fireNow:"立即执行",fired:"定时任务执行成功",fireError:"执行失败",retry:"重试",retrySuccess:"定时任务已重新入队",retryError:"重试失败",deleteSuccess:"定时任务已删除",deleteError:"定时任务删除失败",fireHistory:"执行历史"},d0t={title:"调试",tabPipeline:"流水线",tabCosts:"成本",tabMemory:"记忆",tabLogs:"日志",tabPrompt:"提示词",turn:"轮次",latest:"最新",noPipeline:"发送消息以查看流水线追踪",processing:"处理中...",actions:"操作",confidence:"置信度",duration:"耗时"},u0t={thisTurn:"本次",conversationTotal:"会话总计",tokens:"Tokens",cost:"成本",duration:"耗时",model:"模型",toolCalls:"工具调用",toolUsage:"工具使用",cacheStats:"缓存",hitRate:"命中率",empty:"发送消息以查看成本指标",in:"输入",out:"输出",total:"总计",calls:"次"},h0t={title:"会话记忆",noConversation:"开始对话以检查记忆",empty:"无记忆数据",properties:"属性",step:"步骤",keys:"键",input:"输入"},g0t={noAgent:"选择一个智能体以查看日志",search:"搜索...",pause:"暂停",resume:"恢复",clear:"清除",waiting:"等待日志...",connected:"已连接",disconnected:"已断开",logOutput:"日志输出"},f0t={noConversation:"开始对话以检查提示词",noLlm:"尚未发现LLM交互",turn:"轮次",latest:"最新",tokens:"Tokens",model:"模型",cost:"成本",copy:"复制提示词",copied:"已复制!",replay:"重播此轮次",toolCalls:"工具调用",step:"步骤",roleSystem:"系统提示词",roleUser:"用户",roleAssistant:"助手",roleTool:"工具结果"},p0t={preview:"预览",edit:"编辑",switchToPreview:"预览解析后的提示",switchToEdit:"切换到编辑",refresh:"刷新",sampleData:"示例数据(无对话)",disclaimerReal:"预览使用 Qute 引擎处理真实对话数据。",disclaimerSample:"预览使用 Qute 引擎处理示例数据。选择一个对话查看真实值。",resolvedPrompt:"解析后的提示",copy:"复制",copied:"已复制!",error:"模板解析错误",loading:"正在解析模板…",availableVariables:"可用变量",copyVariable:"点击复制变量引用",varProperties:"属性",varMemory:"记忆",varContext:"上下文",varSnippets:"片段",varUserInfo:"用户信息",varConversationInfo:"对话信息",varInput:"输入",varConversationLog:"对话日志"},m0t={title:"智能体工作室",subtitle:"在一个工作区内构建、测试和调试您的智能体",pipeline:"流水线",editor:"编辑器",debug:"调试与聊天",selectStage:"点击流水线阶段以打开编辑器",openInStudio:"在工作室中打开",loading:"加载智能体...",notFound:"未找到智能体",hideChat:"隐藏聊天",showChat:"显示聊天",openEditor:"在编辑器中打开",editorComingSoon:"集成编辑器即将推出",noPipeline:"暂无流水线阶段",type:{parser:"解析器",rules:"规则",property:"属性设置器",apicalls:"API调用",llm:"LLM",output:"输出","output.template":"输出模板",mcpcalls:"MCP调用",rag:"知识库",dictionary:"词典"},landingDescription:"选择一个代理以打开可视化管道编辑器、调试器和实时聊天",noAgents:"未找到代理 — 在代理页面创建一个",chat:"聊天",backToAgent:"返回代理详情",selectStageHint:"选择管道中的任意扩展以内联查看和编辑其配置",noConfig:"此管道阶段无配置 URI",unsupportedType:"此扩展类型暂无编辑器"},b0t={general:"常规",kbName:"知识库名称",kbNamePlaceholder:"例如: 产品文档,FAQ,内部Wiki",kbNameHint:"用于在LLM任务中引用此知识库",embeddingModel:"嵌入模型",provider:"提供商",embeddingParams:"提供商参数",embeddingParamsHint:"模型名称,API密钥(使用 ${vault:...} 引用密钥),基础URL等",vectorStore:"向量存储",storeType:"存储类型",storeParams:"连接参数",chunking:"文档分块",chunkStrategy:"策略",chunkSize:"分块大小",chunkOverlap:"重叠大小",overlapHint:"重叠有助于保持分块间的上下文",chunkPreview:"预览(文档如何分块)",chunkBlocks:"{{count}} 个分块,约 {{size}} 字符,{{overlap}} 重叠",retrievalDefaults:"检索默认值",retrievalHint:"这些默认值可在LLM配置的任务中被覆盖。",maxResults:"最大结果数(Top-K)",minScore:"最小相似度分数",ingestion:"文档摄入",dropFiles:"将文档拖放到此处进行摄入",dropHint:"文本,Markdown或任何基于文本的文件",browse:"浏览",pasteText:"或粘贴文本内容",pastePlaceholder:"在此粘贴文档文本...",ingestText:"摄入文本",ingestionHistory:"摄入状态",saveFirstIngestion:"使用前请先保存此知识库。",addParam:"添加参数"},x0t={welcome:{title:"欢迎使用 EDDI",subtitle:"您的AI智能体指挥中心",introText:"EDDI Manager是您构建、测试和运行对话式AI智能体的指挥中心。",capabilitiesTitle:"您可以做什么",capabilitiesSubtitle:"一切生产级智能体所需的功能",buildAgents:"构建智能体",buildAgentsDesc:"使用向导或从头创建并配置AI智能体",designWorkflows:"设计工作流",designWorkflowsDesc:"利用拖拽式的行为规则、LLM链和工具构建流水线",testRealtime:"实时测试",testRealtimeDesc:"与您的智能体对话,支持流式响应及内置调试",monitorOperate:"监控与运维",monitorOperateDesc:"会话、审计追踪、密钥管理和配额等一站式服务",readyTitle:"准备好了吗?",readySubtitle:"您可以随时从侧边栏的帮助菜单重新启动导览",startTour:"开始导览",exploreOwn:"我要自己探索"},tour:{back:"上一步",next:"下一步",skip:"跳过导览",finish:"完成",stepOf:"第 {{current}} 步,共 {{total}} 步",dashboard:{title:"仪表板导览",step1Title:"您的指挥中心",step1Desc:"侧边栏按照管理、开发和运营三大区域划分,让您随时能找到所需功能。",step2Title:"平台概览",step2Desc:"实时统计您的智能体、工作流和会话数,点击卡片直接跳转。",step3Title:"快捷操作",step3Desc:"直接进入常用功能。智能体向导是创建首个智能体最快的方式,只需不到2分钟。",step4Title:"个性化设置",step4Desc:"在浅色、深色和系统主题间切换。EDDI Manager 支持11种语言,选择最适合您的语言。"},agents:{title:"智能体导览",step1Title:"智能体向导",step1Desc:"向导将引导您创建完整的配置:选择模型、设置人设、启用工具并部署。",step2Title:"手动创建",step2Desc:"面向高级用户:创建一个空白智能体,允许完全通过 JSON 控制的高级设置。",step3Title:"搜索与过滤",step3Desc:"通过名称快速找到智能体。使用右上角按钮在卡片与列表视图间切换。",step4Title:"您的智能体舰队",step4Desc:"每张卡片显示智能体的名称、版本和最后修改时间。点击进入详情页进行部署、聊天及工作流控制。"},workflows:{title:"工作流导览",step1Title:"创建工作流",step1Desc:"工作流定义了处理流水线,这是一种包含 LLM 调用、行为规则及 HTTP 集成等任务的序列。",step2Title:"您的工作流",step2Desc:"每个工作流都可以附加到一个或多个智能体。点击打开可拖拽流水线编辑器。",step3Title:"组织您的视图",step3Desc:"按名称搜索,在卡片网格模型与可排序的表格模型间切换查阅。"},chat:{title:"聊天导览",step1Title:"选择一个智能体",step1Desc:"选择一个已部署的智能体开始会话,只有已部署状态的才显示在这里。",step2Title:"流式模式",step2Desc:"切换实时 Token 流式响应。启用后,智能体的回复将逐字出现,非常适合延迟调试。",step3Title:"会话历史",step3Desc:"打开侧边栏可浏览和恢复早期的会话进程。",step4Title:"开始聊天",step4Desc:"输入消息并按回车。系统会运用您所配置的工作流、工具及 LLM 进行回复。"},channels:{title:"频道",subtitle:"将代理和群组连接到 Slack 等消息平台"},resources:{title:"资源导览",step1Title:"插件库",step1Desc:"资源是工作流的构建块。每种类型的资源控制着智能体不同的行为逻辑。",step2Title:"LLM 配置",step2Desc:"定义为您的智能体提供驱动力的 AI 模型,包含系统提示词、工具连结、MCP 服务器及级联设置等。这是智能体的大脑。",step3Title:"规则与 API 调用",step3Desc:"行为规则可以控制对话流。HTTP 调用用以连接外部 API,两者均可作为工具供 LLM 采用。"},conversations:{title:"会话导览",step1Title:"搜查与搜索",step1Desc:"通过 ID、智能体名称或者最近用户消息来快速找到历史会话内容。",step2Title:"状态过滤",step2Desc:"按照状态筛选所有会话: 激活中、处理中、已结束 或 发生出错 的交谈。",step3Title:"会话列表",step3Desc:"浏览所有的聊天记录。点击任一会话即可进入详细时间轴及除错除患功能区。"},groups:{title:"讨论组导览",step1Title:"创建讨论组",step1Desc:"创建集成的聊天环境来使多个智能体彼此合作、互相提供辅助和辩论。",step2Title:"搜索讨论组",step2Desc:"搜索和查看所有群聊集群配置。",step3Title:"全局控制",step3Desc:"管控不同的群体配置环境、删除闲置组件。"},logs:{title:"系统日志导览",step1Title:"实时与历史",step1Desc:"平台提供系统日志实时数据流展示与存储索引后的历史探查手段切换。",step2Title:"数据流过滤",step2Desc:"针对日志的源智能体、关键错误级别对传入数据进行限制。",step3Title:"导出",step3Desc:"将已过滤的报告快速下载下来以方便线下追根朔源。"},secrets:{title:"密钥库导览",step1Title:"创建密钥",step1Desc:"在安全存储上定义一个新的API钥匙请求信物或密码口令,方便各级 Agent 直接调用。",step2Title:"租户隔离",step2Desc:"为确保不同的用户租户具备权限和专属区域可见,请确认隔离状态。",step3Title:"引用语法",step3Desc:"了解如何通过 `${vault:xxx}` 指令在配置项中动态注入加密密码且而不留显式痕迹。"},audit:{title:"审计账本导览",step1Title:"搜索模式",step1Desc:"按照特定的会话ID或通过代理环境调取不可更改的全局核查资料库。",step2Title:"执行检索",step2Desc:"输入ID指令检索系统过去留存的已证实工作日志纪录。",step3Title:"账本导出",step3Desc:"针对所有的资料证据生成JSON以备核查并上交安检查证。"},schedules:{title:"定时任务导览",step1Title:"创建定时任务",step1Desc:"建立新的 Cron 或定期触发机制让后台智能体开始自动工作流指令运行。",step2Title:"运行统计",step2Desc:"监督并把握当前全局任务激活数、异常数或成功数。",step3Title:"调度管理",step3Desc:"在界面上原生处理所有配置触发任务:暂停、重新执行并模拟检验。"},quotas:{title:"配额导览",step1Title:"硬性限制配置",step1Desc:"对每个租户指定最大的每日限制、请求、智能体数和财务上限阈值,以保持安全性。",step2Title:"使用分析",step2Desc:"监控当前的云端利用数据率及耗损数量实时评估。",step3Title:"强制生效",step3Desc:"所有的限制设定将被记录,任何突破此线的功能平台系统立刻实行截停。"},coordinator:{title:"协调器导览",step1Title:"实时连接",step1Desc:"监控与服务器节点连接的后端协调器心跳(Heartbeat)。",step2Title:"队列处理",step2Desc:"在集群范围中查看任务执行及实时等待处理的工作指令包流转情况。",step3Title:"死信队列",step3Desc:"检查故障任务并重新提交,将崩溃系统隔离控制住稳定安全环境。"},orphans:{title:"无主孤儿对象导览",step1Title:"扫描触发点",step1Desc:"平台启动数据表结构扫描,在寻找任何失效的无来源游离配置数据和文件。",step2Title:"包含历史废弃",step2Desc:"可选在整理历史的记录包含已经被实施“软删除(Soft Deleted)”的非必需关联对象。",step3Title:"清理确认 (Purge)",step3Desc:"审查确认系统清扫单最后勾连所有垃圾对象实施完全根除腾位数据库物理硬盘保留空缺。"}},help:{title:"帮助与导览",platformTour:"平台导览",resetAll:"重置所有导览进度",resetConfirm:"您确定要重置所有导览进度吗?"},offer:{message:"初次来到这里?花点时间看看:{{page}}",accept:"立即查看",dontAsk:"不再提示"}},v0t={status:"平台状态",online:"在线",offline:"离线",checking:"检查连接…",connected:"已连接",disconnected:"已断开",instance:"实例",latency:"延迟",lastChecked:"上次检查",justNow:"刚刚",secondsAgo:"{{count}}秒前"},_0t={live:"实时",reconnecting:"重新连接中…"},y0t={title:"新 {{type}}",newAgent:"新建智能体",newGroup:"新建组",quickCreate:"快速创建",quickCreateTitle:"快速创建 {{type}}",quickCreateDesc:"定义名称和描述,稍后配置详细信息。",guidedSetup:"配置向导",guidedSetupDesc:"使用分步向导设置LLM模型、提示词及默认规则。"},w0t={empty:"暂无群组",emptyDescription:"群组允许多个 Agent 在结构化讨论中协作。",createGroup:"创建群组",unnamed:"未命名群组",count_one:"{{count}} 个群组",count_other:"{{count}} 个群组",confirmDelete:"删除此群组?",confirmDeleteDesc:"群组配置将被永久删除。",duplicateSuccess:"群组已复制",noDescription:"No description",members:"members",discussionStyle:"Discussion Style",maxRounds:"Max Rounds"},C0t={title:"用户记忆",subtitle:"浏览和管理代理存储的持久化用户记忆",userIdPlaceholder:"输入用户 ID…",searchPlaceholder:"搜索记忆…",enterUserId:"输入用户 ID 以浏览其记忆",totalEntries:"总条目数",preferences:"偏好",facts:"事实",conflicts:"冲突",cat_all:"全部",cat_preference:"偏好",cat_fact:"事实",cat_context:"上下文",deleteAll:"全部删除",deleteAllTitle:"删除所有记忆",deleteAllDesc:"将永久删除该用户的所有记忆条目,此操作不可撤销。",deleteAllConfirm:"全部删除",entryDeleted:"记忆条目已删除",allDeleted:"该用户的所有记忆已删除",noResults:"未找到记忆条目",value:"值",sourceAgent:"来源代理",accessCount:"访问次数",created:"创建时间",updated:"更新时间",sourceConversation:"来源对话",conflicted:"有冲突"},S0t={title:"用户属性",subtitle:"浏览和管理按用户存储的 longTerm 属性",userIdPlaceholder:"输入用户 ID…",searchPlaceholder:"筛选属性…",enterUserId:"输入用户 ID 以查看其属性",key:"键",type:"类型",value:"值",deleteAll:"全部删除",deleteAllTitle:"删除所有属性",deleteAllDesc:"将永久删除该用户的所有属性。",deleted:"属性已删除",noResults:"未找到属性",showingCount:"{{count}} 个属性"},k0t={title:"代理触发器",subtitle:"将意图映射到代理部署以实现自动路由",create:"新建触发器",createTitle:"创建触发器",editTitle:"编辑触发器",intent:"意图",deployments:"代理部署",addDeployment:"添加代理",agents:"个代理",empty:"尚未配置触发器",created:"触发器已创建",updated:"触发器已更新",deleted:"触发器已删除",deleteTitle:"删除触发器",deleteDesc:"确定要永久删除意图「{{intent}}」的触发器吗?",searchPlaceholder:"按意图或代理 ID 筛选…"},N0t={title:"能力发现",subtitle:"按声明的技能和能力发现代理",searchPlaceholder:"搜索技能…",strategyHighest:"最高置信度",strategyAll:"全部匹配",registeredSkills:"已注册技能",noSkills:"未找到技能",matchingAgents:"匹配的代理",noMatches:"该技能未找到匹配代理"},E0t={title:"导出智能体",loading:"正在加载资源树...",selectResources:"选择要导出的资源",required:"必填",snippets:"代码片段",allSelected:"已选择所有资源",countSelected:"已选 {{count}} / {{total}} 资源",exportSelected:"导出所选"},L0t={title:"导入智能体",dropZone:"拖放 .zip 文件到此处,或点击浏览",dropZoneHint:"导出的智能体存档 (.zip)",strategyLabel:"导入策略",createNew:"作为新智能体创建",createNewDesc:"用新ID创建一份全新副本。最适合首次导入。",mergeSync:"合并/与现有同步",mergeSyncDesc:"如果存在则更新资源。不存在则新建。",upgradeExisting:"升级现有智能体",upgradeDesc:"将资源在结构上匹配到目标智能体。最适合环境间的升级推广。",syncRemote:"从远程实例同步",syncDesc:"连接到另一个EDDI实例,并实时同步特定智能体。",importNow:"立即导入",previewChanges:"预览更改",selectTargetAgent:"选择目标智能体",upgradeTargetHint:"导入的资源将在结构上与此智能体匹配。",chooseAgent:"— 选择一个智能体 —",sourceAgent:"源智能体(远程)",targetAgent:"目标智能体(本地)",createNewTarget:"创建新智能体",resource:"资源",type:"类型",match:"匹配",action:"操作",new:"新",updated:"已更新",unchanged:"未更改",selected:"已选择",mergeNow:"导入所选",syncNow:"立即同步",upgradeNow:"立即升级",importing:"正在导入智能体...",contentIdentical:"内容一致",targetContent:"目标",sourceContent:"源"},D0t={title:"智能体同步",subtitle:"在 EDDI 实例之间同步智能体",connection:"源实例",sourceUrl:"源 EDDI 实例 URL",authToken:"授权 Token",authHint:"可选,将作为 X-Source-Authorization 请求头发送。",connect:"连接",connected:"已连接",agentsFound:"个智能体",connectionFailed:"连接失败",agentMapping:"智能体映射",previewAll:"全部预览",syncSelected:"同步所选",remote:"远程",createNew:"新建",changes:"处更改",agentsSelected:"个已选智能体",totalResources:"项资源",syncSuccess:"同步完成",syncError:"同步失败",empty:"连接到源实例以开始智能体同步。",autoMatched:"自动匹配",previewFirst:"同步前预览变更"},T0t={actionCreate:"新建",actionUpdate:"更新",actionSkip:"已是最新",actionConflict:"冲突"},I0t={title:"用户对话",subtitle:"管理意图→用户→对话绑定",lookup:"查找",intent:"意图",userId:"用户ID",agentId:"代理ID",environment:"环境",conversationId:"对话ID",binding:"活动绑定",enterBoth:"输入意图和用户ID进行搜索",notFound:"未找到绑定",create:"创建绑定",createTitle:"创建绑定",created:"绑定已创建",deleteTitle:"删除绑定",deleteDesc:'删除意图"{{intent}}"和用户"{{userId}}"的绑定?',deleted:"绑定已删除"},A0t={placeholder:"搜索页面、代理、操作…",noResults:"未找到结果。",recent:"最近",navigate:"导航",agents:"代理",actions:"快捷操作",createAgent:"创建新代理",openChat:"打开聊天",kbdNavigate:"导航",kbdSelect:"选择",kbdClose:"关闭"},R0t={title:"Group Setup Wizard",subtitle:"Assemble a team of AI advisors to discuss your questions",backToGroups:"Back to Groups",templateTitle:"Start from a template",templateDesc:"Choose a preset group configuration or start from scratch.",startBlank:"Start from Scratch",blankDesc:"Configure everything manually",configTitle:"Group Configuration",configDesc:"Name your group and choose how the agents will discuss",namePlaceholder:"e.g. Advisory Board",descPlaceholder:"What is this group for?",membersTitle:"Assemble Your Team",membersDesc:"For each seat, choose an existing agent or create a new one on the fly.",addMember:"Add Member",refreshAgents:"Refresh agent list",existingAgents:"existing agents",displayName:"Agent Name",displayNamePlaceholder:"Give this agent a name…",rolePlaceholder:"Role (e.g. Marketing, Engineering)",useExisting:"Use Existing",createNew:"Create New",selectAgent:"Select agent…",systemPrompt:"System Prompt",provider:"LLM Provider",model:"Model",apiKey:"API Key",apiKeyPlaceholder:"sk-…",createThisAgent:"Create Agent",creatingAgent:"Creating agent…",agentReady:"Agent created & deployed",agentCreated:'Agent "{{name}}" created',agentCreateFailed:"Failed to create agent: {{error}}",moderator:"Moderator",moderatorHint:"Synthesizes the discussion",addModerator:"Add Moderator",removeModerator:"Remove moderator",createModerator:"Create Moderator Agent",moderatorReady:"Moderator agent ready",moderatorCreated:"Moderator agent created",creatingModerator:"Creating moderator…",creatingSlot:"Creating {{name}}…",creatingGroup:"Creating group…",needMembers:"Add at least 2 members to proceed",reviewTitle:"Review & Create",reviewDesc:"Review your group configuration before creating.",reviewMembers:"Members",autoCreateNotice:"{{count}} agents will be auto-created when you click Create Group",autoCreateHint:"Each agent will be created and deployed automatically before the group is assembled.",unassignedWarning:"{{count}} members set to 'Use Existing' but no agent selected",unassignedHint:"These members will be skipped during discussions. Go back to assign agents.",flowPreview:"Discussion Flow",createGroup:"Create Group",created:"Group Created!",viewGroup:"Open Group",createAnother:"Create Another",success:"Group created successfully!"},M0t={advisoryBoard:"Advisory Board",advisoryBoardDesc:"A panel of expert advisors consulting on strategic decisions.",codeReview:"Code Review Panel",codeReviewDesc:"Structured code review with independent opinions, peer critique, and revision.",riskAssessment:"Risk Assessment",riskAssessmentDesc:"A panel with a devil's advocate who challenges assumptions.",forecasting:"Forecasting Panel",forecastingDesc:"Delphi-style anonymous deliberation for unbiased estimates.",proCon:"Pro/Con Debate",proConDesc:"Formal debate with pro and con teams arguing their positions.",roles:{marketingExpert:"Marketing Expert",techLead:"Tech Lead",financeDirector:"Finance Director",legalCounsel:"Legal Counsel",strategyConsultant:"Strategy Consultant",seniorEngineer:"Senior Engineer",architect:"Architect",securityReviewer:"Security Reviewer",riskAnalyst:"Risk Analyst",domainExpert:"Domain Expert",devilsAdvocate:"Devil's Advocate",analystA:"Analyst A",analystB:"Analyst B",analystC:"Analyst C",analystD:"Analyst D",proAdvocate1:"Pro Advocate 1",proAdvocate2:"Pro Advocate 2",conAdvocate1:"Con Advocate 1",conAdvocate2:"Con Advocate 2"}},P0t={agentIdPlaceholder:"处理消息的代理 ID",botToken:"机器人令牌",botTokenHint:"机器人用户 OAuth 令牌。使用保管库引用以提高安全性。",botTokenPlaceholder:"xoxb-… 或 ${vault:slack-bot-token}",channel:"频道",channelId:"Slack 频道 ID",channelIdCol:"频道 ID",channelIdHint:"右键点击 Slack 频道 → 查看频道详情 → 复制频道 ID",channelsPlural:"频道",channelType:"频道类型",confirmDelete:"删除频道?",confirmDeleteDesc:"此频道集成将被永久删除。",create:"创建频道",createTitle:"创建频道集成",defaultAgentId:"默认代理 ID",defaultTargetHint:"默认目标处理所有不匹配触发关键词的消息。创建后可添加更多目标。",empty:"暂无频道",emptyDesc:"创建频道集成以将代理连接到 Slack。",name:"名称",namePlaceholder:"例如 Engineering AI Hub",openSlackApps:"打开 Slack 应用仪表板",searchPlaceholder:"搜索频道…",signingSecret:"签名密钥",signingSecretHint:"来自您的 Slack 应用基本信息页面。",signingSecretPlaceholder:"十六进制字符串或 ${vault:slack-signing-secret}",slackSetupGuide:"Slack 设置指南",slackSetupSummary:"创建 Slack 应用,配置机器人令牌范围(app_mentions:read、chat:write、im:history、channels:history、groups:history),然后在此处粘贴凭据。",target:"目标",targets:"目标",targetsCol:"目标",type:"类型",unnamed:"未命名频道",version:"版本"},O0t={addTarget:"添加目标",addTrigger:"添加触发器…",agentId:"代理 ID",botToken:"机器人令牌",channelId:"Slack 频道 ID",cooldown:"冷却时间(秒)",general:"常规",groupId:"组 ID",isDefault:"默认",maxCost:"每日最大 $",maxDaily:"每日最大",name:"名称",observe:"观察",observeDesc:"被动监控并有选择地响应",observeKeywords:"触发关键词",observeMimeTypes:"触发 MIME 类型",observeMode:"观察模式",observeSettings:"观察模式设置",platformConfig:"平台配置",rawConfig:"原始配置",removeTarget:"移除",requiredEvents:"所需事件订阅:",requiredScopes:"所需机器人令牌范围:",setDefault:"设为默认",signingSecret:"签名密钥",targetName:"名称",targets:"消息路由目标",targetType:"类型",triggerHint:"用户输入“关键词:消息”以路由到此目标",triggerKeywords:"触发关键词",triggers:"触发器",type:"频道类型",webhookHint:"将此 URL 粘贴到您的 Slack 应用的 Event Subscriptions → Request URL 字段中。",webhookUrl:"Webhook URL"},j0t={app:R_t,auth:M_t,nav:P_t,theme:O_t,language:j_t,pages:F_t,common:B_t,agents:H_t,agentDetail:W_t,wizard:V_t,setupWizard:z_t,packages:U_t,packageDetail:$_t,packageEditor:q_t,conversations:K_t,conversationDetail:G_t,chat:Y_t,resources:Q_t,editor:X_t,rulesEditor:Z_t,apiCallsEditor:J_t,llmEditor:e0t,outputEditor:t0t,propertySetterEditor:n0t,dictionaryEditor:i0t,coordinator:s0t,contentEditor:r0t,logs:o0t,secrets:a0t,audit:l0t,schedules:c0t,debugDrawer:d0t,costDashboard:u0t,memoryInspector:h0t,logViewer:g0t,promptViewer:f0t,promptPreview:p0t,studio:m0t,ragEditor:b0t,onboarding:x0t,platform:v0t,stream:_0t,createOrWizard:y0t,groups:w0t,memories:C0t,properties:S0t,triggers:k0t,capabilities:N0t,exportDialog:E0t,importDialog:L0t,syncPage:D0t,sync:T0t,userConversations:I0t,commandPalette:A0t,groupWizard:R0t,groupTemplates:M0t,channels:P0t,channelDetail:O0t},F0t={title:"EDDI Manager",description:"แดชบอร์ดบริหารจัดการแพลตฟอร์ม AI สนทนา EDDI"},B0t={login:"เข้าสู่ระบบ",logout:"ออกจากระบบ",loading:"กำลังตรวจสอบสิทธิ์…",sessionExpired:"เซสชันหมดอายุ กรุณาเข้าสู่ระบบอีกครั้ง",profile:"โปรไฟล์",guest:"ผู้เยี่ยมชม",userMenu:"เมนูผู้ใช้"},H0t={dashboard:"แดชบอร์ด",agents:"เอเจนต์",packages:"เวิร์กโฟลว์",conversations:"บทสนทนา",coordinator:"ผู้ประสานงาน",schedules:"การกำหนดเวลา",logs:"บันทึก",orphans:"รายการกำพร้า",secrets:"ข้อมูลลับ",audit:"บันทึกการตรวจสอบ",quotas:"โควต้า",groups:"กลุ่ม",chat:"แชท",resources:"ทรัพยากร",sectionManagement:"การจัดการ",sectionDevelopment:"การพัฒนา",sectionOperations:"การดำเนินงาน",mainNavigation:"การนำทางหลัก",openMenu:"เปิดเมนูนำทาง",sectionCore:"หลัก",sectionBuild:"สร้างและทดสอบ",sectionMonitor:"ตรวจสอบ",sectionAdmin:"จัดการ",studio:"สตูดิโอ",gdpr:"ความเป็นส่วนตัว",memories:"หน่วยความจำผู้ใช้",properties:"คุณสมบัติ",triggers:"ทริกเกอร์",capabilities:"ขีดความสามารถ",sync:"ซิงค์",channels:"ช่องทาง",userConversations:"การสนทนาของผู้ใช้",userData:"ข้อมูลผู้ใช้",variables:"ตัวแปร"},W0t={light:"สว่าง",dark:"มืด",system:"ระบบ"},V0t={label:"ภาษา",en:"English",de:"Deutsch",fr:"Français",es:"Español",ar:"العربية",zh:"中文",th:"ไทย",ja:"日本語",ko:"한국어",pt:"Português",hi:"हिन्दी"},z0t={dashboard:{title:"แดชบอร์ด",subtitle:"ภาพรวมของ EDDI Agents และการสนทนา",activeAgents:"Agents ที่ใช้งานอยู่",totalWorkflows:"เวิร์กโฟลว์",totalResources:"ทรัพยากร",totalConversations:"บทสนทนา",quickActions:"การดำเนินการด่วน",recentAgents:"Agents ล่าสุด",noRecentAgents:"ยังไม่มี Agent สร้าง Agent แรกของคุณเลย!"},agents:{title:"เอเจนต์",subtitle:"จัดการ AI Agents สนทนาของคุณ"},packages:{title:"เวิร์กโฟลว์",subtitle:"กำหนดค่า Workflows และส่วนขยาย"},conversations:{title:"บทสนทนา",subtitle:"ดูและจัดการการสนทนาของ Agent"},resources:{title:"ทรัพยากร",subtitle:"จัดการกฎพฤติกรรม พจนานุกรม ชุดเอาต์พุต และอื่นๆ"},chat:{title:"แชท",subtitle:"พูดคุยกับ Agents ที่ Deploy แล้ว"},channels:{title:"ช่อง",subtitle:"เชื่อมต่อเอเจนต์และกลุ่มกับแพลตฟอร์มการส่งข้อความเช่น Slack"},groups:{title:"กลุ่ม",subtitle:"กลุ่มสนทนาหลาย Agent สำหรับการอภิปรายเชิงโครงสร้างและการทำงานร่วมกัน"}},U0t={loading:"กำลังโหลด...",error:"เกิดข้อผิดพลาด",retry:"ลองใหม่",save:"บันทึก",cancel:"ยกเลิก",delete:"ลบ",create:"สร้าง",edit:"แก้ไข",search:"ค้นหา...",noResults:"ไม่พบผลลัพธ์",duplicate:"ทำซ้ำ",close:"ปิด",skipToMain:"ข้ามไปยังเนื้อหาหลัก",opensNewTab:"เปิดในแท็บใหม่",moreActions:"การดำเนินการเพิ่มเติม",sortByName:"เรียงตามชื่อ",sortByVersion:"เรียงตามเวอร์ชัน",sortByModified:"เรียงตามวันที่แก้ไข",apply:"นำไปใช้",copied:"คัดลอกแล้ว",copy:"คัดลอก",saving:"กำลังบันทึก…",showMore:"Show More",showLess:"Show Less",copyFailed:"คัดลอกไปยังคลิปบอร์ดล้มเหลว"},$0t={deploy:"ติดตั้ง (Deploy)",undeploy:"ถอนการ Deploy",createAgent:"สร้าง Agent",createTitle:"สร้าง Agent ใหม่",name:"ชื่อ",namePlaceholder:"Agent ของฉัน",description:"คำอธิบาย",descriptionPlaceholder:"อธิบายว่า Agent นี้ทำอะไร...",empty:"ยังไม่มี Agent สร้าง Agent แรกของคุณเลย!",confirmDelete:"คุณแน่ใจหรือไม่ว่าต้องการลบ Agent นี้?",count_one:"{{count}} เอเจนต์",count_other:"{{count}} เอเจนต์",export:"ส่งออก",exporting:"กำลังส่งออก...",exportSuccess:"ส่งออก Agent สำเร็จ",import:"นำเข้า Agent",importing:"กำลังนำเข้า...",importSuccess:"นำเข้า Agent สำเร็จ",importError:"นำเข้า Agent ล้มเหลว",emptyDescription:"ใช้วิซาร์ดสร้าง Agent ที่กำหนดค่าสมบูรณ์ได้ในไม่กี่นาที",chat:"แชท",deployAndChat:"ปรับใช้และแชท",openExternalChat:"เปิดในแท็บใหม่"},q0t={title:"รายละเอียด Agent",backToAgents:"กลับไปยัง Agents",packages:"เวิร์กโฟลว์",noWorkflows:"ยังไม่ได้เพิ่ม Workflows",addWorkflow:"เพิ่ม Workflow",selectWorkflow:"เลือก Workflow ที่จะเพิ่ม",rawConfig:"การกำหนดค่าดิบ",editName:"แก้ไขชื่อ",editDescription:"แก้ไขคำอธิบาย",clickToEdit:"คลิกเพื่อแก้ไข",noDescription:"ไม่มีคำอธิบาย",duplicate:"ทำซ้ำ",duplicating:"กำลังทำซ้ำ...",duplicateSuccess:"ทำซ้ำ Agent สำเร็จ",environments:"สภาพแวดล้อม",envProduction:"ใช้งานจริง (Production)",envTest:"ทดสอบ",savingAgent:"กำลังบันทึก Agent...",savedAgent:"บันทึก Agent สำเร็จ",saveError:"บันทึก Agent ล้มเหลว",deployToEnv:"Deploy ไปยัง {{env}}",undeployFromEnv:"ถอนจาก {{env}}",openStudio:"เปิดในสตูดิโอ",maxKeyLength:"ความยาวคีย์สูงสุด",maxValueLength:"ความยาวค่าสูงสุด",maxWritesPerTurn:"เขียนสูงสุด/รอบ",dreamSchedule:"ตารางเวลา (cron)",dreamLlmProvider:"ผู้ให้บริการ LLM",dreamLlmModel:"โมเดล LLM",dreamMaxCost:"ต้นทุนสูงสุด/ครั้ง ($)",dreamPruneDays:"ลบหลัง (วัน)",dreamBatchSize:"ขนาดแบตช์",detectContradictions:"ตรวจจับความขัดแย้ง",summarizeInteractions:"สรุปการโต้ตอบ",confidenceLow:"ต่ำ",confidenceMedium:"ปานกลาง",confidenceHigh:"สูง",visibilitySelf:"ตนเอง",visibilityGlobal:"ทั่วไป",onCapEvict:"ลบรายการเก่าสุด",onCapReject:"ปฏิเสธ",recallMostRecent:"ล่าสุด",recallMostRelevant:"เกี่ยวข้องที่สุด",channels:"ตัวเชื่อมต่อช่อง",channelsDesc:"เชื่อมต่อเอเจนต์นี้กับช่อง Slack แต่ละตัวเชื่อมต่อจะกำหนดค่าแยกกันด้วยข้อมูลประจำตัวของตัวเอง รองรับการตั้งค่าหลายเวิร์กสเปซ",noChannels:"ยังไม่ได้กำหนดค่าช่อง",noChannelsDesc:"เพิ่มช่อง Slack เพื่อให้ผู้ใช้สามารถโต้ตอบกับเอเจนต์นี้จาก Slack",addSlackChannel:"เพิ่มช่อง Slack",slackChannel:"ช่อง Slack",removeChannel:"ลบช่อง",removeChannelConfirm:"ลบตัวเชื่อมต่อช่อง Slack นี้?",removeChannelDesc:"This action will permanently disconnect this channel.",channelId:"ID ช่อง",channelIdHint:"ID ช่องเริ่มต้นด้วย C ตามด้วยตัวอักษรและตัวเลขตัวพิมพ์ใหญ่",botToken:"โทเค็นบอท",botTokenPlaceholder:"xoxb-… หรือ ${vault:slack-bot-token}",botTokenHint:"โทเค็น OAuth ผู้ใช้บอท Slack ใช้การอ้างอิง vault เพื่อความปลอดภัย",signingSecret:"ซีเคร็ตลายเซ็น",signingSecretPlaceholder:"สตริงฐานสิบหกหรือ ${vault:slack-signing-secret}",signingSecretHint:"จากหน้า Basic Information ของแอป Slack ใช้การอ้างอิง vault เพื่อความปลอดภัย",groupIdOptional:"ID กลุ่ม (ไม่บังคับ)",groupIdPlaceholder:"ID การกำหนดค่ากลุ่มหลายเอเจนต์",groupIdHint:'เปิดใช้งานการสนทนาหลายเอเจนต์ "group: คำถาม" จากช่อง Slack นี้',slackSetupGuide:"คู่มือการตั้งค่า Slack",slackWebhookUrl:"URL Webhook",slackWebhookCopied:"คัดลอก URL Webhook แล้ว",slackStep1:"สร้างแอป Slack ที่ api.slack.com/apps แล้วติดตั้งในเวิร์กสเปซของคุณ",slackStep2:"คัดลอกโทเค็นบอท (xoxb-…) และซีเคร็ตลายเซ็นไปยัง vault ของ EDDI แล้วกำหนดค่าช่องด้านล่าง",slackStep3:"จากนั้นเปิดใช้งาน Event Subscriptions ในแอป Slack วาง URL Webhook ด้านบนแล้วสมัครรับ:",slackSetupNote:"สำคัญ: กำหนดค่าช่องด้านล่างก่อนเปิดใช้งาน Event Subscriptions — Slack จะส่งคำท้าทายการตรวจสอบ URL ที่ต้องกำหนดค่าซีเคร็ตลายเซ็นใน EDDI",slackRequiredScopes:"สิทธิ์โทเค็นบอทที่จำเป็น"},K0t={title:"ตัวช่วยสร้าง Agent"},G0t={title:"ตัวช่วยสร้าง Agent",subtitle:"สร้าง Agent ที่กำหนดค่าเรียบร้อยภายในไม่กี่นาที",backToAgents:"กลับไปยัง Agents",next:"ถัดไป",back:"ย้อนกลับ",createOnly:"สร้างเท่านั้น",createAndDeploy:"สร้างและ Deploy",typeTitle:"ต้องการ Agent ประเภทใด?",typeDesc:"เลือกประเภท Agent ที่ต้องการสร้าง",standardAgent:"เอเจนต์มาตรฐาน",apiAgent:"เอเจนต์ API",standardDesc:"AI สนทนาที่ขับเคลื่อนด้วย LLM พร้อมเครื่องมือ Quick Replies และการวิเคราะห์อารมณ์",apiDesc:"นำเข้ามาตรฐาน OpenAPI/Swagger เพื่อสร้าง API Agent อัตโนมัติ",infoTitle:"ตัวตน Agent",infoDesc:"ตั้งชื่อและบุคลิกให้ Agent ของคุณ",agentName:"ชื่อ Agent",namePlaceholder:"เช่น บอทบริการลูกค้า",systemPrompt:"พรอมต์ระบบ",promptPlaceholder:"คุณเป็นผู้ช่วย AI ที่เป็นประโยชน์ซึ่ง...",promptHint:"คำสั่งนี้กำหนดพฤติกรรมและการตอบสนองของ Agent",llmTitle:"การกำหนดค่า LLM",llmDesc:"เลือกโมเดล AI ที่ขับเคลื่อน Agent ของคุณ",provider:"ผู้ให้บริการ",model:"โมเดล",apiKey:"คีย์ API",baseUrl:"URL ฐาน",baseUrlPlaceholder:"URL endpoint แบบกำหนดเอง",optional:"ไม่จำเป็น",apiSpecTitle:"มาตรฐาน OpenAPI",apiSpecDesc:"ระบุมาตรฐาน OpenAPI/Swagger ของ API",specByUrl:"ลิงค์ URL",specByFile:"ไฟล์",specByPaste:"วาง",fetch:"ดึงข้อมูล",specFetched:"โหลดมาตรฐานแล้ว!",specFetchError:"ดึงมาตรฐานล้มเหลว",dropFile:"วางไฟล์ OpenAPI ที่นี่",dropHint:"รูปแบบ JSON หรือ YAML",browse:"เรียกดูไฟล์",pasteSpec:"วาง OpenAPI/Swagger JSON หรือ YAML ที่นี่...",specLoaded:"โหลดไฟล์แล้ว: {{name}}",specReady:"โหลดมาตรฐานแล้ว ({{chars}} ตัวอักษร)",apiBaseUrlLabel:"URL ฐานของ API",apiAuthLabel:"เฮดเดอร์การยืนยันตัวตน API",endpointFilter:"ตัวกรอง Endpoint",endpointFilterPlaceholder:"คั่นด้วยจุลภาค: GET /users, POST /orders",featuresTitle:"ฟีเจอร์และตัวเลือก",featuresDesc:"ปรับแต่งความสามารถของ Agent",introMessage:"ข้อความต้อนรับ",introMessageDesc:"ข้อความที่แสดงเมื่อเริ่มการสนทนา",quickReplies:"ตอบกลับด่วน",quickRepliesDesc:"LLM สร้างตัวเลือกตอบกลับที่คลิกได้",sentiment:"การวิเคราะห์อารมณ์",sentimentDesc:"ติดตามอารมณ์ ความตั้งใจ และความเร่งด่วนของผู้ใช้แบบเรียลไทม์",structuredOutput:"เอาต์พุตแบบโครงสร้าง",structuredOutputDesc:"LLM ตอบกลับด้วยออบเจกต์ JSON แทนข้อความธรรมดา",structuredOutputInfo:"เมื่อเปิดใช้งาน LLM จะตอบกลับด้วยออบเจกต์ JSON ที่มีฟิลด์โครงสร้าง จะมีการเพิ่ม JSON schema ต่อท้าย system prompt และตั้งค่าโมเดลเป็นโหมดตอบกลับ JSON",builtInTools:"เครื่องมือในตัว",builtInToolsDesc:"เปิดใช้คลังเครื่องมือในตัวของ EDDI",toolsWhitelist:"รายการที่อนุญาต (ว่าง = ทั้งหมด)",mcpServers:"เซิร์ฟเวอร์ MCP",mcpServersDesc:"เซิร์ฟเวอร์ Model Context Protocol สำหรับเครื่องมือภายนอก",autoDeploy:"ติดตั้งอัตโนมัติ",autoDeployDesc:"Deploy Agent ทันทีหลังจากสร้าง",environment:"สภาพแวดล้อม",envProduction:"ใช้งานจริง",envTest:"ทดสอบ",reviewTitle:"ตรวจสอบและสร้าง",reviewDesc:"ตรวจสอบการกำหนดค่าก่อนสร้าง",reviewType:"ชนิด",reviewName:"ชื่อ",reviewPrompt:"พรอมต์ระบบ",reviewProvider:"ผู้ให้บริการ",reviewModel:"โมเดล",reviewSpec:"OpenAPI Spec",reviewIntro:"ข้อความต้อนรับ",reviewDeploy:"ติดตั้ง",success:"สร้าง Agent สำเร็จ!",agentCreated:"สร้าง Agent แล้ว!",deployed:"Deploy แล้ว",endpointsParsed:"วิเคราะห์ {{count}} API endpoints แล้ว",viewAgent:"ดู Agent",createAnother:"สร้างอีก",allTools:"เครื่องมือทั้งหมด",selectSpecific:"เลือกเฉพาะ",allToolsInfo:"เครื่องมือในตัวทั้ง {{count}} ชิ้นจะพร้อมใช้งานสำหรับเอเจนต์ของคุณ เลือก「เลือกเฉพาะ」เพื่อจำกัดเครื่องมือที่เปิดใช้งาน",availableTools:"เครื่องมือที่พร้อมใช้งาน",toolCount:"เลือก {{selected}} จาก {{total}}"},Y0t={createWorkflow:"สร้าง Workflow",createTitle:"สร้าง Workflow ใหม่",name:"ชื่อ",namePlaceholder:"Workflow ของฉัน",description:"คำอธิบาย",descriptionPlaceholder:"อธิบายว่า Workflow นี้ทำอะไร...",noDescription:"ไม่มีคำอธิบาย",empty:"ยังไม่มี Workflow สร้าง Workflow แรกของคุณเลย!",confirmDelete:"คุณแน่ใจหรือไม่ว่าต้องการลบ Workflow นี้?",count_one:"{{count}} เวิร์กโฟลว์",count_other:"{{count}} เวิร์กโฟลว์",emptyDescription:"Workflow กำหนด Pipeline การประมวลผลสำหรับ Agent ของคุณ"},Q0t={title:"รายละเอียด Workflow",backToWorkflows:"กลับไปยัง Workflows",extensions:"ส่วนขยาย",noExtensions:"ไม่มีส่วนขยายใน Workflow นี้",rawConfig:"การกำหนดค่าดิบ"},X0t={title:"ตัวแก้ไข Workflow",pipeline:"Pipeline ส่วนขยาย",addHint:"เพิ่มส่วนขยายเพื่อสร้าง Pipeline การประมวลผล",addHintDialog:"เลือกประเภทส่วนขยายที่จะเพิ่ม",reorder:"จัดลำดับส่วนขยาย",saved:"บันทึก Workflow สำเร็จ",saveError:"บันทึก Workflow ล้มเหลว",noTasks:"[EN] No tasks in this workflow",addTask:"[EN] Add Task"},Z0t={searchPlaceholder:"ค้นหาด้วย ID การสนทนา...",id:"บทสนทนา",agent:"เอเจนต์",state:"สถานะ",lastActivity:"กิจกรรมล่าสุด",actions:"การทำงาน",empty:"ยังไม่มีการสนทนา Deploy Agent และเริ่มแชทเลย!",confirmDelete:"คุณแน่ใจหรือไม่ว่าต้องการลบการสนทนานี้?",count_one:"{{count}} บทสนทนา",count_other:"{{count}} บทสนทนา",emptyDescription:"Deploy Agent แล้วเริ่มการสนทนาจากหน้า Chat"},J0t={continueChat:"ดำเนินต่อในแชท",searchTranscript:"ค้นหาในบทสนทนา…",exportMd:"ส่งออกเป็น Markdown",toolSummary:"สรุปการใช้เครื่องมือ",totalCost:"ต้นทุนรวม",cacheHitRate:"อัตราการใช้แคช"},eyt={selectAgent:"เลือก Agent...",noAgents:"ไม่มี Agent ที่ Deploy อยู่ กรุณา Deploy Agent ก่อน",placeholder:"พิมพ์ข้อความ...",send:"ส่ง",newConversation:"การสนทนาใหม่",endConversation:"จบการสนทนา",streaming:"สตรีมมิ่ง",thinking:"กำลังคิด...",connectionError:"ข้อผิดพลาดในการเชื่อมต่อ กรุณาลองใหม่",empty:"เลือก Agent และเริ่มแชทเลย!",history:"ประวัติ",undo:"เลิกทำข้อความล่าสุด",redo:"ทำซ้ำข้อความ",continueConversation:"ดำเนินการต่อ",noHistory:"ยังไม่มีประวัติการสนทนา",attach:"แนบไฟล์",attachUploading:"กำลังอัปโหลด...",attachSuccess:"แนบไฟล์แล้ว",attachError:"อัปโหลดไฟล์ล้มเหลว",retry:"ลองใหม่ขั้นตอนล่าสุด",retrySuccess:"ดำเนินการขั้นตอนใหม่แล้ว",retryError:"ลองใหม่ล้มเหลว",showActivity:"แสดงกิจกรรม",hideActivity:"ซ่อนกิจกรรม",scrollToBottom:"เลื่อนลงล่างสุด",copyMessage:"คัดลอกข้อความ",copied:"คัดลอกแล้ว!",activity:{processing:"กำลังประมวลผล…",steps:"ขั้นตอน",toolCalls:"การเรียกใช้เครื่องมือ",toolCall:"การเรียกใช้เครื่องมือ",toolResult:"ผลลัพธ์"},channels:{title:"ช่องทาง",subtitle:"เชื่อมต่อเอเจนต์และกลุ่มกับแพลตฟอร์มเช่น Slack"},context:{conversationId:"รหัสบทสนทนา",agentVersion:"เวอร์ชันเอเจนต์",startTime:"เริ่มเมื่อ",stepCount:"ขั้นตอน",show:"แสดงข้อมูลบทสนทนา",hide:"ซ่อนข้อมูลบทสนทนา"},agentTyping:"เอเจนต์กำลังพิมพ์"},tyt={unnamed:"ทรัพยากรไม่มีชื่อ",noDescription:"ไม่มีคำอธิบาย",backToResources:"กลับไปยังทรัพยากร",backToList:"กลับไปยัง {{type}}",unknownType:"ประเภททรัพยากรที่ไม่รู้จัก",rawConfig:"การกำหนดค่าดิบ",rawConfigHint:"การกำหนดค่า JSON ของทรัพยากรนี้",create:"สร้าง {{type}}",createTitle:"สร้าง {{type}}",createDescription:"สร้างการกำหนดค่า {{type}} เปล่า สามารถแก้ไขได้หลังจากสร้าง",confirmDelete:"คุณแน่ใจหรือไม่ว่าต้องการลบ {{type}} นี้?",empty:"ยังไม่มีทรัพยากร {{type}}",itemCount_one:"{{count}} รายการ",itemCount_other:"{{count}} รายการ",count_one:"{{count}} ทรัพยากร",count_other:"{{count}} ทรัพยากร",types:{rules:{name:"กฎพฤติกรรม",description:"กำหนดกฎลำดับการสนทนาและตรรกะการตัดสินใจ"},apicalls:{name:"การเรียก HTTP",description:"กำหนดค่าการเชื่อมต่อ API ภายนอกและ Webhook"},output:{name:"ชุดเอาต์พุต",description:"จัดการเทมเพลตการตอบกลับและรูปแบบเอาต์พุต"},dictionary:{name:"พจนานุกรม",description:"กำหนดรูปแบบการจดจำคำและวลี"},llm:{name:"LLM",description:"กำหนดค่าโมเดล AI, Prompt และการเชื่อมโยงเครื่องมือ"},propertysetter:{name:"ตัวกำหนดคุณสมบัติ",description:"ตั้งค่าคุณสมบัติการสนทนาและจัดการการเติมช่อง"},mcpcalls:{name:"การเรียก MCP",description:"กำหนดค่าการเชื่อมต่อเซิร์ฟเวอร์ MCP และการเรียกเครื่องมือ"},rag:{name:"ฐานความรู้",description:"กำหนดค่าฐานความรู้ RAG สำหรับการสืบค้นเอกสาร"},snippets:{name:"ตัวอย่างพรอมต์",description:"Reusable system prompt building blocks"}},emptyDescription:"สร้าง {{type}} แรกของคุณเพื่อใช้ใน Workflow"},nyt={formTab:"ฟอร์ม",jsonTab:"JSON",save:"บันทึก",discard:"ยกเลิก",saving:"กำลังบันทึก...",saved:"บันทึกสำเร็จ",saveError:"บันทึกล้มเหลว",dirty:"มีการเปลี่ยนแปลงที่ยังไม่ได้บันทึก",version:"เวอร์ชัน",versionPicker:"เลือกเวอร์ชัน",readOnly:"อ่านอย่างเดียว",formPlaceholder:"ตัวแก้ไขแบบภาพจะมาเร็วๆ นี้ ใช้แท็บ JSON เพื่อแก้ไข",jsonSchema:"การตรวจสอบ Schema ทำงานอยู่",cascadeMode:"การเปลี่ยนแปลงจะถูกส่งต่อไปยัง Workflow และ Agent แม่",usedInAgents:"ใช้ใน {{count}} Agent(s)",updateUsageHint:"อัปเดต Workflows และ Agents ที่เลือกเป็นเวอร์ชันใหม่?",updateUsage:"อัปเดตที่เลือก",skipUpdate:"ข้าม",cascading:"กำลังอัปเดต...",cascadeSuccess:"การอัปเดตแบบต่อเนื่องเสร็จสมบูรณ์",invalidJson:"JSON ไม่ถูกต้อง — เปลี่ยนไปแท็บ JSON เพื่อแก้ไข"},iyt={appendActions:"เพิ่มการดำเนินการ",expressionsAsActions:"นิพจน์เป็นการดำเนินการ",groups:"กลุ่มพฤติกรรม",addGroup:"เพิ่มกลุ่ม",groupName:"ชื่อกลุ่ม",executionStrategy:"กลยุทธ์การดำเนินการ",rules:"กฎ",addRule:"เพิ่มกฎ",ruleName:"ชื่อกฎ",actions:"การดำเนินการ",noActions:"ไม่มีการดำเนินการ",addAction:"เพิ่ม",actionPlaceholder:"เช่น greet, get_weather",conditions:"เงื่อนไข",addCondition:"เพิ่มเงื่อนไข",conditionType:"ประเภทเงื่อนไข",nestedConditions:"เงื่อนไขซ้อน",configKey:"คีย์",configValue:"ค่า",addConfig:"เพิ่มการกำหนดค่า",removeRule:"ลบกฎ",removeGroup:"ลบกลุ่ม",removeCondition:"ลบเงื่อนไข",noGroups:"ไม่มีกลุ่มพฤติกรรมที่กำหนด",noRules:"ไม่มีกฎในกลุ่มนี้",noConditions:"ไม่มีเงื่อนไข"},syt={targetServerUrl:"URL เซิร์ฟเวอร์เป้าหมาย",targetServerUrlPlaceholder:"https://api.example.com",calls:"การเรียก HTTP",addCall:"เพิ่มการเรียก HTTP",callName:"ชื่อการเรียก",callDescription:"คำอธิบาย",descriptionPlaceholder:"คำอธิบายภาษาธรรมชาติสำหรับ LLM Agent",request:"คำขอ",method:"เมธอด",path:"เส้นทาง",pathPlaceholder:"/api/endpoint",headers:"เฮดเดอร์",addHeader:"เพิ่ม Header",queryParams:"พารามิเตอร์การค้นหา",addQueryParam:"เพิ่มพารามิเตอร์",contentType:"ประเภทเนื้อหา",body:"เนื้อหาคำขอ (Request Body)",bodyPlaceholder:"เทมเพลตเนื้อหา JSON...",parameters:"พารามิเตอร์ (สำหรับ LLM Agent)",paramName:"ชื่อพารามิเตอร์",paramDescription:"คำอธิบาย",addParam:"เพิ่มพารามิเตอร์",options:"ตัวเลือก",saveResponse:"บันทึกการตอบกลับ",responseObjectName:"ชื่อออบเจกต์การตอบกลับ",responseHeaderObjectName:"ชื่อออบเจกต์ Header การตอบกลับ",fireAndForget:"ส่งแล้วลืม",batchCalls:"การเรียกแบบชุด",iterationObjectName:"ชื่อออบเจกต์การวนซ้ำ",prePostInstructions:"คำสั่งก่อน/หลัง",preRequest:"ก่อนคำขอ",postResponse:"หลังการตอบกลับ",removeCall:"ลบการเรียก",noCalls:"ไม่มีการเรียก HTTP ที่กำหนดค่า",actions:"การดำเนินการทริกเกอร์",noActions:"ไม่มีการดำเนินการ",actionPlaceholder:"เช่น get_weather"},ryt={tasks:"งาน LLM",addTask:"เพิ่มงาน",noTasks:"ไม่มีงาน LangChain ที่กำหนดค่า",removeTask:"ลบงาน",taskId:"รหัสงาน",description:"คำอธิบาย",descriptionPlaceholder:"งานนี้ทำอะไร",triggerActions:"การดำเนินการทริกเกอร์",noActions:"ไม่มีการดำเนินการ",actionPlaceholder:"เช่น help, chat",systemPrompt:"พรอมต์ระบบ",systemPromptPlaceholder:"คุณเป็นผู้ช่วยที่เป็นประโยชน์...",modelParams:"พารามิเตอร์โมเดล",addParam:"เพิ่มพารามิเตอร์",agentMode:"โหมดเอเจนต์",enableBuiltInTools:"เปิดใช้เครื่องมือในตัว",toolWhitelist:"รายการที่อนุญาต (ว่าง = ทั้งหมด)",enableHttpCallTools:"ค้นหาเครื่องมือ HTTP Call อัตโนมัติ",enableHttpCallToolsDesc:"เปิดเผยส่วนขยาย httpcall ทั้งหมดจาก Workflow เป็นเครื่องมือ LLM โดยอัตโนมัติ",httpCallTools:"ลิงก์เครื่องมือเรียก HTTP",httpCallToolsHint:"URIs httpcall แบบชัดแจ้ง",addTool:"เพิ่ม URI เครื่องมือ",mcpServers:"เซิร์ฟเวอร์ MCP",mcpServersDesc:"เซิร์ฟเวอร์ MCP ภายนอกที่เครื่องมือจะพร้อมใช้งานสำหรับ LLM",addMcpServer:"เพิ่มเซิร์ฟเวอร์ MCP",mcpUrlPlaceholder:"http://localhost:7070/mcp",mcpName:"ชื่อ",mcpApiKey:"API Key / อ้างอิง Vault",historyLimit:"ขีดจำกัดประวัติ",historyLimitHint:"(-1 = ไม่จำกัด)",budgetPerf:"งบประมาณและประสิทธิภาพ",maxBudget:"งบประมาณสูงสุด ($)",costTracking:"การติดตามต้นทุน",toolCaching:"การแคชเครื่องมือ",rateLimiting:"จำกัดอัตรา",defaultRate:"อัตราเริ่มต้น (คำขอ/นาที)",prePostInstructions:"คำสั่งก่อน/หลัง",preRequest:"ก่อนคำขอ",postResponse:"หลังการตอบกลับ",enableMcpCallTools:"ค้นพบเครื่องมือ MCP อัตโนมัติ",enableMcpCallToolsDesc:"เปิดเผยส่วนขยาย mcpcalls ทั้งหมดจากเวิร์กโฟลว์เป็นเครื่องมือ LLM โดยอัตโนมัติ",a2aAgents:"เอเจนต์ A2A",a2aAgentsDesc:"เอเจนต์ A2A ระยะไกลที่ทักษะจะกลายเป็นเครื่องมือ LLM",addA2aAgent:"เพิ่มเอเจนต์ A2A",a2aUrlPlaceholder:"https://remote.example.com/a2a/agents/...",a2aName:"ชื่อที่แสดง",a2aApiKey:"${vault:my-a2a-key}",a2aTimeout:"เวลาหมด (มิลลิวินาที)",a2aSkillsFilter:"ตัวกรองทักษะ (ว่าง = ทั้งหมด)",cascade:"โมเดลคาสเคด",cascadeDesc:"Try a cheap/fast model first. If confidence is too low, automatically escalate to a more powerful (and expensive) model.",cascadeEnable:"เปิดใช้โมเดลคาสเคด",cascadeStrategy:"กลยุทธ์",strategyCascade:"ยกระดับตามลำดับ",strategyParallel:"ขนาน (อนาคต)",cascadeStrategyHint:"ลองโมเดลราคาถูกก่อน ยกระดับเมื่อความมั่นใจต่ำ",cascadeEvalStrategy:"การประเมินความมั่นใจ",cascadeEvalHint:"วิธีตัดสินว่าคำตอบดีพอหรือไม่",evalStructured:"เอาต์พุตแบบมีโครงสร้าง (JSON)",evalHeuristic:"ฮิวริสติก (ตรวจจับความลังเล)",evalJudge:"โมเดลผู้ตัดสิน (LLM รอง)",evalNone:"ไม่มี (ยอมรับเสมอ)",cascadeInAgent:"ใช้คาสเคดในโหมดเอเจนต์ (กับเครื่องมือ) ด้วย",cascadeSteps:"Cascade Steps",cascadeStepsDesc:"Order matters: first step tried first. Last step is always accepted.",cascadeModelName:"เช่น claude-sonnet-4-6",cascadeConfidence:"Min. Confidence (0-1)",cascadeConfidencePlaceholder:"ว่าง = ยอมรับเสมอ",cascadeTimeout:"เวลาหมด (มิลลิวินาที)",addCascadeStep:"เพิ่มขั้นตอนคาสเคด",parallelExecution:"เรียกใช้เครื่องมือแบบขนาน",parallelExecutionDesc:"Run independent tool calls concurrently",parallelTimeout:"เวลาหมด (มิลลิวินาที)",maxToolIterations:"รอบการทำซ้ำเครื่องมือสูงสุด",maxToolIterationsHint:"(ค่าเริ่มต้น 10)",toolRateLimits:"จำกัดอัตราต่อเครื่องมือ",toolRateLimitsDesc:"Override default rate for specific tools",toolName:"ชื่อเครื่องมือ",addToolRate:"เพิ่มการจำกัดอัตรา",retryConfig:"การตั้งค่าการลองใหม่",retryDesc:"Configure automatic retries with exponential backoff.",retryMaxAttempts:"จำนวนครั้งสูงสุด",retryDelay:"ความล่าช้าเริ่มต้น (มิลลิวินาที)",retryMultiplier:"ตัวคูณ backoff",retryMaxDelay:"ความล่าช้าสูงสุด (มิลลิวินาที)",ragConfig:"RAG (การดึงความรู้)",ragDesc:"Augment LLM responses with retrieved documents.",ragHttpCall:"URI เรียก HTTP",ragEmbeddingModel:"โมเดลเอ็มเบดดิ้ง",ragEmbeddingModelPlaceholder:"เช่น text-embedding-3-small",ragEmbeddingStore:"ที่เก็บเอ็มเบดดิ้ง",ragEmbeddingStorePlaceholder:"เช่น pgvector, qdrant",ragMaxResults:"ผลลัพธ์สูงสุด",ragMinScore:"Min Similarity Score (0-1)",moveDown:"เลื่อนลง",moveUp:"เลื่อนขึ้น",execution:"การดำเนินการ",budgetCosts:"งบประมาณและต้นทุน",preRequestDesc:"ตั้งค่าหรือแปลงคุณสมบัติก่อนการทำงานของ LLM",postResponseDesc:"ประมวลผลเอาต์พุตของ LLM: ตั้งค่าคุณสมบัติ สร้างข้อความเอาต์พุต และสร้างการตอบกลับด่วน",postPropertyInstructions:"คำสั่งคุณสมบัติ",postOutputInstructions:"คำสั่งเอาต์พุต",postQrInstructions:"คำสั่งการตอบกลับด่วน",allSkills:"ทักษะทั้งหมด",skillPlaceholder:"เช่น order-tracking",modeAgent:"เอเจนต์",modeChat:"แชท",perMinute:"/นาที",allTools:"เครื่องมือทั้งหมด",selectSpecific:"เลือกเฉพาะ",allToolsInfo:"เครื่องมือในตัวทั้ง {{count}} ชิ้นพร้อมใช้งานสำหรับ LLM เลือก「เลือกเฉพาะ」เพื่อจำกัดเครื่องมือที่เปิดเผย",availableTools:"เครื่องมือที่พร้อมใช้งาน",toolCount:"เลือก {{selected}} จาก {{total}}",toolSources:"แหล่งเครื่องมือเวิร์กโฟลว์",toolSourcesInfo:"แหล่งทั้งสองเปิดใช้งานโดยค่าเริ่มต้น — การเรียก HTTP และ MCP ทั้งหมดในเวิร์กโฟลว์จะถูกเปิดเผยเป็นเครื่องมือ LLM โดยอัตโนมัติ ปิดแหล่งเพื่อยกเว้น",included:"รวมอยู่"},oyt={language:"ภาษา",langPlaceholder:"เช่น en, th",outputSets:"ชุดเอาต์พุต",addOutputSet:"เพิ่มชุดเอาต์พุต",noOutputSets:"ไม่มีชุดเอาต์พุตที่กำหนดค่า",actionName:"ชื่อการดำเนินการ",timesOccurred:"×",removeOutput:"ลบ",outputs:"เอาต์พุต",alternativeGroup:"กลุ่มทางเลือก",addAlternative:"เพิ่มทางเลือก",addOutputGroup:"เพิ่มกลุ่มเอาต์พุต",textPlaceholder:"ข้อความเอาต์พุต...",urlPlaceholder:"URL…",delayMs:"การหน่วง (มิลลิวินาที)",quickReplies:"ตอบกลับด่วน",noQuickReplies:"ไม่มี Quick Replies",addQuickReply:"เพิ่ม Quick Reply",qrValue:"ข้อความปุ่ม",qrExpressions:"นิพจน์",default:"ค่าเริ่มต้น"},ayt={setters:"ตัวกำหนดคุณสมบัติ",addSetter:"เพิ่ม Setter",noSetters:"ไม่มี Property Setter ที่กำหนดค่า",removeSetter:"ลบ",triggerActions:"การดำเนินการทริกเกอร์",noActions:"ไม่มีการดำเนินการ",actionPlaceholder:"เช่น greet, fallback",properties:"คุณสมบัติ",noProperties:"ไม่มีคุณสมบัติ",addProperty:"เพิ่มคุณสมบัติ",propName:"ชื่อคุณสมบัติ",propValue:"ค่า / นิพจน์",fromPath:"เส้นทางแหล่ง",fromObjectPath:"fromObjectPath",override:"แทนที่",propsCount:"คุณสมบัติ",untitled:"(ไม่มีการดำเนินการ)"},lyt={language:"ภาษา",langPlaceholder:"เช่น en, th",words:"คำ",addWord:"เพิ่มคำ",wordPlaceholder:"เช่น สวัสดี",phrases:"วลี",addPhrase:"เพิ่มวลี",phrasePlaceholder:"เช่น สวัสดีตอนเช้า",regExs:"นิพจน์ทั่วไป",addRegEx:"เพิ่ม RegEx",regexPlaceholder:"นิพจน์ทั่วไป",expressionPlaceholder:"เช่น greeting(hello)",frequency:"ความถี่",none:"ไม่มีที่กำหนด"},cyt={title:"แดชบอร์ดผู้ประสานงาน",subtitle:"ตรวจสอบการประมวลผลการสนทนาและจัดการรายการ Dead-Letter",type:"ประเภท Coordinator",connection:"การเชื่อมต่อ",processed:"งานที่ประมวลผลแล้ว",deadLettered:"ข้อความตาย",activeQueues:"คิวที่ใช้งานอยู่",queued:"อยู่ในคิว",deadLetterTitle:"คิวจดหมายตาย",noDeadLetters:"ไม่มีรายการ Dead-Letter",colId:"ID",colConversation:"บทสนทนา",colError:"ข้อผิดพลาด",colTime:"เวลา",colActions:"การดำเนินการ",replay:"เล่นซ้ำ",discard:"ละทิ้ง",purgeAll:"ล้างทั้งหมด",confirmPurge:"ล้างทั้งหมด?",yes:"ใช่",cancel:"ยกเลิก",replaySuccess:"เล่นซ้ำ Dead-Letter แล้ว",replayError:"เล่นซ้ำล้มเหลว",discardSuccess:"ละทิ้ง Dead-Letter แล้ว",discardError:"ละทิ้งล้มเหลว",purgeSuccess:"ล้างรายการ Dead-Letter ทั้งหมดแล้ว",purgeError:"ล้างล้มเหลว",empty:"ไม่มีข้อมูล Coordinator ที่พร้อมใช้งาน",emptyHint:"บริการ Coordinator อาจยังไม่เริ่มทำงาน ข้อมูลจะปรากฏโดยอัตโนมัติ"},dyt={expand:"ขยาย",expandHint:"เต็มหน้าจอ (Ctrl+Shift+F)",close:"เสร็จ",lines:"บรรทัด",chars:"ตัวอักษร",fullscreenTitle:"ตัวแก้ไขเนื้อหา",fullscreenDescription:"ตัวแก้ไขเต็มหน้าจอ กด Escape เพื่อปิด"},uyt={title:"บันทึก",description:"ตรวจสอบสตรีมบันทึกแบบเรียลไทม์หรือค้นหาบันทึกประวัติ",tabLive:"สด",tabHistory:"ประวัติ",connected:"เชื่อมต่อแล้ว",disconnected:"ตัดการเชื่อมต่อ",filterAgent:"รหัสเอเจนต์…",filterConversation:"ID การสนทนา...",filterInstance:"ID อินสแตนซ์...",allLevels:"ทุกระดับ",pause:"หยุดชั่วคราว",resume:"ดำเนินการต่อ",clear:"ล้าง",search:"ค้นหา",waitingForLogs:"กำลังรอบันทึก...",connectingStream:"กำลังเชื่อมต่อกับสตรีม...",noHistoryLogs:"ไม่พบบันทึกประวัติ",entryCount:"{{count}} รายการ",showStacktrace:"แสดง Stacktrace ({{count}} เฟรม)",hideStacktrace:"ซ่อน Stacktrace",allAgents:"เอเจนต์ทั้งหมด",allConversations:"บทสนทนาทั้งหมด",waitingHint:"Log จะปรากฏที่นี่เมื่อ Stream เข้ามาจาก Backend",noHistoryHint:"ลองปรับตัวกรองหรือค้นหา Agent หรือ Conversation อื่น",searchConversations:"ค้นหาตาม ID, เอเจนต์, ผู้ใช้…",stepsCount:"{{count}} ขั้นตอน",noConversationsFound:"ไม่พบการสนทนา",useConversationId:"ใช้ ID: {{id}}",searchLogs:"ค้นหาล็อก…",errors:"ข้อผิดพลาด",warnings:"คำเตือน",infos:"ข้อมูล",debugs:"ดีบัก",filteredCount:"{{shown}} จาก {{total}} รายการ",copyEntry:"คัดลอกล็อก",export:"ส่งออก",stateReady:"พร้อม",stateActive:"ใช้งานอยู่",stateError:"ข้อผิดพลาด",stateEnded:"สิ้นสุด"},hyt={title:"ตู้เก็บข้อมูลลับ",description:"จัดการ Secrets ที่เข้ารหัสใน Vault ค่าจะไม่ถูกเปิดเผย",tenantId:"รหัสผู้เช่า",refresh:"โหลด Secrets",create:"เพิ่ม Secret",createTitle:"เพิ่ม Secret",keyName:"ชื่อคีย์",keyNameLabel:"ชื่อคีย์",keyNamePlaceholder:"เช่น apiKey, dbPassword",valueLabel:"ค่า Secret",valuePlaceholder:"ป้อนค่า Secret…",storeWarning:"ค่าจะถูกเข้ารหัส ไม่สามารถดึงกลับได้หลังจากบันทึก",store:"บันทึก Secret",storeSuccess:'บันทึก Secret "{{key}}" แล้ว',deleteSuccess:'ลบ Secret "{{key}}" แล้ว',created:"สร้างเมื่อ",lastAccessed:"เข้าถึงล่าสุด",checksum:"การตรวจสอบ",actions:"การกระทำ",confirmDeleteTitle:"ลบ Secret",confirmDeleteMessage:'คุณแน่ใจหรือไม่ว่าต้องการลบ "{{key}}" อย่างถาวร? ไม่สามารถยกเลิกได้',empty:"ไม่พบ Secrets",emptyHint:"สร้าง Secret หรือเปลี่ยนตัวกรอง Namespace ด้านบน",vaultUp:"Vault ออนไลน์",vaultDown:"Vault ออฟไลน์",descriptionLabel:"คำอธิบาย (ไม่จำเป็น)",descriptionPlaceholder:"เช่น คีย์ OpenAI API สำหรับการใช้งานจริง",descriptionCol:"คำอธิบาย",reference:"อ้างอิง",willUseRef:"อ้างอิง:",copyRef:"คัดลอกอ้างอิงของระบบจัดเก็บ",refCopied:"คัดลอกแล้ว: {{ref}}",lastRotated:"หมุนเวียนล่าสุด",scopeExplanation:"ข้อมูลเป็นแบบขอบเขตต่อพื้นที่และแชร์ทั่ว ใช้ $\\{vault:keyName\\}.",creatingFor:'จัดเก็บในผู้เช่า "{{tenant}}" — ใช้ได้กับทั้งหมด',vaultNotConfigured:"ไม่ได้กำหนดค่าศูนย์ลับ",viewDocs:"ดูเอกสารประกอบ",selectAgentFirst:"กรุณาเลือกเอเจนต์ตัวหนึ่ง",tableTitle:'{{count}} ข้อมูลลับของ "{{tenant}}"'},gyt={title:"บันทึกการตรวจสอบ",description:"เรียกดูบัญชีตรวจสอบที่ไม่สามารถเปลี่ยนแปลงได้เพื่อการปฏิบัติตามข้อกำหนดและการดีบัก",byConversation:"ตามการสนทนา",byAgent:"ตาม Agent",conversationIdPlaceholder:"ป้อน ID การสนทนา...",agentIdPlaceholder:"ป้อน Agent ID...",versionPlaceholder:"เวอร์ชัน (ไม่เลือกก็ได้)",search:"ค้นหา",entries:"รายการ",totalDuration:"รวม",totalCost:"ค่าใช้จ่ายรวม",step:"ขั้นตอน",tasks:"งาน",input:"อินพุต",output:"เอาต์พุต",llmDetail:"รายละเอียด LLM",toolCalls:"การเรียกเครื่องมือ",hmacIntegrity:"ตรวจสอบความสมบูรณ์ HMAC แล้ว",empty:"ค้นหารายการตรวจสอบ",emptyHint:"ป้อน ID การสนทนาหรือ Agent ด้านบนเพื่อเรียกดู Audit Trail",noResults:"ไม่พบรายการตรวจสอบ",noResultsHint:"ลอง ID อื่นหรือตรวจสอบว่าการสนทนาถูกประมวลผลแล้ว",loadMore:"โหลดเพิ่ม",selectAgent:"Select an agent…",conversations:"conversations",emptyAgent:"Select an agent to view its audit trail",emptyAgentHint:"Choose a deployed agent from the dropdown above to see all its audit records.",export:"Export",autoRefreshToggle:"Toggle auto-refresh (every 10s)",autoRefreshOn:"Auto",autoRefreshOff:"Auto",integrityVerified:"All entries cryptographically signed",integrityVerifiedDesc:"{{count}} of {{total}} entries have HMAC-SHA256 signatures",integrityPass:"SIGNED",integrityPartial:"Partially signed audit trail",integrityPartialDesc:"{{count}} of {{total}} entries have HMAC signatures",integrityNone:"Unsigned audit entries",integrityNoneDesc:"Configure a vault master key to enable automatic HMAC-SHA256 signing on all future audit entries.",signed:"Signed",allSigned:"All signed"},fyt={title:"การกำหนดเวลา",subtitle:"จัดการทริกเกอร์ที่กำหนดเวลาของ Agent — Cron และ Heartbeats",create:"สร้างการกำหนดเวลา",createTitle:"สร้างการกำหนดเวลา",createSuccess:"สร้างการกำหนดเวลาสำเร็จ",createError:"สร้างการกำหนดเวลาล้มเหลว",creating:"กำลังสร้าง...",name:"ชื่อ",namePlaceholder:"เช่น การตรวจสุขภาพรายวัน",triggerType:"ประเภททริกเกอร์",cronExpression:"นิพจน์ Cron",interval:"ช่วง (วินาที)",agentId:"Agent ID",agentIdPlaceholder:"ป้อน Agent ID...",environment:"สภาพแวดล้อม",message:"ข้อความ",messagePlaceholder:"ข้อความที่จะส่งถึง Agent",conversationStrategy:"กลยุทธ์การสนทนา",total:"การกำหนดเวลาทั้งหมด",active:"ใช้งานอยู่",failedCount:"ล้มเหลว / Dead-Lettered",nextFireLabel:"การดำเนินการถัดไป",tableTitle:"การกำหนดเวลาทั้งหมด",empty:"ยังไม่มีการกำหนดเวลา",emptyHint:"สร้างการกำหนดเวลาเพื่อทำให้ทริกเกอร์ Agent เป็นอัตโนมัติ",colName:"ชื่อ",colType:"ชนิด",colSchedule:"กำหนดเวลา",colAgent:"เอเจนต์",colStatus:"สถานะ",colNextFire:"ครั้งถัดไป",colLastFired:"ครั้งล่าสุด",colActions:"การดำเนินการ",enable:"เปิดใช้",disable:"ปิดใช้",enabled:"เปิดใช้การกำหนดเวลาแล้ว",disabled:"ปิดใช้การกำหนดเวลาแล้ว",toggleError:"สลับการกำหนดเวลาล้มเหลว",fireNow:"ดำเนินการตอนนี้",fired:"ดำเนินการกำหนดเวลาสำเร็จ",fireError:"ดำเนินการล้มเหลว",retry:"ลองใหม่",retrySuccess:"เข้าคิวการกำหนดเวลาอีกครั้ง",retryError:"ลองใหม่ล้มเหลว",deleteSuccess:"ลบการกำหนดเวลาแล้ว",deleteError:"ลบการกำหนดเวลาล้มเหลว",fireHistory:"ประวัติการดำเนินการ"},pyt={title:"ดีบัก",tabPipeline:"ไปป์ไลน์",tabCosts:"ค่าใช้จ่าย",tabMemory:"หน่วยความจำ",tabLogs:"บันทึก",tabPrompt:"พรอมต์",turn:"รอบ",latest:"ล่าสุด",noPipeline:"ส่งข้อความเพื่อดูร่องรอยไปป์ไลน์",processing:"กำลังประมวลผล...",actions:"การดำเนินการ",confidence:"ความมั่นใจ",duration:"ระยะเวลา"},myt={thisTurn:"รอบนี้",conversationTotal:"รวมการสนทนา",tokens:"Tokens",cost:"ค่าใช้จ่าย",duration:"ระยะเวลา",model:"โมเดล",toolCalls:"การเรียกเครื่องมือ",toolUsage:"การใช้เครื่องมือ",cacheStats:"แคช",hitRate:"อัตราการพบ",empty:"ส่งข้อความเพื่อดูตัวชี้วัดค่าใช้จ่าย",in:"เข้า",out:"ออก",total:"รวม",calls:"ครั้ง"},byt={title:"หน่วยความจำการสนทนา",noConversation:"เริ่มการสนทนาเพื่อตรวจสอบหน่วยความจำ",empty:"ไม่มีข้อมูลหน่วยความจำที่พร้อมใช้งาน",properties:"คุณสมบัติ",step:"ขั้นตอน",keys:"คีย์",input:"อินพุต"},xyt={noAgent:"เลือก Agent เพื่อดูบันทึก",search:"ค้นหา...",pause:"หยุดชั่วคราว",resume:"ดำเนินการต่อ",clear:"ล้าง",waiting:"กำลังรอบันทึก...",connected:"เชื่อมต่อแล้ว",disconnected:"ตัดการเชื่อมต่อ",logOutput:"เอาต์พุตบันทึก"},vyt={noConversation:"เริ่มการสนทนาเพื่อตรวจสอบพรอมต์",noLlm:"ยังไม่พบการโต้ตอบกับ LLM ใดๆ",turn:"รอบ",latest:"ล่าสุด",tokens:"Tokens",model:"โมเดล",cost:"ค่าใช้จ่าย",copy:"คัดลอกพรอมต์",copied:"คัดลอกแล้ว!",replay:"เล่นรอบนี้ซ้ำ",toolCalls:"การเรียกเครื่องมือ",step:"ขั้นตอน",roleSystem:"พรอมต์ระบบ",roleUser:"ผู้ใช้",roleAssistant:"ผู้ช่วย",roleTool:"ผลลัพธ์เครื่องมือ"},_yt={preview:"ดูตัวอย่าง",edit:"แก้ไข",switchToPreview:"ดูตัวอย่างพรอมต์ที่แก้ไขแล้ว",switchToEdit:"สลับไปแก้ไข",refresh:"รีเฟรช",sampleData:"ข้อมูลตัวอย่าง (ไม่มีบทสนทนา)",disclaimerReal:"ตัวอย่างใช้เอ็นจิน Qute กับข้อมูลบทสนทนาจริง",disclaimerSample:"ตัวอย่างใช้เอ็นจิน Qute กับข้อมูลตัวอย่าง เลือกบทสนทนาเพื่อดูค่าจริง",resolvedPrompt:"พรอมต์ที่แก้ไขแล้ว",copy:"คัดลอก",copied:"คัดลอกแล้ว!",error:"ข้อผิดพลาดในการแก้ไขเทมเพลต",loading:"กำลังแก้ไขเทมเพลต…",availableVariables:"ตัวแปรที่พร้อมใช้งาน",copyVariable:"คลิกเพื่อคัดลอกการอ้างอิงตัวแปร",varProperties:"คุณสมบัติ",varMemory:"หน่วยความจำ",varContext:"บริบท",varSnippets:"ตัวอย่าง",varUserInfo:"ข้อมูลผู้ใช้",varConversationInfo:"ข้อมูลบทสนทนา",varInput:"อินพุต",varConversationLog:"บันทึกบทสนทนา"},yyt={title:"สตูดิโอเอเจนต์",subtitle:"สร้าง ทดสอบ และดีบัก Agent ของคุณในพื้นที่ทำงานเดียว",pipeline:"ไปป์ไลน์",editor:"ตัวแก้ไข",debug:"ดีบัก & แชท",selectStage:"คลิกที่ขั้นตอนของไปป์ไลน์เพื่อเปิดตัวแก้ไข",openInStudio:"เปิดในสตูดิโอ",loading:"กำลังโหลด Agent...",notFound:"ไม่พบ Agent",hideChat:"ซ่อนแชท",showChat:"แสดงแชท",openEditor:"เปิดในตัวแก้ไข",editorComingSoon:"การผสานรวมตัวแก้ไขในหน้าจอจะมาเร็วๆ นี้",noPipeline:"ไม่มีขั้นตอนไปป์ไลน์",type:{parser:"ตัววิเคราะห์",rules:"กฎ",property:"กำหนดค่าตัวแปร",apicalls:"การเรียก API",llm:"LLM",output:"เอาต์พุต","output.template":"เทมเพลตเอาต์พุต",mcpcalls:"การเรียก MCP",rag:"ฐานความรู้",dictionary:"พจนานุกรม"},landingDescription:"เลือกเอเจนต์เพื่อเปิดตัวแก้ไขไปป์ไลน์ ตัวดีบัก และแชทสด",noAgents:"ไม่พบเอเจนต์ — สร้างจากหน้าเอเจนต์",chat:"แชท",backToAgent:"กลับไปที่เอเจนต์",selectStageHint:"เลือกส่วนขยายในไปป์ไลน์เพื่อดูและแก้ไขการกำหนดค่าแบบอินไลน์",noConfig:"ขั้นตอนไปป์ไลน์นี้ไม่มี URI การกำหนดค่า",unsupportedType:"ไม่มีตัวแก้ไขสำหรับประเภทส่วนขยายนี้"},wyt={general:"ทั่วไป",kbName:"ชื่อฐานความรู้",kbNamePlaceholder:"เช่น product-docs, faq, internal-wiki",kbNameHint:"ใช้เพื่ออ้างอิงฐานความรู้นี้จากงานของ LLM",embeddingModel:"โมเดล Embedding",provider:"ผู้ให้บริการ",embeddingParams:"พารามิเตอร์ของผู้ให้บริการ",embeddingParamsHint:"ชื่อโมเดล, API Key (ใช้ ${vault:...} สำหรับ secret), base URL, ฯลฯ",vectorStore:"ศูนย์รวมเวกเตอร์",storeType:"ประเภทการจัดเก็บ",storeParams:"พารามิเตอร์การเชื่อมต่อ",chunking:"การตัดแบ่งเอกสาร (Chunking)",chunkStrategy:"กลยุทธ์",chunkSize:"ขนาดของ Chunk",chunkOverlap:"ความซ้อนทับกันของ Chunk",overlapHint:"ความซ้อนทับช่วยรักษาบริบทให้คงที่ระหว่าง Chunks ได้",chunkPreview:"ตัวอย่าง (วิธีการที่จะได้รับเอกสาร)",chunkBlocks:"{{count}} chunk ละ ประมาณ {{size}} ตัวอักษรและรวมความซ้อนทับ {{overlap}} ตัว",retrievalDefaults:"ค่าเริ่มต้นในการดึงข้อมูล",retrievalHint:"ค่าเหล่านี้สามารถเขียนทับให้ต่างออกไปได้ในส่วนขั้นตอนงาน ณ ตอนการจัดการของ LLM.",maxResults:"ความคล้ายคลึงสูงสุด (top-K)",minScore:"คะแนนความเหมือนต่าสุด",ingestion:"เอกสารที่สกัดเสร็จ",dropFiles:"ทิ้งเอกสารเพื่อให้ทำการรวบรวม",dropHint:"ไฟล์ต่างๆจำพวก Text, Markdown หรืออื่นๆก็ใช้ได้",browse:"เลือกดู",pasteText:"หรือเลือกวางในรูปแบบตัวอักษรเรียบง่าย",pastePlaceholder:"ให้ทำการวางไฟล์งานจำพวกข้อความที่นี่...",ingestText:"นำเข้าชนิดข้อความ",ingestionHistory:"สถานะการประมวล",saveFirstIngestion:"หลังจากนี้ ค่อยเพิ่มความสมบูรณ์ฐานความรู้ให้กับเอกสารต่อๆไป",addParam:"แอดพารามิเตอร์"},Cyt={welcome:{title:"ยินดีต้อนรับสู่ EDDI",subtitle:"ศูนย์บัญชาการ AI Agent ของคุณ",introText:"EDDI Manager คือศูนย์บัญชาการของคุณสำหรับการสร้าง ทดสอบ และดำเนินการโมเดลตัวแทน AI ของคุณ.",capabilitiesTitle:"สิ่งที่คุณสามารถทำได้",capabilitiesSubtitle:"ทุกอย่างที่คุณต้องการเพื่อสร้าง AI Agent ระดับ Production",buildAgents:"สร้าง Agents",buildAgentsDesc:"สร้างและกำหนดค่า AI Agent โดยใช้ Wizard หรือสร้างใหม่จากศูนย์",designWorkflows:"ออกแบบ Workflows",designWorkflowsDesc:"เครื่องมือสร้าง Pipeline แบบลากและวางด้วยกฏกติกาของพฤติกรรม LLM และเครืองมือต่างๆ",testRealtime:"ทดสอบและสัมผัสได้ทันทีแบบ Real-Time",testRealtimeDesc:"พูดคุยกับตัวแทนผ่านผลลัพธ์ย้อนกลับอย่างไวพร้อมรับแก้ Bug",monitorOperate:"บริหาร ควบคุม",monitorOperateDesc:"ควบคุมการตอบโต้, บันทึกการกระทำ, จัดการ secret, และตารางงบเวลา — รวมศูนย์อยู่ในที่ๆเดียว",readyTitle:"พร้อมที่จะเริ่มต้นหรือยัง?",readySubtitle:"คุณสามารถเริ่มทัวร์แนะนำการใช้งานใหม่ได้ทุกเมื่อจากเมนูช่วยเหลือในแถบด้านข้าง",startTour:"เริ่มทัวร์การใช้งาน",exploreOwn:"ฉันขอสำรวจเองดีกว่า"},tour:{back:"ย้อนกลับ",next:"ถัดไป",skip:"ตั้งค่าข้าม",finish:"จบคำชี้แจง",stepOf:"ลำดับ {{current}} ของ {{total}}",dashboard:{title:"ทัวร์แดชบอร์ด",step1Title:"แผงควบคุมหลักของคุณ",step1Desc:"แผงด้านข้างจัดหมวดหมู่ทุกอย่างเป็น 3 โซนหลัก ได้แก่ การจัดการ การพัฒนา และการนำไปใช้ คุณจะหาเจอแน่นอน.",step2Title:"ภาพรวมแพลตฟอร์ม",step2Desc:"นับสถานะสดๆว่า ตัวแทน กลุ่มกระบวนการและบทสทนา สามารถคลิ้กดูทุกส่วนได้จากจุดนี้.",step3Title:"การช่วยเหลือเพื่อการด่วนฉับพลัน",step3Desc:"การจัดการอย่างเร่งด่วน. อย่าง Agent Wizard เป็นเส้นทางตรงและไวที่สุดสำหรับผลักดัน ตัวแทน(Agent) - มันใช้เวลาไม่ถึงนาทีครึ่งด้วยซ้ำ",step4Title:"ตั้งหน้าจอด้วยตัวของท่าน",step4Desc:"เลือก ธีมสว่างหรือจะเข้ม ก็ตามศรัทธา. หรือสามารถเลือกเปลี่ยนบนเมนูต่างๆถึง 11 ภาษา - ตั้งต้นเลยที่แผงเลือกตัวแสดงผลภาษา"},agents:{title:"ทัวร์ตัวแทน(Agent)",step1Title:"ตัวช่วยเอเจนต์",step1Desc:"Wizard จะอธิบายขั้นตอนให้ครบผ่านทางกระบวนการ - ให้โอกาสเลือกโมเดล, ออกแบบบุคลิค , ใส่ Tools เพิ่ม และทำการ Deploy เลย",step2Title:"สายควบคุม",step2Desc:"สำหรับพวกนักพัฒนาสุดเหวี่ยง: จัดการและเลือก Agent ด้วยตัวเองแบบ Manual โดยเขียนผ่าน JSON ล้วนๆ.",step3Title:"ค้นหาเลย",step3Desc:"ค้นตารางและหน้าเพจตัวแทนผ่านแถบสืบค้น. ทำการปรับโหมดดูผลแบบตารางหรือกระเบื้องเพจด้วยตาเปล่า.",step4Title:"กลุ่มหน้าเพจ Agent ของคุณ",step4Desc:"ในแต่ละหน้าต่างจะแสดงข้อมูล เวอร์ชั่น โทเค็นเครื่องมือเวลาและการ Deploy สัมผัสลงการ์ดแล้วคุณจะไปเจอกับตารางแบบกว้าง."},workflows:{title:"ทัวร์ Workflows",step1Title:"สร้าง Workflow ใหม่",step1Desc:"Workflow คือตัวควบคุมประมวลผลระบบเครือข่าย — ทำหน้าเป็นแกนกลางเรียงร้อย LLM แบบสเต็ปคำสั่ง หรือแม้แต่ API ต่างๆ",step2Title:"Workflows ของฉัน",step2Desc:"Workflow ทุกอย่างสามารถใส่พ่วงพร้อมเข้าให้การทำงานผ่านตัวแทน Agent เลือกที่มุมขวาลากดึงไปมาใน Canvas สตูดิโอ.",step3Title:"ตั้งค่ามุมหน้าจอ",step3Desc:"คุณสามารถค้นและจัดลำดับกริดได้อย่างแม่นยำ."},chat:{title:"ทัวร์ แชท",step1Title:"เลือกตัวแทนสักตัวนะ",step1Desc:"ตัวแทนใดที่พร้อมลุยงานแล้ว มาสามารถดึงมาเสวนาทดสอบระบบที่นี่.",step2Title:"ระบบถ่ายทอดสดแบบ Streaming",step2Desc:"ตัวพิมพ์จะตอบทีละประโยคคำ เพื่อให้ทราบจุดบัคและช้าได้ตรงจุด.",step3Title:"รายการโต้ตอบเก่า.",step3Desc:"ดึงกล่องออกมาก็จะมีหน้าต่างการตอบกลับและแก้ไขที่เคยทำค้าง.",step4Title:"สปีคมั่วซั่วกันเลย",step4Desc:"ลองทักมาดูสิสักคำ. มันจะลองนำองค์ความรู้ LLM กฎและเวิร์กโฟลวเอามาตอบกลับเพื่อวิเคราะห์ผลงานของคุณนะ."},channels:{title:"ช่องทาง",subtitle:"เชื่อมต่อเอเจนต์และกลุ่มกับแพลตฟอร์มเช่น Slack"},resources:{title:"ทัวร์ แหล่งข้อมูล",step1Title:"Extension เสริมกำลัง",step1Desc:"แต่ละส่วนของทรัพยากรก็คือดั่งกลไกแต่ละชิ้น ที่สามารถเสริมการทำงานของ Agent ของคุณได้อย่างครอบคลุม.",step2Title:"ตั้งค่าแม่แบบของ LLM",step2Desc:"ส่วนนี้เปรียบดั่งสมอง สามารถระบุ Prompts, MCP ,รูปแบบย่อย และเครือข่าย",step3Title:"ตั้งกฎและเรียก API",step3Desc:"ใช้สร้างกฎหรือเงื่อนไข รวมถึงดึงข้อมูลผ่าน HTTP หรือ RestApi ออกสู่วงกว้างและกลับสู่ Agent ของระบบได้หมด."},conversations:{title:"ทัวร์บทการสนทนา",step1Title:"ค้นหาก่อนเข้า",step1Desc:"ค้นหาในแฟ้มบทสนทนาหรือ Agent ด้วย ID หรืออ้างอิงของแต่ละรายได้เลย.",step2Title:"ตรวจสอบโหมดต่างๆ",step2Desc:"หาบทการติดต่อตามลำดับเช่น: กำลังตอบโต้ หรือ หยุด หรือล้มเหลว",step3Title:"รายการที่ติดต่อกัน",step3Desc:"ส่องความล้มเหลวต่างๆ แค่จิ้มๆคลิ้กๆเพื่อวิเคราะห์ขั้นตอนเชิงลำดับเส้นเวลา."},groups:{title:"ทัวร์จัดการแบบมวลรวม กลุ่มก้อน",step1Title:"ตั้งเป็นบอร์ดห้อง",step1Desc:"ให้กลุ่มเหล่าผู้ช่วยส่วนตัว สามารถเสวนาหารือ แลกเปลี่ยนหรือทำงานซ้อนทับแบบซินดิเคต",step2Title:"ค้นหาปาร์ตี้",step2Desc:"ลองหาคลัสเตอร์ หรือคอมมิวนิตี้ย่อมๆของเหล่า Agent ได้เลย.",step3Title:"ป้ายตารางสมาคม",step3Desc:"ปัดกวาดความยุ่งยากด้วยตารางกรุ๊ป ล้างหรือแก้ไขการสั่งงานหมู่ได้จบที่นี่."},logs:{title:"ทัวร์ System Logs",step1Title:"ความจริง และ อดีตกาล",step1Desc:"สามารถดูปันทึกกิจกรรมตอนนี้ หรือสลับหาประวัติตามเวลาผ่านมา.",step2Title:"กรองข้อมูลไหล",step2Desc:"คุณเลือกแสดงผลเฉพาะ Agent หรือเลือกคัดกรองแค่ประเด็นร้อนๆ.",step3Title:"ส่งออก",step3Desc:"ดาวโหลด Logs ในแพลตฟอร์มนี้สู่ไฟล์ตัวหนังสือเพื่อช่วยคุณเก็บความจำ."},secrets:{title:"ทัวร์ห้องนิรภัย Secrets",step1Title:"สร้างกุญแจส่วนตัว",step1Desc:"ใช้ห้องนี้เอาไว้บันทึก API Key ตัวโปรด, เข้าระบบและเก็บ Tokenต่างๆ.",step2Title:"ห้องส่วนรวมตาม ID",step2Desc:"คุณกรองข้อมูลที่ซ่อนอยู่ แค่พิมพ์ Tenant ID ดู.",step3Title:"อ้างอิงให้เป๊ะ",step3Desc:"คุณเรียนรู้วิธีการทำ Variable (${vault:...}) ลงบนระบบ LLM แทนที่จะ Hard-Code"},audit:{title:"ทัวร์ บัญชีกระบวนการ Audit",step1Title:"ตรวจตราด้วยรูปแบบต่างๆ",step1Desc:"ค้นการรับส่งข้อมูลผ่าน Conversation ID หรือตรวจสอบบนความเปลี่ยนไปรายเวอร์ชั่นของ Agent ใดๆก็ตาม.",step2Title:"ดึงข้อมูลรัว",step2Desc:"ลองพิมพ์ค่าแล้วค้นหา ก็รู้ได้ว่าระบบดึงข้อมูลได้เที่ยงตรงมั้ย.",step3Title:"สรุปบันทึกการเบิก",step3Desc:"คุณส่งออกรายงานหรือ Audit เข้าสู่ระบบประเภท JSON เพื่อใช้วางรูปเล่มหรือแจ้งผู้พัฒนาได้"},schedules:{title:"ทัวร์ Schedules",step1Title:"ตั้งแจ้งเวลา",step1Desc:"สร้างรูปแบบ Cron Job สำหรับแจ้งเตือนจังหวะการทำ Workflow อัตโนมัติในสไตล์คนเทพ",step2Title:"สภาพอัตรากำลัง",step2Desc:"เฝ้ามองความยืดหยุ่น การสะดุดล้ม หรือกิจกรรมที่ทำงานได้ลึกทุกส่วน.",step3Title:"บริหารกลยุทธ์เวลา",step3Desc:"เข้าควบคุมระบบให้กด พัก เดิน หรือแก้ไขสั่งการแบบสดๆก็ย่อมทำได้."},quotas:{title:"ทัวร์ โควตาและลิมิต",step1Title:"ทำกลไกการห้ามใจ",step1Desc:"การจัดการให้ระบบไม่หุ้มเงินมากเกิน กำหนดค่าการจำกัดต่างๆ อย่างเช่น จำนวน Agent หรือบอท หรือโทเคนต่อวันของใครแต่ละคน.",step2Title:"แสดงยอดใช้งาน",step2Desc:"รายงานย้อนกลับของการใช้งานอย่างหนัก เพื่อบริหารต้นทุนรายทาง.",step3Title:"เอาให้บังคับใช้ชัวร์ๆ",step3Desc:"เซฟระบบเมื่อเปลี่ยนแล้ว ให้ระบบห้ามโหลดยอดเกินให้เสียทรัพย์ฟรี."},coordinator:{title:"ทัวร์ ศูนย์บัญชาการ (Coordinator)",step1Title:"ดูสถานะสายตรง",step1Desc:"รู้สัญญาณการกะพริบเพื่อวิเคราะห์ระบบแกนกลางเบื้องหลัง.",step2Title:"การต่อเส้นทางในคิว",step2Desc:"ตรวจสอบทุกเส้นทางคำสั่ง หรือติดตามงานระหว่างประมวลอย่างเกาะติด.",step3Title:"ข้อความที่ตาย",step3Desc:"ชี้จุดตาย หรือสกัดงานเพื่อโยนพ้นทางให้ระบบเดินคล่องแบบไร้รอยต่อ."},orphans:{title:"ทัวร์ เด็กกำพร้า (Orphans)",step1Title:"ใช้เครื่องตรวจจับเรดาร์",step1Desc:"ระบบเรดาร์หาคอนฟิคหลงเหลือในเศษขยะ หรือแม้เป็นคอนฟิกที่ไม่ได้พ่วงใครทำงานด้วยเลย.",step2Title:"สแกนหาไฟล์ตกค้างจากข้อมูลการลบ",step2Desc:"มันยังมีเศษของคอนฟิกที่ถูกทิ้งซากแต่ลบไปแล้ว มาให้เรากวาดล้างซ้ำ.",step3Title:"ตรวจสอบล้างบาป",step3Desc:"เช็ครายชื่อความตกค้างของเรดาร์ แล้วเคลียร์คืนพื้นที่ใน Database ซะ."}},help:{title:"ตัวช่วย & ทัวร์",platformTour:"ทัวร์แพลตฟอร์ม",resetAll:"รีเซ็ตการทัวร์ทั้งหมด",resetConfirm:"คุณต้องการรีเซ็ตสถานะการทัวร์ให้กลับไปเริ่มใหม่ทั้งหมด หรือไม่?"},offer:{message:"มือใหม่ใช่หรือไม่ลองดูใน {{page}}",accept:"โชว์ให้ฉันดูสิ",dontAsk:"อย่าโชว์ถามอีก"}},Syt={status:"สถานะแพลตฟอร์ม",online:"ออนไลน์",offline:"ออฟไลน์",checking:"กำลังตรวจสอบ…",connected:"เชื่อมต่อแล้ว",disconnected:"ไม่ได้เชื่อมต่อ",instance:"อินสแตนซ์",latency:"เวลาแฝง",lastChecked:"ตรวจสอบล่าสุด",justNow:"เมื่อสักครู่",secondsAgo:"{{count}} วินาทีที่แล้ว"},kyt={live:"สด",reconnecting:"กำลังเชื่อมต่อใหม่…"},Nyt={title:"สร้าง {{type}} ใหม่",newAgent:"สร้าง Agent ใหม่",newGroup:"สร้าง Group ใหม่",quickCreate:"สร้างแบบด่วน",quickCreateTitle:"สร้าง {{type}} แบบด่วน",quickCreateDesc:"ตั้งชื่อและคำอธิบาย แล้วกำหนดค่ารายละเอียดตัวแปรต่างๆในภายหลัง",guidedSetup:"การตั้งค่าแบบมีคำแนะนำ",guidedSetupDesc:"แบบฟอร์มแนะนำทีละขั้นตอน โดยครอบคลุม LLM, Prompts, เครื่องมือ, และการ Deploy."},Eyt={empty:"ยังไม่มี Group",emptyDescription:"Group ช่วยให้ Agent หลายตัวทำงานร่วมกันในการสนทนาเชิงโครงสร้าง",createGroup:"สร้าง Group",unnamed:"Group ไม่มีชื่อ",count_one:"{{count}} กลุ่ม",count_other:"{{count}} กลุ่ม",confirmDelete:"ลบกลุ่มนี้?",confirmDeleteDesc:"การกำหนดค่ากลุ่มจะถูกลบอย่างถาวร",duplicateSuccess:"Group ถูกทำซ้ำแล้ว",noDescription:"No description",members:"members",discussionStyle:"Discussion Style",maxRounds:"Max Rounds"},Lyt={title:"หน่วยความจำผู้ใช้",subtitle:"เรียกดูและจัดการหน่วยความจำถาวรของผู้ใช้ที่จัดเก็บโดยเอเจนต์",userIdPlaceholder:"ใส่รหัสผู้ใช้…",searchPlaceholder:"ค้นหาหน่วยความจำ…",enterUserId:"ใส่รหัสผู้ใช้เพื่อเรียกดูหน่วยความจำ",totalEntries:"รายการทั้งหมด",preferences:"ค่ากำหนด",facts:"ข้อเท็จจริง",conflicts:"ขัดแย้ง",cat_all:"ทั้งหมด",cat_preference:"ค่ากำหนด",cat_fact:"ข้อเท็จจริง",cat_context:"บริบท",deleteAll:"ลบทั้งหมด",deleteAllTitle:"ลบหน่วยความจำทั้งหมด",deleteAllDesc:"หน่วยความจำทั้งหมดของผู้ใช้นี้จะถูกลบอย่างถาวร ไม่สามารถยกเลิกการกระทำนี้ได้",deleteAllConfirm:"ลบทั้งหมด",entryDeleted:"รายการหน่วยความจำถูกลบแล้ว",allDeleted:"หน่วยความจำทั้งหมดของผู้ใช้ถูกลบแล้ว",noResults:"ไม่พบรายการหน่วยความจำ",value:"ค่า",sourceAgent:"เอเจนต์ต้นทาง",accessCount:"จำนวนการเข้าถึง",created:"สร้างเมื่อ",updated:"อัปเดตเมื่อ",sourceConversation:"บทสนทนาต้นทาง",conflicted:"ขัดแย้ง"},Dyt={title:"คุณสมบัติผู้ใช้",subtitle:"เรียกดูและจัดการคุณสมบัติ longTerm ที่เก็บไว้ต่อผู้ใช้",userIdPlaceholder:"ใส่รหัสผู้ใช้…",searchPlaceholder:"กรองคุณสมบัติ…",enterUserId:"ใส่รหัสผู้ใช้เพื่อดูคุณสมบัติ",key:"กุญแจ",type:"ประเภท",value:"ค่า",deleteAll:"ลบทั้งหมด",deleteAllTitle:"ลบคุณสมบัติทั้งหมด",deleteAllDesc:"คุณสมบัติทั้งหมดของผู้ใช้นี้จะถูกลบอย่างถาวร",deleted:"คุณสมบัติถูกลบแล้ว",noResults:"ไม่พบคุณสมบัติ",showingCount:"{{count}} คุณสมบัติ"},Tyt={title:"ทริกเกอร์เอเจนต์",subtitle:"แมปอินเทนต์ไปยังการปรับใช้เอเจนต์สำหรับการกำหนดเส้นทางอัตโนมัติ",create:"ทริกเกอร์ใหม่",createTitle:"สร้างทริกเกอร์",editTitle:"แก้ไขทริกเกอร์",intent:"อินเทนต์",deployments:"การปรับใช้เอเจนต์",addDeployment:"เพิ่มเอเจนต์",agents:"เอเจนต์",empty:"ยังไม่มีทริกเกอร์ที่กำหนดค่า",created:"สร้างทริกเกอร์แล้ว",updated:"อัปเดตทริกเกอร์แล้ว",deleted:"ลบทริกเกอร์แล้ว",deleteTitle:"ลบทริกเกอร์",deleteDesc:"ลบทริกเกอร์สำหรับอินเทนต์ 「{{intent}}」อย่างถาวรหรือไม่?",searchPlaceholder:"กรองตามอินเทนต์หรือรหัสเอเจนต์…"},Iyt={title:"ค้นพบขีดความสามารถ",subtitle:"ค้นพบเอเจนต์ตามทักษะและขีดความสามารถที่ประกาศ",searchPlaceholder:"ค้นหาทักษะ…",strategyHighest:"ความเชื่อมั่นสูงสุด",strategyAll:"ผลลัพธ์ทั้งหมด",registeredSkills:"ทักษะที่ลงทะเบียน",noSkills:"ไม่พบทักษะ",matchingAgents:"เอเจนต์ที่ตรงกัน",noMatches:"ไม่พบเอเจนต์สำหรับทักษะนี้"},Ayt={title:"ส่งออกเอเจนต์",loading:"กำลังโหลดโครงสร้างทรัพยากร...",selectResources:"เลือกทรัพยากรที่ต้องการส่งออก",required:"จำเป็น",snippets:"สนิปเพ็ต",allSelected:"เลือกทรัพยากรทั้งหมดแล้ว",countSelected:"เลือก {{count}} จาก {{total}} ทรัพยากร",exportSelected:"ส่งออกที่เลือก"},Ryt={title:"นำเข้าเอเจนต์",dropZone:"ลากไฟล์ .zip มาวางที่นี่ หรือคลิกเพื่อค้นหา",dropZoneHint:"แชร์เอเจนต์ที่ส่งออก (.zip)",strategyLabel:"กลยุทธ์การนำเข้า",createNew:"สร้างเป็นเอเจนต์ใหม่",createNewDesc:"สร้างสำเนาพร้อมรหัสใหม่ เหมาะสำหรับการนำเข้าครั้งแรก",mergeSync:"ผสาน / ซิงค์กับของเดิม",mergeSyncDesc:"อัปเดตทรัพยากรที่มีอยู่และสร้างใหม่ถ้ายังไม่มี",upgradeExisting:"อัปเกรดเอเจนต์ที่มีอยู่",upgradeDesc:"จับคู่ทรัพยากรกับเอเจนต์ปลายทางในเชิงโครงสร้าง เหมาสำหรับการเลื่อนขั้นข้ามสภาพแวดล้อม",syncRemote:"ซิงค์จากอินสแตนซ์ระยะไกล",syncDesc:"เชื่อมต่อกับ EDDI อินสแตนซ์อื่นและซิงค์เอเจนต์สด",importNow:"นำเข้าเดี๋ยวนี้",previewChanges:"ดูตัวอย่างการเปลี่ยนแปลง",selectTargetAgent:"เลือกเอเจนต์ปลายทาง",upgradeTargetHint:"ทรัพยากรที่นำเข้าจะถูกจับคู่เชิงโครงสร้างกับเอเจนต์นี้",chooseAgent:"— เลือกเอเจนต์ —",sourceAgent:"เอเจนต์ต้นทาง (ระยะไกล)",targetAgent:"เอเจนต์ปลายทาง (ในเครื่อง)",createNewTarget:"สร้างเอเจนต์ใหม่",resource:"ทรัพยากร",type:"ชนิด",match:"จับคู่",action:"การดำเนินการ",new:"ใหม่",updated:"อัปเดตแล้ว",unchanged:"ไม่เปลี่ยนแปลง",selected:"เลือกแล้ว",mergeNow:"นำเข้าที่เลือก",syncNow:"ซิงค์เดี๋ยวนี้",upgradeNow:"อัปเกรดเดี๋ยวนี้",importing:"กำลังนำเข้าเอเจนต์...",contentIdentical:"เนื้อหาเหมือนกัน",targetContent:"เป้าหมาย",sourceContent:"แหล่งที่มา"},Myt={title:"ซิงค์",subtitle:"ประสานงานเชื่อมต่อ",connection:"ตัวอย่างต้นทาง",sourceUrl:"URL อินสแตนซ์เป้าหมาย",authToken:"โทเค็นการอนุญาต",authHint:"ไม่จำเป็น (ส่งเป็น X-Source-Authorization).",connect:"เชื่อมต่อ",connected:"เชื่อมต่อแล้ว",agentsFound:"เอเจนต์",connectionFailed:"การเชื่อมต่อล้มเหลว",agentMapping:"การจับคู่เอเจนต์",previewAll:"ดูทั้งหมด",syncSelected:"เลือกซิงค์",remote:"ระยะไกล",createNew:"สร้างใหม่",changes:"รายการเปลี่ยนแปลง",agentsSelected:"เอเจนต์ที่เลือก",totalResources:"ทรัพยากร",syncSuccess:"ซิงค์สำเร็จ",syncError:"ข้อผิดพลาดซิงค์",empty:"เชื่อมต่อไปยังอินสแตนซ์เพื่อให้ใช้งาน",autoMatched:"จับคู่อัตโนมัติ",previewFirst:"ดูตัวอย่างการเปลี่ยนแปลงก่อนซิงค์"},Pyt={actionCreate:"สร้างใหม่",actionUpdate:"อัปเดต",actionSkip:"เป็นปัจจุบัน",actionConflict:"ขัดแย้ง"},Oyt={title:"การสนทนาของผู้ใช้",subtitle:"จัดการการเชื่อมโยง intent → ผู้ใช้ → การสนทนา",lookup:"ค้นหา",intent:"วิถี",userId:"ID ผู้ใช้",agentId:"ID เอเจนต์",environment:"สภาพแวดล้อม",conversationId:"ID การสนทนา",binding:"การเชื่อมโยงที่ใช้งาน",enterBoth:"ป้อน intent และ ID ผู้ใช้",notFound:"ไม่พบการเชื่อมโยง",create:"สร้างการเชื่อมโยง",createTitle:"สร้างการเชื่อมโยง",created:"สร้างการเชื่อมโยงแล้ว",deleteTitle:"ลบการเชื่อมโยง",deleteDesc:'ลบการเชื่อมโยงสำหรับ intent "{{intent}}" และผู้ใช้ "{{userId}}"?',deleted:"ลบการเชื่อมโยงแล้ว"},jyt={placeholder:"ค้นหาหน้า เอเจนต์ การดำเนินการ…",noResults:"ไม่พบผลลัพธ์",recent:"ล่าสุด",navigate:"นำทาง",agents:"เอเจนต์",actions:"การดำเนินการด่วน",createAgent:"สร้างเอเจนต์ใหม่",openChat:"เปิดแชท",kbdNavigate:"นำทาง",kbdSelect:"เลือก",kbdClose:"ปิด"},Fyt={title:"Group Setup Wizard",subtitle:"Assemble a team of AI advisors to discuss your questions",backToGroups:"Back to Groups",templateTitle:"Start from a template",templateDesc:"Choose a preset group configuration or start from scratch.",startBlank:"Start from Scratch",blankDesc:"Configure everything manually",configTitle:"Group Configuration",configDesc:"Name your group and choose how the agents will discuss",namePlaceholder:"e.g. Advisory Board",descPlaceholder:"What is this group for?",membersTitle:"Assemble Your Team",membersDesc:"For each seat, choose an existing agent or create a new one on the fly.",addMember:"Add Member",refreshAgents:"Refresh agent list",existingAgents:"existing agents",displayName:"Agent Name",displayNamePlaceholder:"Give this agent a name…",rolePlaceholder:"Role (e.g. Marketing, Engineering)",useExisting:"Use Existing",createNew:"Create New",selectAgent:"Select agent…",systemPrompt:"System Prompt",provider:"LLM Provider",model:"Model",apiKey:"API Key",apiKeyPlaceholder:"sk-…",createThisAgent:"Create Agent",creatingAgent:"Creating agent…",agentReady:"Agent created & deployed",agentCreated:'Agent "{{name}}" created',agentCreateFailed:"Failed to create agent: {{error}}",moderator:"Moderator",moderatorHint:"Synthesizes the discussion",addModerator:"Add Moderator",removeModerator:"Remove moderator",createModerator:"Create Moderator Agent",moderatorReady:"Moderator agent ready",moderatorCreated:"Moderator agent created",creatingModerator:"Creating moderator…",creatingSlot:"Creating {{name}}…",creatingGroup:"Creating group…",needMembers:"Add at least 2 members to proceed",reviewTitle:"Review & Create",reviewDesc:"Review your group configuration before creating.",reviewMembers:"Members",autoCreateNotice:"{{count}} agents will be auto-created when you click Create Group",autoCreateHint:"Each agent will be created and deployed automatically before the group is assembled.",unassignedWarning:"{{count}} members set to 'Use Existing' but no agent selected",unassignedHint:"These members will be skipped during discussions. Go back to assign agents.",flowPreview:"Discussion Flow",createGroup:"Create Group",created:"Group Created!",viewGroup:"Open Group",createAnother:"Create Another",success:"Group created successfully!"},Byt={advisoryBoard:"Advisory Board",advisoryBoardDesc:"A panel of expert advisors consulting on strategic decisions.",codeReview:"Code Review Panel",codeReviewDesc:"Structured code review with independent opinions, peer critique, and revision.",riskAssessment:"Risk Assessment",riskAssessmentDesc:"A panel with a devil's advocate who challenges assumptions.",forecasting:"Forecasting Panel",forecastingDesc:"Delphi-style anonymous deliberation for unbiased estimates.",proCon:"Pro/Con Debate",proConDesc:"Formal debate with pro and con teams arguing their positions.",roles:{marketingExpert:"Marketing Expert",techLead:"Tech Lead",financeDirector:"Finance Director",legalCounsel:"Legal Counsel",strategyConsultant:"Strategy Consultant",seniorEngineer:"Senior Engineer",architect:"Architect",securityReviewer:"Security Reviewer",riskAnalyst:"Risk Analyst",domainExpert:"Domain Expert",devilsAdvocate:"Devil's Advocate",analystA:"Analyst A",analystB:"Analyst B",analystC:"Analyst C",analystD:"Analyst D",proAdvocate1:"Pro Advocate 1",proAdvocate2:"Pro Advocate 2",conAdvocate1:"Con Advocate 1",conAdvocate2:"Con Advocate 2"}},Hyt={agentIdPlaceholder:"ID เอเจนต์สำหรับจัดการข้อความ",botToken:"โทเค็นบอท",botTokenHint:"โทเค็น OAuth ของบอท ใช้การอ้างอิงตู้นิรภัยเพื่อความปลอดภัย",botTokenPlaceholder:"xoxb-… หรือ ${vault:slack-bot-token}",channel:"ช่อง",channelId:"ID ช่อง Slack",channelIdCol:"ID ช่อง",channelIdHint:"คลิกขวาที่ช่อง Slack → ดูรายละเอียดช่อง → คัดลอก ID ช่อง",channelsPlural:"ช่อง",channelType:"ประเภทช่อง",confirmDelete:"ลบช่องนี้?",confirmDeleteDesc:"การรวมช่องนี้จะถูกลบอย่างถาวร",create:"สร้างช่อง",createTitle:"สร้างการรวมช่อง",defaultAgentId:"ID เอเจนต์เริ่มต้น",defaultTargetHint:"เป้าหมายเริ่มต้นจัดการข้อความทั้งหมดที่ไม่ตรงกับคำสำคัญทริกเกอร์ คุณสามารถเพิ่มเป้าหมายเพิ่มเติมได้หลังสร้าง",empty:"ยังไม่มีช่อง",emptyDesc:"สร้างการรวมช่องเพื่อเชื่อมต่อเอเจนต์กับ Slack",name:"ชื่อ",namePlaceholder:"เช่น Engineering AI Hub",openSlackApps:"เปิดแดชบอร์ดแอป Slack",searchPlaceholder:"ค้นหาช่อง…",signingSecret:"ความลับในการลงนาม",signingSecretHint:"จากหน้าข้อมูลพื้นฐานของแอป Slack",signingSecretPlaceholder:"สตริงฐานสิบหกหรือ ${vault:slack-signing-secret}",slackSetupGuide:"คู่มือการตั้งค่า Slack",slackSetupSummary:"สร้างแอป Slack กำหนดขอบเขตโทเค็นบอท (app_mentions:read, chat:write, im:history, channels:history, groups:history) แล้ววางข้อมูลประจำตัวที่นี่",target:"เป้าหมาย",targets:"เป้าหมาย",targetsCol:"เป้าหมาย",type:"ประเภท",unnamed:"ช่องไม่มีชื่อ",version:"เวอร์ชัน"},Wyt={addTarget:"เพิ่มเป้าหมาย",addTrigger:"เพิ่มทริกเกอร์…",agentId:"ID เอเจนต์",botToken:"โทเค็นบอท",channelId:"ID ช่อง Slack",cooldown:"ระยะเวลาพัก (วินาที)",general:"ทั่วไป",groupId:"ID กลุ่ม",isDefault:"ค่าเริ่มต้น",maxCost:"สูงสุด $/วัน",maxDaily:"สูงสุด/วัน",name:"ชื่อ",observe:"สังเกตการณ์",observeDesc:"ตรวจสอบแบบพาสซีฟและตอบกลับแบบเลือก",observeKeywords:"คำสำคัญทริกเกอร์",observeMimeTypes:"ประเภท MIME ทริกเกอร์",observeMode:"โหมดสังเกตการณ์",observeSettings:"การตั้งค่าโหมดสังเกตการณ์",platformConfig:"การกำหนดค่าแพลตฟอร์ม",rawConfig:"การกำหนดค่าดิบ",removeTarget:"ลบ",requiredEvents:"การสมัครรับเหตุการณ์ที่จำเป็น:",requiredScopes:"ขอบเขตโทเค็นบอทที่จำเป็น:",setDefault:"ตั้งเป็นค่าเริ่มต้น",signingSecret:"ความลับในการลงนาม",targetName:"ชื่อ",targets:"เป้าหมายการกำหนดเส้นทางข้อความ",targetType:"ประเภท",triggerHint:'ผู้ใช้พิมพ์ "คำสำคัญ: ข้อความ" เพื่อกำหนดเส้นทางไปยังเป้าหมายนี้',triggerKeywords:"คำสำคัญทริกเกอร์",triggers:"ทริกเกอร์",type:"ประเภทช่อง",webhookHint:"วาง URL นี้ในฟิลด์ Request URL ของ Event Subscriptions ในแอป Slack",webhookUrl:"URL เว็บฮุก"},Vyt={app:F0t,auth:B0t,nav:H0t,theme:W0t,language:V0t,pages:z0t,common:U0t,agents:$0t,agentDetail:q0t,wizard:K0t,setupWizard:G0t,packages:Y0t,packageDetail:Q0t,packageEditor:X0t,conversations:Z0t,conversationDetail:J0t,chat:eyt,resources:tyt,editor:nyt,rulesEditor:iyt,apiCallsEditor:syt,llmEditor:ryt,outputEditor:oyt,propertySetterEditor:ayt,dictionaryEditor:lyt,coordinator:cyt,contentEditor:dyt,logs:uyt,secrets:hyt,audit:gyt,schedules:fyt,debugDrawer:pyt,costDashboard:myt,memoryInspector:byt,logViewer:xyt,promptViewer:vyt,promptPreview:_yt,studio:yyt,ragEditor:wyt,onboarding:Cyt,platform:Syt,stream:kyt,createOrWizard:Nyt,groups:Eyt,memories:Lyt,properties:Dyt,triggers:Tyt,capabilities:Iyt,exportDialog:Ayt,importDialog:Ryt,syncPage:Myt,sync:Pyt,userConversations:Oyt,commandPalette:jyt,groupWizard:Fyt,groupTemplates:Byt,channels:Hyt,channelDetail:Wyt},zyt={title:"EDDI Manager",description:"EDDI 会話型AIプラットフォーム管理ダッシュボード"},Uyt={login:"ログイン",logout:"ログアウト",loading:"認証中…",sessionExpired:"セッションが期限切れです。再度ログインしてください。",profile:"プロフィール",guest:"ゲスト",userMenu:"ユーザーメニュー"},$yt={dashboard:"ダッシュボード",agents:"エージェント",packages:"ワークフロー",conversations:"会話",coordinator:"コーディネーター",schedules:"スケジュール",logs:"ログ",orphans:"孤立項目",secrets:"シークレット",audit:"監査ログ",quotas:"クォータ",groups:"グループ",chat:"チャット",resources:"リソース",sectionManagement:"管理",sectionDevelopment:"開発",sectionOperations:"運用",mainNavigation:"メインナビゲーション",openMenu:"ナビゲーションメニューを開く",sectionCore:"コア",sectionBuild:"ビルド&テスト",sectionMonitor:"モニタリング",sectionAdmin:"管理",studio:"スタジオ",gdpr:"プライバシー",memories:"ユーザーメモリ",properties:"プロパティ",triggers:"トリガー",capabilities:"ケイパビリティ",sync:"同期",channels:"チャンネル",userConversations:"ユーザー会話",userData:"ユーザーデータ",variables:"変数"},qyt={light:"ライト",dark:"ダーク",system:"システム"},Kyt={label:"言語",en:"English",de:"Deutsch",fr:"Français",es:"Español",ar:"العربية",zh:"中文",th:"ไทย",ja:"日本語",ko:"한국어",pt:"Português",hi:"हिन्दी"},Gyt={dashboard:{title:"ダッシュボード",subtitle:"EDDI Agents と会話の概要",activeAgents:"アクティブ Agents",totalWorkflows:"ワークフロー",totalResources:"リソース",totalConversations:"会話",quickActions:"クイック操作",recentAgents:"最近の Agents",noRecentAgents:"Agent がまだありません。最初の Agent を作成しましょう!"},agents:{title:"エージェント",subtitle:"会話型 AI Agents を管理"},packages:{title:"ワークフロー",subtitle:"Workflows と拡張機能を設定"},conversations:{title:"会話",subtitle:"Agent の会話を確認・管理"},resources:{title:"リソース",subtitle:"動作ルール、辞書、出力セットなどを管理"},chat:{title:"チャット",subtitle:"デプロイ済み Agent と対話"},channels:{title:"チャネル",subtitle:"エージェントとグループを Slack などのメッセージングプラットフォームに接続"},groups:{title:"グループ",subtitle:"構造化された議論とコラボレーションのためのマルチ Agent ディスカッショングループ"}},Yyt={loading:"読み込み中...",error:"エラーが発生しました",retry:"再試行",save:"保存",cancel:"キャンセル",delete:"削除",create:"作成",edit:"編集",search:"検索...",noResults:"結果が見つかりません",duplicate:"複製",close:"閉じる",skipToMain:"メインコンテンツへスキップ",opensNewTab:"新しいタブで開く",moreActions:"その他の操作",sortByName:"名前で並べ替え",sortByVersion:"バージョンで並べ替え",sortByModified:"更新日で並べ替え",apply:"適用",copied:"コピーしました",copy:"コピー",saving:"保存中…",showMore:"Show More",showLess:"Show Less",copyFailed:"クリップボードへのコピーに失敗しました"},Qyt={deploy:"デプロイ",undeploy:"アンデプロイ",createAgent:"Agent を作成",createTitle:"新しい Agent を作成",name:"名前",namePlaceholder:"マイ Agent",description:"説明",descriptionPlaceholder:"この Agent の機能を説明してください...",empty:"Agent がまだありません。最初の Agent を作成しましょう!",confirmDelete:"この Agent を削除してもよろしいですか?",count_one:"{{count}}件のエージェント",count_other:"{{count}}件のエージェント",export:"エクスポート",exporting:"エクスポート中...",exportSuccess:"Agent のエクスポートが完了しました",import:"Agent をインポート",importing:"インポート中...",importSuccess:"Agent のインポートが完了しました",importError:"Agent のインポートに失敗しました",emptyDescription:"ウィザードで数分で完全に構成された Agent を作成できます。",chat:"チャット",deployAndChat:"デプロイしてチャット",openExternalChat:"新しいタブで開く"},Xyt={title:"Agent 詳細",backToAgents:"Agents に戻る",packages:"ワークフロー",noWorkflows:"Workflows がまだ追加されていません",addWorkflow:"Workflow を追加",selectWorkflow:"追加する Workflow を選択",rawConfig:"生の設定",editName:"名前を編集",editDescription:"説明を編集",clickToEdit:"クリックして編集",noDescription:"説明なし",duplicate:"複製",duplicating:"複製中...",duplicateSuccess:"Agent の複製が完了しました",environments:"環境",envProduction:"本番",envTest:"テスト",savingAgent:"Agent を保存中...",savedAgent:"Agent が正常に保存されました",saveError:"Agent の保存に失敗しました",deployToEnv:"{{env}}にデプロイ",undeployFromEnv:"{{env}}から削除",openStudio:"スタジオで開く",maxKeyLength:"キー最大長",maxValueLength:"値の最大長",maxWritesPerTurn:"ターンあたりの最大書き込み数",dreamSchedule:"スケジュール (cron)",dreamLlmProvider:"LLMプロバイダー",dreamLlmModel:"LLMモデル",dreamMaxCost:"実行あたりの最大コスト ($)",dreamPruneDays:"クリーンアップ日数",dreamBatchSize:"バッチサイズ",detectContradictions:"矛盾を検出",summarizeInteractions:"やり取りを要約",confidenceLow:"低",confidenceMedium:"中",confidenceHigh:"高",visibilitySelf:"自分のみ",visibilityGlobal:"グローバル",onCapEvict:"最古を削除",onCapReject:"拒否",recallMostRecent:"最新順",recallMostRelevant:"関連度順",channels:"チャネルコネクタ",channelsDesc:"このエージェントをSlackチャネルに接続します。各チャネルコネクタは独自の認証情報で個別に設定され、マルチワークスペース設定をサポートします。",noChannels:"チャネルが設定されていません",noChannelsDesc:"Slackチャネルを追加して、ユーザーがSlackからこのエージェントとやり取りできるようにします。",addSlackChannel:"Slackチャネルを追加",slackChannel:"Slackチャネル",removeChannel:"チャネルを削除",removeChannelConfirm:"このSlackチャネルコネクタを削除しますか?",removeChannelDesc:"This action will permanently disconnect this channel.",channelId:"チャネルID",channelIdHint:"チャネルIDはCで始まり、大文字の英数字が続きます",botToken:"ボットトークン",botTokenPlaceholder:"xoxb-… または ${vault:slack-bot-token}",botTokenHint:"Slack Bot User OAuthトークン。セキュリティのためにVault参照を使用してください。",signingSecret:"署名シークレット",signingSecretPlaceholder:"16進文字列または ${vault:slack-signing-secret}",signingSecretHint:"Slackアプリの基本情報ページから。セキュリティのためにVault参照を使用してください。",groupIdOptional:"グループID(オプション)",groupIdPlaceholder:"マルチエージェントグループ設定ID",groupIdHint:"このSlackチャネルから「group: 質問」マルチエージェント討論を有効にします。",slackSetupGuide:"Slackセットアップガイド",slackWebhookUrl:"Webhook URL",slackWebhookCopied:"Webhook URLをコピーしました",slackStep1:"api.slack.com/appsでSlackアプリを作成し、ワークスペースにインストールします。",slackStep2:"ボットトークン(xoxb-…)と署名シークレットをEDDI Vaultにコピーし、以下でチャネルを設定します。",slackStep3:"次にSlackアプリでEvent Subscriptionsを有効にし、上記のWebhook URLを貼り付けて、以下を購読します:",slackSetupNote:"重要:Event Subscriptionsを有効にする前に、下のチャネルを設定してください — SlackはURL検証チャレンジを送信し、EDDIで署名シークレットが設定されている必要があります。",slackRequiredScopes:"必要なボットトークンスコープ"},Zyt={title:"Agent ウィザード"},Jyt={title:"Agent 作成ウィザード",subtitle:"数分で完全に設定された Agent を作成",backToAgents:"Agents に戻る",next:"次へ",back:"戻る",createOnly:"作成のみ",createAndDeploy:"作成してデプロイ",typeTitle:"Agent のタイプは?",typeDesc:"作成する Agent のタイプを選択",standardAgent:"標準エージェント",apiAgent:"APIエージェント",standardDesc:"LLM ベースの会話AI。ツール、Quick Replies、感情分析に対応",apiDesc:"OpenAPI/Swagger 仕様をインポートして API Agent を自動生成",infoTitle:"Agent のアイデンティティ",infoDesc:"Agent に名前と個性を設定",agentName:"Agent 名",namePlaceholder:"例:カスタマーサポートBot",systemPrompt:"システムプロンプト",promptPlaceholder:"あなたは役立つAIアシスタントです。...",promptHint:"この指示が Agent の振る舞いと応答を決定します。",llmTitle:"LLM 設定",llmDesc:"Agent を駆動するAIモデルを選択",provider:"プロバイダー",model:"モデル",apiKey:"APIキー",baseUrl:"ベースURL",baseUrlPlaceholder:"カスタムエンドポイントURL",optional:"任意",apiSpecTitle:"OpenAPI 仕様",apiSpecDesc:"APIの OpenAPI/Swagger 仕様を提供",specByUrl:"URL",specByFile:"ファイル",specByPaste:"貼り付け",fetch:"取得",specFetched:"仕様が読み込まれました!",specFetchError:"仕様の取得に失敗しました",dropFile:"OpenAPI ファイルをここにドロップ",dropHint:"JSON または YAML 形式",browse:"ファイルを参照",pasteSpec:"OpenAPI/Swagger の JSON または YAML をここに貼り付け...",specLoaded:"ファイル読み込み完了:{{name}}",specReady:"仕様読み込み完了({{chars}} 文字)",apiBaseUrlLabel:"APIベースURL",apiAuthLabel:"API認証ヘッダー",endpointFilter:"Endpoint フィルタ",endpointFilterPlaceholder:"カンマ区切り:GET /users, POST /orders",featuresTitle:"機能とオプション",featuresDesc:"Agent の機能をカスタマイズ",introMessage:"ウェルカムメッセージ",introMessageDesc:"会話開始時に表示される挨拶",quickReplies:"クイックリプライ",quickRepliesDesc:"LLM がクリック可能な返信候補を生成",sentiment:"感情分析",sentimentDesc:"ユーザーの感情、意図、緊急度をリアルタイムに追跡",structuredOutput:"構造化出力",structuredOutputDesc:"LLMがプレーンテキストではなくJSONオブジェクトで応答します",structuredOutputInfo:"これを有効にすると、LLMは構造化フィールドを持つJSONオブジェクトで応答します。JSONスキーマがシステムプロンプトに追加され、モデルはJSON応答モードに設定されます。",builtInTools:"内蔵ツール",builtInToolsDesc:"EDDI の内蔵ツールライブラリを有効化(電卓、日時など)",toolsWhitelist:"ホワイトリスト(空 = すべて)",mcpServers:"MCPサーバー",mcpServersDesc:"外部ツール用の Model Context Protocol サーバー",autoDeploy:"自動デプロイ",autoDeployDesc:"作成後すぐに Agent をデプロイ",environment:"環境",envProduction:"本番",envTest:"テスト",reviewTitle:"確認して作成",reviewDesc:"作成前に設定を確認",reviewType:"タイプ",reviewName:"名前",reviewPrompt:"システムプロンプト",reviewProvider:"プロバイダー",reviewModel:"モデル",reviewSpec:"OpenAPI仕様",reviewIntro:"ウェルカムメッセージ",reviewDeploy:"デプロイ",success:"Agent が正常に作成されました!",agentCreated:"Agent が作成されました!",deployed:"デプロイ済み",endpointsParsed:"{{count}} 個の API endpoints を解析",viewAgent:"Agent を表示",createAnother:"別の Agent を作成",allTools:"すべてのツール",selectSpecific:"個別指定",allToolsInfo:"{{count}}個の組み込みツールすべてがエージェントで利用できます。「個別指定」を選択して有効にするツールを制限できます。",availableTools:"利用可能なツール",toolCount:"{{total}}中 {{selected}}を選択"},e1t={createWorkflow:"Workflow を作成",createTitle:"新しい Workflow を作成",name:"名前",namePlaceholder:"マイ Workflow",description:"説明",descriptionPlaceholder:"この Workflow の機能を説明してください...",noDescription:"説明なし",empty:"Workflow がまだありません。最初の Workflow を作成しましょう!",confirmDelete:"この Workflow を削除してもよろしいですか?",count_one:"{{count}}件のワークフロー",count_other:"{{count}}件のワークフロー",emptyDescription:"ワークフローはエージェントの処理パイプラインを定義します。"},t1t={title:"Workflow 詳細",backToWorkflows:"Workflows に戻る",extensions:"拡張機能",noExtensions:"この Workflow に拡張機能はありません",rawConfig:"生の設定"},n1t={title:"Workflow エディタ",pipeline:"拡張 Pipeline",addHint:"拡張機能を追加して処理 Pipeline を構築",addHintDialog:"Pipeline に追加する拡張タイプを選択",reorder:"拡張機能を並べ替え",saved:"Workflow が正常に保存されました",saveError:"ワークフローの保存に失敗しました",noTasks:"このワークフローにはタスクがありません",addTask:"タスクを追加"},i1t={searchPlaceholder:"会話 ID で検索...",id:"会話",agent:"エージェント",state:"状態",lastActivity:"最終アクティビティ",actions:"アクション",empty:"会話がまだありません。Agent をデプロイしてチャットを始めましょう!",confirmDelete:"この会話を削除してもよろしいですか?",count_one:"{{count}}件の会話",count_other:"{{count}}件の会話",emptyDescription:"エージェントをデプロイし、チャットページから会話を開始してください。"},s1t={continueChat:"チャットで続ける",searchTranscript:"会話内を検索…",exportMd:"Markdownでエクスポート",toolSummary:"ツール使用状況",totalCost:"合計コスト",cacheHitRate:"キャッシュヒット率"},r1t={selectAgent:"Agent を選択...",noAgents:"デプロイ済みの Agent がありません。まず Agent をデプロイしてください。",placeholder:"メッセージを入力...",send:"送信",newConversation:"新しい会話",endConversation:"会話を終了",streaming:"ストリーミング",thinking:"考え中...",connectionError:"接続エラーです。もう一度お試しください。",empty:"Agent を選択してチャットを始めましょう!",history:"履歴",undo:"最後のメッセージを元に戻す",redo:"メッセージをやり直す",continueConversation:"続行",noHistory:"会話履歴がありません。",attach:"ファイルを添付",attachUploading:"アップロード中...",attachSuccess:"ファイル添付完了",attachError:"ファイルのアップロードに失敗",retry:"最後のステップをリトライ",retrySuccess:"ステップを再実行しました",retryError:"リトライ失敗",showActivity:"アクティビティを表示",hideActivity:"アクティビティを非表示",scrollToBottom:"一番下へスクロール",copyMessage:"メッセージをコピー",copied:"コピーしました!",activity:{processing:"処理中…",steps:"ステップ",toolCalls:"ツール呼び出し",toolCall:"ツール呼び出し",toolResult:"結果"},channels:{title:"チャンネル",subtitle:"エージェントやグループをSlackなどに接続"},context:{conversationId:"会話ID",agentVersion:"エージェントバージョン",startTime:"開始",stepCount:"ステップ数",show:"会話情報を表示",hide:"会話情報を非表示"},agentTyping:"エージェントが入力中"},o1t={unnamed:"名前なしリソース",noDescription:"説明なし",backToResources:"リソースに戻る",backToList:"{{type}}に戻る",unknownType:"不明なリソースタイプ",rawConfig:"生の設定",rawConfigHint:"このリソースのJSON設定",create:"{{type}}を作成",createTitle:"{{type}}を作成",createDescription:"空の{{type}}設定を作成します。作成後に編集できます。",confirmDelete:"この{{type}}を削除してもよろしいですか?",empty:"{{type}}リソースがまだありません。",itemCount_one:"{{count}}件のアイテム",itemCount_other:"{{count}} 個の項目",count_one:"{{count}} 個のリソース",count_other:"{{count}} 個のリソース",types:{rules:{name:"動作ルール",description:"会話フロールールと意思決定ロジックを定義"},apicalls:{name:"HTTP コール",description:"外部API連携とWebhookを設定"},output:{name:"出力セット",description:"応答テンプレートと出力バリエーションを管理"},dictionary:{name:"辞書",description:"単語とフレーズの認識パターンを定義"},llm:{name:"LLM",description:"AIモデル、Prompt、ツールバインディングを設定"},propertysetter:{name:"プロパティセッター",description:"会話プロパティの設定とスロットフィリングの管理"},mcpcalls:{name:"MCP呼び出し",description:"MCPサーバー接続と確定的ツール呼び出しを設定"},rag:{name:"ナレッジベース",description:"ドキュメント検索用のRAGナレッジベースを設定"},snippets:{name:"プロンプトスニペット",description:"Reusable system prompt building blocks"}},emptyDescription:"最初の {{type}} を作成してワークフローで使用しましょう。"},a1t={formTab:"フォーム",jsonTab:"JSON",save:"保存",discard:"破棄",saving:"保存中...",saved:"正常に保存されました",saveError:"保存に失敗しました",dirty:"未保存の変更",version:"バージョン",versionPicker:"バージョンを選択",readOnly:"読み取り専用",formPlaceholder:"ビジュアルエディタは近日公開予定です。JSONタブで編集してください。",jsonSchema:"スキーマ検証が有効",cascadeMode:"変更は親 Workflow と Agent に反映されます",usedInAgents:"{{count}} 個の Agent で使用中",updateUsageHint:"選択した Workflows と Agents を新バージョンに更新しますか?",updateUsage:"選択を更新",skipUpdate:"スキップ",cascading:"更新中...",cascadeSuccess:"カスケード更新完了",invalidJson:"JSON が無効です — JSON タブに切り替えて修正してください。"},l1t={appendActions:"アクションを追加",expressionsAsActions:"式をアクションとして",groups:"動作グループ",addGroup:"グループを追加",groupName:"グループ名",executionStrategy:"実行戦略",rules:"ルール",addRule:"ルールを追加",ruleName:"ルール名",actions:"アクション",noActions:"アクションなし",addAction:"追加",actionPlaceholder:"例: greet, get_weather",conditions:"条件",addCondition:"条件を追加",conditionType:"条件タイプ",nestedConditions:"ネスト条件",configKey:"キー",configValue:"値",addConfig:"設定を追加",removeRule:"ルールを削除",removeGroup:"グループを削除",removeCondition:"条件を削除",noGroups:"動作グループが定義されていません",noRules:"このグループにルールはありません",noConditions:"条件なし"},c1t={targetServerUrl:"ターゲットサーバー URL",targetServerUrlPlaceholder:"https://api.example.com",calls:"HTTP コール",addCall:"HTTP コールを追加",callName:"コール名",callDescription:"説明",descriptionPlaceholder:"LLM Agent 用の自然言語の説明",request:"リクエスト",method:"メソッド",path:"パス",pathPlaceholder:"/api/endpoint",headers:"ヘッダー",addHeader:"Header を追加",queryParams:"クエリパラメータ",addQueryParam:"パラメータを追加",contentType:"コンテンツタイプ",body:"リクエスト本文",bodyPlaceholder:"JSON ボディテンプレート...",parameters:"パラメータ(LLM Agent 用)",paramName:"パラメータ名",paramDescription:"説明",addParam:"パラメータを追加",options:"オプション",saveResponse:"レスポンスを保存",responseObjectName:"レスポンスオブジェクト名",responseHeaderObjectName:"レスポンス Header オブジェクト名",fireAndForget:"ファイア&フォーゲット",batchCalls:"バッチコール",iterationObjectName:"イテレーションオブジェクト名",prePostInstructions:"前後の指示",preRequest:"リクエスト前",postResponse:"レスポンス後",removeCall:"コールを削除",noCalls:"HTTP コールが設定されていません",actions:"トリガーアクション",noActions:"アクションなし",actionPlaceholder:"例: get_weather"},d1t={tasks:"LLMタスク",addTask:"タスクを追加",noTasks:"LangChain タスクが設定されていません",removeTask:"タスクを削除",taskId:"タスクID",description:"説明",descriptionPlaceholder:"このタスクの機能",triggerActions:"トリガーアクション",noActions:"アクションなし",actionPlaceholder:"例: help, chat",systemPrompt:"システムプロンプト",systemPromptPlaceholder:"あなたは役立つアシスタントです...",modelParams:"モデルパラメータ",addParam:"パラメータを追加",agentMode:"エージェントモード",enableBuiltInTools:"内蔵ツールを有効化",toolWhitelist:"ツールホワイトリスト(空 = すべて)",enableHttpCallTools:"HTTP Call ツール自動検出",enableHttpCallToolsDesc:"Workflow のすべての httpcall 拡張を LLM ツールとして自動的に公開",httpCallTools:"HTTP呼び出しツールのURI",httpCallToolsHint:"明示的な httpcall URIs(自動検出に加えて)",addTool:"ツール URI を追加",mcpServers:"MCPサーバー",mcpServersDesc:"外部MCP サーバー。そのツールが LLM に利用可能になります",addMcpServer:"MCP サーバーを追加",mcpUrlPlaceholder:"http://localhost:7070/mcp",mcpName:"名前",mcpApiKey:"API Key / Vault 参照",historyLimit:"履歴制限",historyLimitHint:"(-1 = 無制限)",budgetPerf:"予算とパフォーマンス",maxBudget:"最大予算 ($)",costTracking:"コスト追跡",toolCaching:"ツールキャッシュ",rateLimiting:"レート制限",defaultRate:"デフォルトレート(リクエスト/分)",prePostInstructions:"前後の指示",preRequest:"リクエスト前",postResponse:"レスポンス後",enableMcpCallTools:"MCPツール自動検出",enableMcpCallToolsDesc:"ワークフロー内のすべてのmcpcalls拡張をLLMツールとして自動公開",a2aAgents:"A2Aエージェント",a2aAgentsDesc:"スキルがLLMツールになるリモートA2A互換エージェント",addA2aAgent:"A2Aエージェントを追加",a2aUrlPlaceholder:"https://remote.example.com/a2a/agents/...",a2aName:"表示名",a2aApiKey:"${vault:my-a2a-key}",a2aTimeout:"タイムアウト (ms)",a2aSkillsFilter:"スキルフィルター (空 = すべて)",cascade:"モデルカスケード",cascadeDesc:"Try a cheap/fast model first. If confidence is too low, automatically escalate to a more powerful (and expensive) model.",cascadeEnable:"モデルカスケードを有効化",cascadeStrategy:"戦略",strategyCascade:"逐次エスカレーション",strategyParallel:"並列(将来)",cascadeStrategyHint:"安価なモデルから試し、信頼度が低い場合にエスカレーション",cascadeEvalStrategy:"信頼度評価",cascadeEvalHint:"応答が十分かどうかの判定方法",evalStructured:"構造化出力 (JSON)",evalHeuristic:"ヒューリスティック(あいまい検出)",evalJudge:"評価モデル(サブLLM)",evalNone:"なし(常に受け入れ)",cascadeInAgent:"エージェントモード(ツール使用時)でもカスケードを使用",cascadeSteps:"Cascade Steps",cascadeStepsDesc:"Order matters: first step tried first. Last step is always accepted.",cascadeModelName:"例: claude-sonnet-4-6",cascadeConfidence:"Min. Confidence (0-1)",cascadeConfidencePlaceholder:"空 = 常に受け入れ",cascadeTimeout:"タイムアウト (ms)",addCascadeStep:"カスケードステップを追加",parallelExecution:"並列ツール実行",parallelExecutionDesc:"Run independent tool calls concurrently",parallelTimeout:"タイムアウト (ms)",maxToolIterations:"最大ツール反復回数",maxToolIterationsHint:"(デフォルト 10)",toolRateLimits:"ツールごとのレート制限",toolRateLimitsDesc:"Override default rate for specific tools",toolName:"ツール名",addToolRate:"レート制限を追加",retryConfig:"リトライ設定",retryDesc:"Configure automatic retries with exponential backoff.",retryMaxAttempts:"最大試行回数",retryDelay:"初期遅延 (ms)",retryMultiplier:"バックオフ倍率",retryMaxDelay:"最大遅延 (ms)",ragConfig:"RAG(ナレッジ検索)",ragDesc:"Augment LLM responses with retrieved documents.",ragHttpCall:"HTTP呼び出しURI",ragEmbeddingModel:"埋め込みモデル",ragEmbeddingModelPlaceholder:"例: text-embedding-3-small",ragEmbeddingStore:"埋め込みストア",ragEmbeddingStorePlaceholder:"例: pgvector, qdrant",ragMaxResults:"最大結果数",ragMinScore:"Min Similarity Score (0-1)",moveDown:"下へ移動",moveUp:"上へ移動",execution:"実行",budgetCosts:"予算とコスト",preRequestDesc:"LLM が実行される前にプロパティを設定または変換します。",postResponseDesc:"LLM の出力を処理します:プロパティを設定し、出力メッセージを構築し、クイックリプライを生成します。",postPropertyInstructions:"プロパティ指示",postOutputInstructions:"出力構築指示",postQrInstructions:"クイックリプライ構築指示",allSkills:"すべてのスキル",skillPlaceholder:"例: order-tracking",modeAgent:"エージェント",modeChat:"チャット",perMinute:"/分",allTools:"すべてのツール",selectSpecific:"個別指定",allToolsInfo:"{{count}}個の組み込みツールすべてがLLMで利用できます。「個別指定」で公開するツールを制限できます。",availableTools:"利用可能なツール",toolCount:"{{total}}中 {{selected}}を選択",toolSources:"ワークフローツールソース",toolSourcesInfo:"両方のソースがデフォルトで有効です — ワークフローのHTTP呼び出しとMCP呼び出しはすべてLLMツールとして自動公開されます。ソースを無効にして除外できます。",included:"含まれています"},u1t={language:"言語",langPlaceholder:"例: en, ja",outputSets:"出力セット",addOutputSet:"出力セットを追加",noOutputSets:"出力セットが設定されていません",actionName:"アクション名",timesOccurred:"×",removeOutput:"削除",outputs:"出力",alternativeGroup:"代替グループ",addAlternative:"代替を追加",addOutputGroup:"出力グループを追加",textPlaceholder:"出力テキスト...",urlPlaceholder:"URL…",delayMs:"遅延(ミリ秒)",quickReplies:"クイックリプライ",noQuickReplies:"Quick Replies なし",addQuickReply:"Quick Reply を追加",qrValue:"ボタンテキスト",qrExpressions:"式",default:"デフォルト"},h1t={setters:"プロパティセッター",addSetter:"Setter を追加",noSetters:"Property Setter が設定されていません",removeSetter:"削除",triggerActions:"トリガーアクション",noActions:"アクションなし",actionPlaceholder:"例: greet, fallback",properties:"プロパティ",noProperties:"プロパティなし",addProperty:"プロパティを追加",propName:"プロパティ名",propValue:"値 / 式",fromPath:"ソースパス",fromObjectPath:"fromObjectPath",override:"上書き",propsCount:"プロパティ",untitled:"(アクションなし)"},g1t={language:"言語",langPlaceholder:"例: en, ja",words:"単語",addWord:"単語を追加",wordPlaceholder:"例: こんにちは",phrases:"フレーズ",addPhrase:"フレーズを追加",phrasePlaceholder:"例: おはようございます",regExs:"正規表現",addRegEx:"正規表現を追加",regexPlaceholder:"正規表現",expressionPlaceholder:"例: greeting(hello)",frequency:"頻度",none:"定義なし"},f1t={title:"コーディネーターダッシュボード",subtitle:"会話処理を監視し Dead-Letter エントリを管理",type:"Coordinator タイプ",connection:"接続",processed:"処理済みタスク",deadLettered:"デッドレター",activeQueues:"アクティブキュー",queued:"キュー中",deadLetterTitle:"デッドレターキュー",noDeadLetters:"Dead-Letter エントリなし",colId:"ID",colConversation:"会話",colError:"エラー",colTime:"時刻",colActions:"アクション",replay:"再生",discard:"破棄",purgeAll:"すべて削除",confirmPurge:"すべて削除しますか?",yes:"はい",cancel:"キャンセル",replaySuccess:"Dead-Letter を再生しました",replayError:"再生に失敗しました",discardSuccess:"Dead-Letter を破棄しました",discardError:"破棄に失敗しました",purgeSuccess:"すべての Dead-Letter エントリを削除しました",purgeError:"削除に失敗しました",empty:"コーディネーターのデータがありません",emptyHint:"コーディネーターサービスはまだ起動中かもしれません。データは自動的に表示されます。"},p1t={expand:"展開",expandHint:"フルスクリーン (Ctrl+Shift+F)",close:"完了",lines:"行",chars:"文字",fullscreenTitle:"コンテンツエディタ",fullscreenDescription:"フルスクリーンエディタ。Escapeで閉じます。"},m1t={title:"ログ",description:"リアルタイムのログストリームを監視するか、履歴ログを検索します。",tabLive:"ライブ",tabHistory:"履歴",connected:"接続済み",disconnected:"切断",filterAgent:"エージェントID…",filterConversation:"会話 ID...",filterInstance:"インスタンス ID...",allLevels:"全レベル",pause:"一時停止",resume:"再開",clear:"クリア",search:"検索",waitingForLogs:"ログを待っています...",connectingStream:"ストリームに接続中...",noHistoryLogs:"履歴ログが見つかりません。",entryCount:"{{count}} 件",showStacktrace:"スタックトレースを表示({{count}} フレーム)",hideStacktrace:"スタックトレースを非表示",allAgents:"すべてのエージェント",allConversations:"すべての会話",waitingHint:"バックエンドからストリーミングされるとログがここに表示されます。",noHistoryHint:"フィルターを調整するか、別のエージェントまたは会話を検索してみてください。",searchConversations:"ID、エージェント、ユーザーで検索…",stepsCount:"{{count}} ステップ",noConversationsFound:"会話が見つかりません",useConversationId:"IDを使用: {{id}}",searchLogs:"ログを検索…",errors:"エラー",warnings:"警告",infos:"情報",debugs:"デバッグ",filteredCount:"{{shown}} / {{total}} 件",copyEntry:"ログエントリーをコピー",export:"エクスポート",stateReady:"準備完了",stateActive:"アクティブ",stateError:"エラー",stateEnded:"終了"},b1t={title:"シークレット保管庫",description:"Vault 内の暗号化された Secrets を管理。値は公開されません。",tenantId:"テナントID",refresh:"Secrets を読み込む",create:"Secret を追加",createTitle:"Secret を追加",keyName:"キー名",keyNameLabel:"キー名",keyNamePlaceholder:"例: apiKey, dbPassword",valueLabel:"Secret 値",valuePlaceholder:"Secret 値を入力…",storeWarning:"値は暗号化されます。保存後に取得することはできません。",store:"Secret を保存",storeSuccess:'Secret "{{key}}" を保存しました',deleteSuccess:'Secret "{{key}}" を削除しました',created:"作成日",lastAccessed:"最終アクセス",checksum:"チェックサム",actions:"アクション",confirmDeleteTitle:"Secret を削除",confirmDeleteMessage:'"{{key}}" を完全に削除してもよろしいですか?この操作は元に戻せません。',empty:"Secrets が見つかりません",emptyHint:"Secret を作成するか、上の Namespace フィルタを変更してください。",vaultUp:"Vault オンライン",vaultDown:"Vault オフライン",descriptionLabel:"説明 (任意)",descriptionPlaceholder:"例: 本番用のOpenAI APIキー",descriptionCol:"説明",reference:"参照",willUseRef:"参照:",copyRef:"ボルトの参照をコピー",refCopied:"コピーしました: {{ref}}",lastRotated:"最終ローテーション",scopeExplanation:"シークレットはテナントごとにスコープされ、全体で共有されます。設定には ${vault:keyName} で参照します。",creatingFor:"テナント「{{tenant}}」に保存 — すべてのエージェントが利用可能",vaultNotConfigured:"シークレットボルトが未設定です",viewDocs:"ドキュメントを表示",selectAgentFirst:"まずはエージェントを選択",tableTitle:"テナント「{{tenant}}」のシークレット({{count}}件)"},x1t={title:"監査ログ",description:"コンプライアンスとデバッグのための不変の監査台帳を参照。",byConversation:"会話別",byAgent:"Agent 別",conversationIdPlaceholder:"会話 ID を入力...",agentIdPlaceholder:"Agent ID を入力...",versionPlaceholder:"バージョン (任意)",search:"検索",entries:"件",totalDuration:"合計",totalCost:"合計コスト",step:"ステップ",tasks:"タスク",input:"入力",output:"出力",llmDetail:"LLM 詳細",toolCalls:"ツール呼び出し",hmacIntegrity:"HMAC 整合性検証済み",empty:"監査エントリを検索",emptyHint:"上で会話または Agent ID を入力して Audit Trail を参照してください。",noResults:"監査エントリが見つかりません",noResultsHint:"別の ID を試すか、会話が処理されたか確認してください。",loadMore:"さらに読み込む",selectAgent:"Select an agent…",conversations:"conversations",emptyAgent:"Select an agent to view its audit trail",emptyAgentHint:"Choose a deployed agent from the dropdown above to see all its audit records.",export:"Export",autoRefreshToggle:"Toggle auto-refresh (every 10s)",autoRefreshOn:"Auto",autoRefreshOff:"Auto",integrityVerified:"All entries cryptographically signed",integrityVerifiedDesc:"{{count}} of {{total}} entries have HMAC-SHA256 signatures",integrityPass:"SIGNED",integrityPartial:"Partially signed audit trail",integrityPartialDesc:"{{count}} of {{total}} entries have HMAC signatures",integrityNone:"Unsigned audit entries",integrityNoneDesc:"Configure a vault master key to enable automatic HMAC-SHA256 signing on all future audit entries.",signed:"Signed",allSigned:"All signed"},v1t={title:"スケジュール",subtitle:"Agent のスケジュールトリガーを管理 — Cron と Heartbeats",create:"スケジュールを作成",createTitle:"スケジュールを作成",createSuccess:"スケジュールが正常に作成されました",createError:"スケジュールの作成に失敗しました",creating:"作成中...",name:"名前",namePlaceholder:"例: 毎日のヘルスチェック",triggerType:"トリガータイプ",cronExpression:"Cron 式",interval:"間隔(秒)",agentId:"Agent ID",agentIdPlaceholder:"Agent ID を入力...",environment:"環境",message:"メッセージ",messagePlaceholder:"Agent に送信するメッセージ",conversationStrategy:"会話戦略",total:"合計スケジュール",active:"アクティブ",failedCount:"失敗 / Dead-Lettered",nextFireLabel:"次回実行",tableTitle:"すべてのスケジュール",empty:"スケジュールがまだありません",emptyHint:"Agent トリガーを自動化するスケジュールを作成してください。",colName:"名前",colType:"タイプ",colSchedule:"スケジュール",colAgent:"エージェント",colStatus:"ステータス",colNextFire:"次回実行",colLastFired:"前回実行",colActions:"アクション",enable:"有効化",disable:"無効化",enabled:"スケジュールが有効化されました",disabled:"スケジュールが無効化されました",toggleError:"スケジュールの切り替えに失敗しました",fireNow:"今すぐ実行",fired:"スケジュールが正常に実行されました",fireError:"実行に失敗しました",retry:"再試行",retrySuccess:"スケジュールが再キューイングされました",retryError:"再試行に失敗しました",deleteSuccess:"スケジュールが削除されました",deleteError:"スケジュールの削除に失敗しました",fireHistory:"実行履歴"},_1t={title:"デバッグ",tabPipeline:"パイプライン",tabCosts:"コスト",tabMemory:"メモリ",tabLogs:"ログ",tabPrompt:"プロンプト",turn:"ターン",latest:"最新",noPipeline:"メッセージを送信してパイプラインのトレースを表示します",processing:"処理中...",actions:"アクション",confidence:"信頼度",duration:"期間"},y1t={thisTurn:"このターン",conversationTotal:"会話の合計",tokens:"Tokens",cost:"コスト",duration:"期間",model:"モデル",toolCalls:"ツール呼び出し",toolUsage:"ツールの使用状況",cacheStats:"キャッシュ",hitRate:"ヒット率",empty:"メッセージを送信してコスト指標を表示",in:"入力",out:"出力",total:"合計",calls:"回"},w1t={title:"会話メモリ",noConversation:"会話を開始してメモリを検査します",empty:"メモリデータがありません",properties:"プロパティ",step:"ステップ",keys:"キー",input:"入力"},C1t={noAgent:"エージェントを選択してログを表示します",search:"検索...",pause:"一時停止",resume:"再開",clear:"クリア",waiting:"ログを待機中...",connected:"接続済み",disconnected:"切断されました",logOutput:"ログ出力"},S1t={noConversation:"会話を開始してプロンプトを検査します",noLlm:"LLMのやり取りはまだ見つかりません",turn:"ターン",latest:"最新",tokens:"Tokens",model:"モデル",cost:"コスト",copy:"プロンプトをコピー",copied:"コピーしました!",replay:"このターンを再生",toolCalls:"ツール呼び出し",step:"ステップ",roleSystem:"システムプロンプト",roleUser:"ユーザー",roleAssistant:"アシスタント",roleTool:"ツールの結果"},k1t={preview:"プレビュー",edit:"編集",switchToPreview:"解決済みプロンプトをプレビュー",switchToEdit:"編集に切り替え",refresh:"更新",sampleData:"サンプルデータ(会話なし)",disclaimerReal:"プレビューは実際の会話データを使用してQuteエンジンで処理します。",disclaimerSample:"プレビューはサンプルデータを使用してQuteエンジンで処理します。実際の値を確認するには会話を選択してください。",resolvedPrompt:"解決済みプロンプト",copy:"コピー",copied:"コピーしました!",error:"テンプレート解決エラー",loading:"テンプレートを解決中…",availableVariables:"利用可能な変数",copyVariable:"クリックして変数参照をコピー",varProperties:"プロパティ",varMemory:"メモリ",varContext:"コンテキスト",varSnippets:"スニペット",varUserInfo:"ユーザー情報",varConversationInfo:"会話情報",varInput:"入力",varConversationLog:"会話ログ"},N1t={title:"エージェントスタジオ",subtitle:"1つのワークスペースでエージェントを構築、テスト、デバッグ",pipeline:"パイプライン",editor:"エディタ",debug:"デバッグ・チャット",selectStage:"パイプラインのステージをクリックしてエディタを開く",openInStudio:"スタジオで開く",loading:"エージェントを読み込み中...",notFound:"エージェントが見つかりません",hideChat:"チャットを隠す",showChat:"チャットを表示",openEditor:"エディタで開く",editorComingSoon:"インプレースエディタの統合は近日公開予定",noPipeline:"パイプラインのステージはありません",type:{parser:"パーサー",rules:"ルール",property:"プロパティセッター",apicalls:"API呼び出し",llm:"LLM",output:"出力","output.template":"出力テンプレート",mcpcalls:"MCP呼び出し",rag:"ナレッジベース",dictionary:"辞書"},landingDescription:"エージェントを選択してビジュアルパイプラインエディター、デバッガー、ライブチャットを開く",noAgents:"エージェントが見つかりません — エージェントページで作成してください",chat:"チャット",backToAgent:"エージェント詳細に戻る",selectStageHint:"パイプライン内の拡張を選択して、設定をインラインで表示・編集",noConfig:"このパイプラインステージには設定URIがありません",unsupportedType:"この拡張タイプのエディターは利用できません"},E1t={general:"一般",kbName:"ナレッジベース名",kbNamePlaceholder:"例: product-docs、faq、internal-wiki",kbNameHint:"LLMタスクからこのKBを参照するために使用します",embeddingModel:"埋め込みモデル",provider:"プロバイダー",embeddingParams:"プロバイダーパラメーター",embeddingParamsHint:"モデル名、APIキー(シークレットには${vault:...}を使用)、ベースURLなど",vectorStore:"ベクターストア",storeType:"ストアタイプ",storeParams:"接続パラメーター",chunking:"ドキュメントチャンク",chunkStrategy:"戦略",chunkSize:"チャンクサイズ",chunkOverlap:"チャンクのオーバーラップ",overlapHint:"オーバーラップはチャンク間のコンテキストを維持するのに役立ちます",chunkPreview:"プレビュー(ドキュメントがどのように分割されるか)",chunkBlocks:"{{count}}チャンク、約{{size}}文字、{{overlap}}文字のオーバーラップ",retrievalDefaults:"検索のデフォルト設定",retrievalHint:"これらのデフォルト値は、LLM構成のタスクごとにオーバーライドできます。",maxResults:"最大結果 (top-K)",minScore:"最小類似度スコア",ingestion:"ドキュメントの取り込み",dropFiles:"ここに取り込むドキュメントをドロップします",dropHint:"テキスト、Markdown、または任意のテキストベースのファイル",browse:"参照",pasteText:"またはテキストを貼り付けます",pastePlaceholder:"ここにドキュメントのテキストを貼り付けてください...",ingestText:"テキストを取り込む",ingestionHistory:"取り込みステータス",saveFirstIngestion:"ドキュメントの取り込みを有効にするには、先にこのナレッジベースを保存してください。",addParam:"パラメーターの追加"},L1t={welcome:{title:"EDDIへようこそ",subtitle:"AIエージェントのコマンドセンター",introText:"EDDI Managerは、会話型AIエージェントの構築、テスト、運用のためのコマンドセンターです。",capabilitiesTitle:"できること",capabilitiesSubtitle:"本番環境対応のAIエージェントを作成するために必要なすべて",buildAgents:"エージェントを構築",buildAgentsDesc:"ウィザードを使用するか、ゼロからAIエージェントを作成して構成します",designWorkflows:"ワークフローの設計",designWorkflowsDesc:"動作ルール、LLMチェーン、およびツールを備えたドラッグアンドドロップのパイプラインビルダー",testRealtime:"リアルタイムでテスト",testRealtimeDesc:"ストリーミング応答と組み込みデバッグを使用して、エージェントとチャットします",monitorOperate:"監視と運用",monitorOperateDesc:"会話、監査証跡、シークレット、クォータなどを1か所で管理",readyTitle:"準備はできましたか?",readySubtitle:"サイドバーの「ヘルプ」メニューからいつでもツアーを再開できます",startTour:"ツアーを開始",exploreOwn:"自分で探索する"},tour:{back:"戻る",next:"次へ",skip:"ツアーをスキップ",finish:"完了",stepOf:"ステップ {{current}} / {{total}}",dashboard:{title:"ダッシュボード ツアー",step1Title:"あなたのコマンドセンター",step1Desc:"サイドバーは、管理、開発、運用の3つのゾーンに整理されています。どこに何があるか常に分かります。",step2Title:"プラットフォームの概要",step2Desc:"エージェント、ワークフロー、会話のライブ数が表示されます。カードをクリックすると、そのセクションに直接ジャンプします。",step3Title:"クイックアクション",step3Desc:"一般的なタスクに直接ジャンプします。Agent Wizardは最初のエージェントを作成する最速の方法です。2分以内で完了します。",step4Title:"自分好みにカスタマイズ",step4Desc:"ライト、ダーク、システムテーマを切り替えます。EDDI Managerは11の言語をサポートしています。言語セレクターからお選びください。"},agents:{title:"エージェント ツアー",step1Title:"エージェントウィザード",step1Desc:"ウィザードの案内に従って、完全に構成されたエージェントを作成します。モデルを選択し、パーソナリティを設定し、ツールを有効にしてデプロイします。",step2Title:"手動作成",step2Desc:"パワーユーザー向け:空のエージェントを作成し、JSONで完全に制御して構成します。高度なセットアップに最適です。",step3Title:"検索とフィルター",step3Desc:"名前でエージェントを即座に見つけることができます。右側のトグルでカードビューとリストビューを切り替えます。",step4Title:"エージェントのリスト",step4Desc:"各カードには、エージェントの名前、バージョン、および最終更新日時が表示されます。任意のエージェントをクリックすると、デプロイ、チャット、およびワークフロー制御を持つ詳細ページが表示されます。"},workflows:{title:"ワークフロー ツアー",step1Title:"ワークフローの作成",step1Desc:"ワークフローは、LLM呼び出し、動作ルール、HTTP統合などのタスクのシーケンスである処理パイプラインを定義します。",step2Title:"あなたのワークフロー",step2Desc:"各ワークフローは1つ以上のエージェントにアタッチできます。クリックしてドラッグアンドドロップのパイプラインエディタを開きます。",step3Title:"ビューの整理",step3Desc:"名前で検索し、カードグリッドとソート可能なテーブルビューを切り替えます。"},chat:{title:"チャット ツアー",step1Title:"エージェントを選択",step1Desc:"デプロイされたエージェントを選択して会話を開始します。デプロイされたエージェントのみがここに表示されます。",step2Title:"ストリーミングモード",step2Desc:"リアルタイムトークンストリーミングを切り替えます。有効にすると、応答が単語ごとに表示され、レイテンシのデバッグに最適です。",step3Title:"会話の履歴",step3Desc:"サイドバーを開いて、以前の会話を閲覧して再開します。",step4Title:"チャットの開始",step4Desc:"メッセージを入力してEnterキーを押します。エージェントは構成したワークフロー、ツール、LLMを使用して応答します。"},channels:{title:"チャンネル",subtitle:"エージェントやグループをSlackなどに接続"},resources:{title:"リソース ツアー",step1Title:"拡張ライブラリ",step1Desc:"リソースはワークフローの構成要素です。それぞれのタイプがエージェントの動作の異なる部分を制御します。",step2Title:"LLM 構成",step2Desc:"エージェントを機能させるAIモデルを定義し、システムプロンプト、ツール、MCPサーバー、およびカスケード設定などを含みます。これがエージェントの頭脳です。",step3Title:"ルールとAPI呼び出し",step3Desc:"動作ルール(Rules)は会話のフローを制御します。HTTP呼び出し(HTTP Calls)は外部APIに接続します。どちらもLLMのツールとして使用できます。"},conversations:{title:"会話 ツアー",step1Title:"検索",step1Desc:"ID、エージェント、過去のユーザーメッセージを入力して、会話を素早く検索します。",step2Title:"ステータス フィルター",step2Desc:"会話を状態(アクティブ、進行中、終了、エラー)でフィルターします。",step3Title:"会話リスト",step3Desc:"すべてのセッションを閲覧できます。会話カードをクリックすると、タイムラインが開かれ、デバッグができます。"},groups:{title:"ディスカッショングループ ツアー",step1Title:"グループを作成",step1Desc:"オーケストレーショングループを作成し、複数のエージェントが協力して議論できるようにします。",step2Title:"グループ検索",step2Desc:"既存のマルチエージェントグループを検索します。",step3Title:"グループ一覧",step3Desc:"共同環境を管理し、ポリシーを編集し、不要になったグループを削除します。"},logs:{title:"システムログ ツアー",step1Title:"ライブと履歴",step1Desc:"システムログのリアルタイムストリームと、履歴ログの検索を切り替えます。",step2Title:"ストリーム フィルター",step2Desc:"エージェント別や重大なログレベルで、入ってくるライブストリームをフィルタリングします。",step3Title:"エクスポート",step3Desc:"外部で分析するために、現在のフィルタリングされたログをテキストファイルとしてダウンロードします。"},secrets:{title:"シークレットボルト ツアー",step1Title:"シークレットの作成",step1Desc:"エージェントが参照できる新しいAPIキー、トークン、またはパスワードを安全に保存します。",step2Title:"テナントの分離",step2Desc:"ボルトの表示をフィルタリングして、特定のテナントIDにスコープされたシークレットのみを表示します。",step3Title:"参照構文",step3Desc:"ハードコーディングせずに、シークレットをLLM構成に動的に注入する方法(${vault:...})を確認します。"},audit:{title:"監査台帳 ツアー",step1Title:"検索モード",step1Desc:"特定の会話IDや特定のエージェントバージョンで、変更不可の監査台帳を検索します。",step2Title:"検索の実行",step2Desc:"IDを入力して検索ボタンをクリックし、検証可能な実行履歴を引き出します。",step3Title:"台帳のエクスポート",step3Desc:"コンプライアンスやレポート作成の目的で、取得した監査記録をJSONにエクスポートします。"},schedules:{title:"スケジュール ツアー",step1Title:"スケジュールの作成",step1Desc:"エージェントのワークフローを自動的にトリガーする新しいクーロンジョブまたは継続的なハートビートを設定します。",step2Title:"状態の統計",step2Desc:"プラットフォーム全体での合計数、アクティブ数、および失敗したスケジュールを監視します。",step3Title:"スケジュール管理",step3Desc:"一時停止、再開、編集、テスト実行など、自動化トリガーを直接管理します。"},quotas:{title:"クォータ ツアー",step1Title:"構成の制限",step1Desc:"このテナントの合計エージェント数、1日の会話数、トークンコストに対するハードリミットを定義します。",step2Title:"使用量の分析",step2Desc:"テナントが割り当てられたクォータをどれだけ消費しているかをリアルタイムで監視します。",step3Title:"変更の適用",step3Desc:"調整した制限を保存します。プラットフォームは、この上限を超えるトラフィックをブロックします。"},coordinator:{title:"コーディネーター ツアー",step1Title:"ライブ接続",step1Desc:"バックエンドのコーディネーターシステムに接続された状態とイベントソースを表示します。",step2Title:"キュー処理",step2Desc:"クラスター全体のリアルタイムのタスクキューとアクティブなジョブの実行を監視します。",step3Title:"デッドレター",step3Desc:"失敗したタスクを検査し、システムの安定性を維持するために体系的に破棄または再試行します。"},orphans:{title:"孤立オブジェクト ツアー",step1Title:"スキャンのトリガー",step1Desc:"プラットフォームのスキャンを開始し、どのエージェントからも切断された無関係な設定を検出します。",step2Title:"論理削除を含める",step2Desc:"完全削除の対象に、過去に論理削除(ソフトデリート)されたレコードを含めるように切り替えることもできます。",step3Title:"確認とパージ",step3Desc:"スキャナーのレポートを確認し、不要なオブジェクトを選択してデータベースのスペースを確保するために不可逆的にパージします。"}},help:{title:"ヘルプとツアー",platformTour:"プラットフォーム ツアー",resetAll:"すべてのツアーをリセット",resetConfirm:"すべてのツアーの進捗をリセットしますか?"},offer:{message:"初めての方へ:{{page}}ツアーを見る",accept:"表示する",dontAsk:"今後表示しない"}},D1t={status:"プラットフォーム状態",online:"オンライン",offline:"オフライン",checking:"接続確認中…",connected:"接続済み",disconnected:"切断",instance:"インスタンス",latency:"レイテンシ",lastChecked:"最終確認",justNow:"たった今",secondsAgo:"{{count}}秒前"},T1t={live:"ライブ",reconnecting:"再接続中…"},I1t={title:"新規 {{type}}",newAgent:"新規エージェント",newGroup:"新規グループ",quickCreate:"クイック作成",quickCreateTitle:"クイック作成 {{type}}",quickCreateDesc:"名前と説明を設定し、詳細は後で設定します。",guidedSetup:"ガイド付きセットアップ",guidedSetupDesc:"LLMプロバイダー、プロンプトを含むステップバイステップのウィザード。"},A1t={empty:"グループはまだありません",emptyDescription:"グループを使用すると、複数のエージェントが構造化されたディスカッションで協力できます。",createGroup:"グループ作成",unnamed:"名称未設定のグループ",count_one:"{{count}} グループ",count_other:"{{count}} グループ",confirmDelete:"このグループを削除しますか?",confirmDeleteDesc:"グループの設定が完全に削除されます。",duplicateSuccess:"グループを複製しました",noDescription:"No description",members:"members",discussionStyle:"Discussion Style",maxRounds:"Max Rounds"},R1t={title:"ユーザーメモリ",subtitle:"エージェントが保存した永続的なユーザーメモリを閲覧・管理",userIdPlaceholder:"ユーザーIDを入力…",searchPlaceholder:"メモリを検索…",enterUserId:"ユーザーIDを入力してメモリを閲覧",totalEntries:"合計エントリ数",preferences:"好み",facts:"事実",conflicts:"矛盾",cat_all:"すべて",cat_preference:"好み",cat_fact:"事実",cat_context:"コンテキスト",deleteAll:"すべて削除",deleteAllTitle:"すべてのメモリを削除",deleteAllDesc:"このユーザーのすべてのメモリエントリが完全に削除されます。この操作は取り消せません。",deleteAllConfirm:"すべて削除",entryDeleted:"メモリエントリを削除しました",allDeleted:"ユーザーのすべてのメモリを削除しました",noResults:"メモリエントリが見つかりません",value:"値",sourceAgent:"ソースエージェント",accessCount:"アクセス数",created:"作成日",updated:"更新日",sourceConversation:"ソース会話",conflicted:"矛盾あり"},M1t={title:"ユーザープロパティ",subtitle:"ユーザーごとに保存されたlongTermプロパティを閲覧・管理",userIdPlaceholder:"ユーザーIDを入力…",searchPlaceholder:"プロパティを絞り込み…",enterUserId:"ユーザーIDを入力してプロパティを表示",key:"キー",type:"タイプ",value:"値",deleteAll:"すべて削除",deleteAllTitle:"すべてのプロパティを削除",deleteAllDesc:"このユーザーのすべてのプロパティが完全に削除されます。",deleted:"プロパティを削除しました",noResults:"プロパティが見つかりません",showingCount:"{{count}}件のプロパティ"},P1t={title:"エージェントトリガー",subtitle:"インテントをエージェントデプロイメントにマッピングして自動ルーティング",create:"新規トリガー",createTitle:"トリガーを作成",editTitle:"トリガーを編集",intent:"インテント",deployments:"エージェントデプロイメント",addDeployment:"エージェントを追加",agents:"エージェント",empty:"トリガーはまだ設定されていません",created:"トリガーを作成しました",updated:"トリガーを更新しました",deleted:"トリガーを削除しました",deleteTitle:"トリガーを削除",deleteDesc:"インテント「{{intent}}」のトリガーを完全に削除しますか?",searchPlaceholder:"インテントまたはエージェントIDで絞り込み…"},O1t={title:"ケイパビリティ検出",subtitle:"宣言されたスキルとケイパビリティでエージェントを検出",searchPlaceholder:"スキルを検索…",strategyHighest:"最高信頼度",strategyAll:"すべての一致",registeredSkills:"登録済みスキル",noSkills:"スキルが見つかりません",matchingAgents:"一致するエージェント",noMatches:"このスキルに一致するエージェントはありません"},j1t={title:"エージェントをエクスポート",loading:"リソースツリーを読み込み中...",selectResources:"エクスポートするリソースを選択",required:"必須",snippets:"スニペット",allSelected:"すべてのリソースを選択しました",countSelected:"{{total}}件中{{count}}件のリソースを選択",exportSelected:"選択した項目をエクスポート"},F1t={title:"エージェントのインポート",dropZone:"ここに.zipファイルをドロップするか、クリックして参照",dropZoneHint:"エクスポートされたエージェントのアーカイブ (.zip)",strategyLabel:"インポート戦略",createNew:"新しいエージェントとして作成",createNewDesc:"新しいIDで新しいコピーを作成します。初回インポートに最適です。",mergeSync:"既存とマージ / 同期",mergeSyncDesc:"インポート済みの場合は既存のリソースを更新します。見つからない場合は新規作成します。",upgradeExisting:"既存のエージェントをアップグレード",upgradeDesc:"リソースをターゲットエージェントと構造的にマッチングします。環境間の昇格に最適です。",syncRemote:"リモートインスタンスから同期",syncDesc:"別のEDDIインスタンスに接続し、特定のエージェントをライブで同期します。",importNow:"今すぐインポート",previewChanges:"変更をプレビュー",selectTargetAgent:"ターゲットエージェントを選択",upgradeTargetHint:"インポートされたリソースはこのエージェントと構造的にマッチングされます。",chooseAgent:"— エージェントを選択 —",sourceAgent:"ソースエージェント (リモート)",targetAgent:"ターゲットエージェント (ローカル)",createNewTarget:"新規エージェントを作成",resource:"リソース",type:"タイプ",match:"マッチ",action:"アクション",new:"新規",updated:"更新済み",unchanged:"変更なし",selected:"選択済み",mergeNow:"選択した項目をインポート",syncNow:"今すぐ同期",upgradeNow:"今すぐアップグレード",importing:"エージェントをインポート中...",contentIdentical:"同一コンテンツ",targetContent:"ターゲット",sourceContent:"ソース"},B1t={title:"エージェントの同期",subtitle:"EDDIインスタンス間でエージェントを同期する",connection:"ソースインスタンス",sourceUrl:"ソースEDDIインスタンスのURL",authToken:"認証トークン",authHint:"任意。X-Source-Authorization ヘッダに設定。",connect:"接続",connected:"接続済み",agentsFound:"エージェント",connectionFailed:"接続失敗",agentMapping:"エージェントのマッピング",previewAll:"すべてプレビュー",syncSelected:"選択した項目を同期",remote:"リモート",createNew:"新規作成",changes:"変更点",agentsSelected:"選択中のエージェント",totalResources:"リソース",syncSuccess:"同期完了",syncError:"同期エラー",empty:"エージェント同期を開始するには、ソースインスタンスに接続してください。",autoMatched:"自動マッチ",previewFirst:"同期前に変更をプレビュー"},H1t={actionCreate:"新規",actionUpdate:"更新",actionSkip:"最新です",actionConflict:"競合"},W1t={title:"ユーザー会話",subtitle:"インテント→ユーザー→会話のバインディングを管理",lookup:"検索",intent:"インテント",userId:"ユーザーID",agentId:"エージェントID",environment:"環境",conversationId:"会話ID",binding:"アクティブバインディング",enterBoth:"インテントとユーザーIDを入力",notFound:"バインディングが見つかりません",create:"バインディング作成",createTitle:"バインディング作成",created:"バインディングを作成しました",deleteTitle:"バインディング削除",deleteDesc:'インテント"{{intent}}"とユーザー"{{userId}}"のバインディングを削除しますか?',deleted:"バインディングを削除しました"},V1t={placeholder:"ページ、エージェント、操作を検索…",noResults:"結果が見つかりません。",recent:"最近",navigate:"ナビゲーション",agents:"エージェント",actions:"クイック操作",createAgent:"新しいエージェントを作成",openChat:"チャットを開く",kbdNavigate:"移動",kbdSelect:"選択",kbdClose:"閉じる"},z1t={title:"Group Setup Wizard",subtitle:"Assemble a team of AI advisors to discuss your questions",backToGroups:"Back to Groups",templateTitle:"Start from a template",templateDesc:"Choose a preset group configuration or start from scratch.",startBlank:"Start from Scratch",blankDesc:"Configure everything manually",configTitle:"Group Configuration",configDesc:"Name your group and choose how the agents will discuss",namePlaceholder:"e.g. Advisory Board",descPlaceholder:"What is this group for?",membersTitle:"Assemble Your Team",membersDesc:"For each seat, choose an existing agent or create a new one on the fly.",addMember:"Add Member",refreshAgents:"Refresh agent list",existingAgents:"existing agents",displayName:"Agent Name",displayNamePlaceholder:"Give this agent a name…",rolePlaceholder:"Role (e.g. Marketing, Engineering)",useExisting:"Use Existing",createNew:"Create New",selectAgent:"Select agent…",systemPrompt:"System Prompt",provider:"LLM Provider",model:"Model",apiKey:"API Key",apiKeyPlaceholder:"sk-…",createThisAgent:"Create Agent",creatingAgent:"Creating agent…",agentReady:"Agent created & deployed",agentCreated:'Agent "{{name}}" created',agentCreateFailed:"Failed to create agent: {{error}}",moderator:"Moderator",moderatorHint:"Synthesizes the discussion",addModerator:"Add Moderator",removeModerator:"Remove moderator",createModerator:"Create Moderator Agent",moderatorReady:"Moderator agent ready",moderatorCreated:"Moderator agent created",creatingModerator:"Creating moderator…",creatingSlot:"Creating {{name}}…",creatingGroup:"Creating group…",needMembers:"Add at least 2 members to proceed",reviewTitle:"Review & Create",reviewDesc:"Review your group configuration before creating.",reviewMembers:"Members",autoCreateNotice:"{{count}} agents will be auto-created when you click Create Group",autoCreateHint:"Each agent will be created and deployed automatically before the group is assembled.",unassignedWarning:"{{count}} members set to 'Use Existing' but no agent selected",unassignedHint:"These members will be skipped during discussions. Go back to assign agents.",flowPreview:"Discussion Flow",createGroup:"Create Group",created:"Group Created!",viewGroup:"Open Group",createAnother:"Create Another",success:"Group created successfully!"},U1t={advisoryBoard:"Advisory Board",advisoryBoardDesc:"A panel of expert advisors consulting on strategic decisions.",codeReview:"Code Review Panel",codeReviewDesc:"Structured code review with independent opinions, peer critique, and revision.",riskAssessment:"Risk Assessment",riskAssessmentDesc:"A panel with a devil's advocate who challenges assumptions.",forecasting:"Forecasting Panel",forecastingDesc:"Delphi-style anonymous deliberation for unbiased estimates.",proCon:"Pro/Con Debate",proConDesc:"Formal debate with pro and con teams arguing their positions.",roles:{marketingExpert:"Marketing Expert",techLead:"Tech Lead",financeDirector:"Finance Director",legalCounsel:"Legal Counsel",strategyConsultant:"Strategy Consultant",seniorEngineer:"Senior Engineer",architect:"Architect",securityReviewer:"Security Reviewer",riskAnalyst:"Risk Analyst",domainExpert:"Domain Expert",devilsAdvocate:"Devil's Advocate",analystA:"Analyst A",analystB:"Analyst B",analystC:"Analyst C",analystD:"Analyst D",proAdvocate1:"Pro Advocate 1",proAdvocate2:"Pro Advocate 2",conAdvocate1:"Con Advocate 1",conAdvocate2:"Con Advocate 2"}},$1t={agentIdPlaceholder:"メッセージを処理するエージェント ID",botToken:"ボットトークン",botTokenHint:"ボットユーザー OAuth トークン。セキュリティのためにボールト参照を使用してください。",botTokenPlaceholder:"xoxb-… または ${vault:slack-bot-token}",channel:"チャネル",channelId:"Slack チャネル ID",channelIdCol:"チャネル ID",channelIdHint:"Slack チャネルを右クリック → チャネル詳細を表示 → チャネル ID をコピー",channelsPlural:"チャネル",channelType:"チャネルタイプ",confirmDelete:"チャネルを削除しますか?",confirmDeleteDesc:"このチャネル統合は完全に削除されます。",create:"チャネルを作成",createTitle:"チャネル統合を作成",defaultAgentId:"デフォルトエージェント ID",defaultTargetHint:"デフォルトターゲットはトリガーキーワードに一致しないすべてのメッセージを処理します。作成後にターゲットを追加できます。",empty:"チャネルはまだありません",emptyDesc:"チャネル統合を作成してエージェントを Slack に接続します。",name:"名前",namePlaceholder:"例: Engineering AI Hub",openSlackApps:"Slack アプリダッシュボードを開く",searchPlaceholder:"チャネルを検索…",signingSecret:"署名シークレット",signingSecretHint:"Slack アプリの基本情報ページから取得します。",signingSecretPlaceholder:"16進数文字列または ${vault:slack-signing-secret}",slackSetupGuide:"Slack セットアップガイド",slackSetupSummary:"Slack アプリを作成し、ボットトークンスコープ(app_mentions:read、chat:write、im:history、channels:history、groups:history)を設定し、資格情報をここに貼り付けてください。",target:"ターゲット",targets:"ターゲット",targetsCol:"ターゲット",type:"タイプ",unnamed:"名前なしチャネル",version:"バージョン"},q1t={addTarget:"ターゲットを追加",addTrigger:"トリガーを追加…",agentId:"エージェント ID",botToken:"ボットトークン",channelId:"Slack チャネル ID",cooldown:"クールダウン(秒)",general:"一般",groupId:"グループ ID",isDefault:"デフォルト",maxCost:"最大 $/日",maxDaily:"最大/日",name:"名前",observe:"監視",observeDesc:"受動的に監視し選択的に応答",observeKeywords:"トリガーキーワード",observeMimeTypes:"トリガー MIME タイプ",observeMode:"監視モード",observeSettings:"監視モード設定",platformConfig:"プラットフォーム設定",rawConfig:"生の設定",removeTarget:"削除",requiredEvents:"必要なイベントサブスクリプション:",requiredScopes:"必要なボットトークンスコープ:",setDefault:"デフォルトに設定",signingSecret:"署名シークレット",targetName:"名前",targets:"メッセージルーティングターゲット",targetType:"タイプ",triggerHint:"ユーザーが「キーワード: メッセージ」と入力するとこのターゲットにルーティングされます",triggerKeywords:"トリガーキーワード",triggers:"トリガー",type:"チャネルタイプ",webhookHint:"この URL を Slack アプリの Event Subscriptions → Request URL フィールドに貼り付けてください。",webhookUrl:"Webhook URL"},K1t={app:zyt,auth:Uyt,nav:$yt,theme:qyt,language:Kyt,pages:Gyt,common:Yyt,agents:Qyt,agentDetail:Xyt,wizard:Zyt,setupWizard:Jyt,packages:e1t,packageDetail:t1t,packageEditor:n1t,conversations:i1t,conversationDetail:s1t,chat:r1t,resources:o1t,editor:a1t,rulesEditor:l1t,apiCallsEditor:c1t,llmEditor:d1t,outputEditor:u1t,propertySetterEditor:h1t,dictionaryEditor:g1t,coordinator:f1t,contentEditor:p1t,logs:m1t,secrets:b1t,audit:x1t,schedules:v1t,debugDrawer:_1t,costDashboard:y1t,memoryInspector:w1t,logViewer:C1t,promptViewer:S1t,promptPreview:k1t,studio:N1t,ragEditor:E1t,onboarding:L1t,platform:D1t,stream:T1t,createOrWizard:I1t,groups:A1t,memories:R1t,properties:M1t,triggers:P1t,capabilities:O1t,exportDialog:j1t,importDialog:F1t,syncPage:B1t,sync:H1t,userConversations:W1t,commandPalette:V1t,groupWizard:z1t,groupTemplates:U1t,channels:$1t,channelDetail:q1t},G1t={title:"EDDI Manager",description:"EDDI 대화형 AI 플랫폼 관리 대시보드"},Y1t={login:"로그인",logout:"로그아웃",loading:"인증 중…",sessionExpired:"세션이 만료되었습니다. 다시 로그인해 주세요.",profile:"프로필",guest:"게스트",userMenu:"사용자 메뉴"},Q1t={dashboard:"대시보드",agents:"에이전트",packages:"워크플로",conversations:"대화",coordinator:"코디네이터",schedules:"스케줄",logs:"로그",orphans:"고아 항목",secrets:"시크릿",audit:"감사 로그",quotas:"할당량",groups:"그룹",chat:"채팅",resources:"리소스",sectionManagement:"관리",sectionDevelopment:"개발",sectionOperations:"운영",mainNavigation:"메인 탐색",openMenu:"탐색 메뉴 열기",sectionCore:"핵심",sectionBuild:"빌드 & 테스트",sectionMonitor:"모니터링",sectionAdmin:"관리",studio:"스튜디오",gdpr:"개인정보 보호",memories:"사용자 메모리",properties:"속성",triggers:"트리거",capabilities:"기능",sync:"동기화",channels:"채널",userConversations:"사용자 대화",userData:"사용자 데이터",variables:"변수"},X1t={light:"라이트",dark:"다크",system:"시스템"},Z1t={label:"언어",en:"English",de:"Deutsch",fr:"Français",es:"Español",ar:"العربية",zh:"中文",th:"ไทย",ja:"日本語",ko:"한국어",pt:"Português",hi:"हिन्दी"},J1t={dashboard:{title:"대시보드",subtitle:"EDDI Agents 및 대화 개요",activeAgents:"활성 Agents",totalWorkflows:"워크플로",totalResources:"리소스",totalConversations:"대화",quickActions:"빠른 작업",recentAgents:"최근 Agents",noRecentAgents:"아직 Agent가 없습니다. 첫 번째 Agent를 만들어 보세요!"},agents:{title:"에이전트",subtitle:"대화형 AI Agents 관리"},packages:{title:"워크플로",subtitle:"Workflows 및 확장 기능 구성"},conversations:{title:"대화",subtitle:"Agent 대화 보기 및 관리"},resources:{title:"리소스",subtitle:"동작 규칙, 사전, 출력 세트 등 관리"},chat:{title:"채팅",subtitle:"배포된 Agent와 대화"},channels:{title:"채널",subtitle:"에이전트와 그룹을 Slack 같은 메시징 플랫폼에 연결"},groups:{title:"그룹",subtitle:"구조화된 토론과 협업을 위한 다중 Agent 토론 그룹"}},ewt={loading:"로딩 중...",error:"오류가 발생했습니다",retry:"재시도",save:"저장",cancel:"취소",delete:"삭제",create:"생성",edit:"편집",search:"검색...",noResults:"결과를 찾을 수 없습니다",duplicate:"복제",close:"닫기",skipToMain:"주요 콘텐츠로 건너뛰기",opensNewTab:"새 탭에서 열기",moreActions:"더 많은 작업",sortByName:"이름순 정렬",sortByVersion:"버전순 정렬",sortByModified:"수정일순 정렬",apply:"적용",copied:"복사됨",copy:"복사",saving:"저장 중…",showMore:"Show More",showLess:"Show Less",copyFailed:"클립보드 복사 실패"},twt={deploy:"배포",undeploy:"배포 해제",createAgent:"Agent 생성",createTitle:"새 Agent 생성",name:"이름",namePlaceholder:"내 Agent",description:"설명",descriptionPlaceholder:"이 Agent의 기능을 설명하세요...",empty:"아직 Agent가 없습니다. 첫 번째 Agent를 만들어 보세요!",confirmDelete:"이 Agent를 삭제하시겠습니까?",count_one:"{{count}}개 에이전트",count_other:"{{count}}개 에이전트",export:"내보내기",exporting:"내보내는 중...",exportSuccess:"Agent가 성공적으로 내보내졌습니다",import:"Agent 가져오기",importing:"가져오는 중...",importSuccess:"Agent가 성공적으로 가져와졌습니다",importError:"Agent 가져오기 실패",emptyDescription:"위자드를 사용하여 몇 분 만에 완전히 구성된 Agent를 만드세요.",chat:"채팅",deployAndChat:"배포 후 채팅",openExternalChat:"새 탭에서 열기"},nwt={title:"Agent 상세",backToAgents:"Agents로 돌아가기",packages:"워크플로",noWorkflows:"아직 Workflows가 추가되지 않았습니다",addWorkflow:"Workflow 추가",selectWorkflow:"추가할 Workflow 선택",rawConfig:"원시 구성",editName:"이름 편집",editDescription:"설명 편집",clickToEdit:"클릭하여 편집",noDescription:"설명 없음",duplicate:"복제",duplicating:"복제 중...",duplicateSuccess:"Agent가 성공적으로 복제되었습니다",environments:"환경",envProduction:"프로덕션",envTest:"테스트",savingAgent:"Agent 저장 중...",savedAgent:"Agent가 성공적으로 저장되었습니다",saveError:"Agent 저장 실패",deployToEnv:"{{env}}에 배포",undeployFromEnv:"{{env}}에서 제거",openStudio:"스튜디오에서 열기",maxKeyLength:"최대 키 길이",maxValueLength:"최대 값 길이",maxWritesPerTurn:"턴당 최대 쓰기 횟수",dreamSchedule:"일정 (cron)",dreamLlmProvider:"LLM 제공자",dreamLlmModel:"LLM 모델",dreamMaxCost:"실행당 최대 비용 ($)",dreamPruneDays:"정리 주기 (일)",dreamBatchSize:"배치 크기",detectContradictions:"모순 감지",summarizeInteractions:"상호작용 요약",confidenceLow:"낮음",confidenceMedium:"중간",confidenceHigh:"높음",visibilitySelf:"자신만",visibilityGlobal:"전체",onCapEvict:"가장 오래된 항목 제거",onCapReject:"거부",recallMostRecent:"최근순",recallMostRelevant:"관련도순",channels:"채널 커넥터",channelsDesc:"이 에이전트를 Slack 채널에 연결합니다. 각 채널 커넥터는 자체 자격 증명으로 독립적으로 구성되며 다중 워크스페이스 설정을 지원합니다.",noChannels:"구성된 채널 없음",noChannelsDesc:"Slack 채널을 추가하여 사용자가 Slack에서 이 에이전트와 상호작용할 수 있게 합니다.",addSlackChannel:"Slack 채널 추가",slackChannel:"Slack 채널",removeChannel:"채널 제거",removeChannelConfirm:"이 Slack 채널 커넥터를 제거하시겠습니까?",removeChannelDesc:"This action will permanently disconnect this channel.",channelId:"채널 ID",channelIdHint:"채널 ID는 C로 시작하고 대문자 영숫자 문자가 뒤따릅니다",botToken:"봇 토큰",botTokenPlaceholder:"xoxb-… 또는 ${vault:slack-bot-token}",botTokenHint:"Slack Bot User OAuth 토큰. 보안을 위해 볼트 참조를 사용하세요.",signingSecret:"서명 시크릿",signingSecretPlaceholder:"16진수 문자열 또는 ${vault:slack-signing-secret}",signingSecretHint:"Slack 앱의 기본 정보 페이지에서. 보안을 위해 볼트 참조를 사용하세요.",groupIdOptional:"그룹 ID (선택사항)",groupIdPlaceholder:"멀티 에이전트 그룹 구성 ID",groupIdHint:'이 Slack 채널에서 "group: 질문" 멀티 에이전트 토론을 활성화합니다.',slackSetupGuide:"Slack 설정 가이드",slackWebhookUrl:"Webhook URL",slackWebhookCopied:"Webhook URL 복사됨",slackStep1:"api.slack.com/apps에서 Slack 앱을 만들고 워크스페이스에 설치합니다.",slackStep2:"봇 토큰(xoxb-…)과 서명 시크릿을 EDDI 볼트에 복사하고 아래에서 채널을 구성합니다.",slackStep3:"그런 다음 Slack 앱에서 Event Subscriptions을 활성화하고 위의 Webhook URL을 붙여넣고 구독합니다:",slackSetupNote:"중요: Event Subscriptions을 활성화하기 전에 아래 채널을 구성하세요 — Slack은 EDDI에서 서명 시크릿이 구성되어 있어야 하는 URL 확인 챌린지를 보냅니다.",slackRequiredScopes:"필요한 봇 토큰 범위"},iwt={title:"Agent 마법사"},swt={title:"Agent 생성 마법사",subtitle:"몇 분 만에 완전히 구성된 Agent를 생성하세요",backToAgents:"Agents로 돌아가기",next:"다음",back:"이전",createOnly:"생성만",createAndDeploy:"생성 및 배포",typeTitle:"어떤 유형의 Agent를?",typeDesc:"생성할 Agent 유형을 선택하세요",standardAgent:"표준 에이전트",apiAgent:"API 에이전트",standardDesc:"도구, Quick Replies, 감정 분석을 갖춘 LLM 기반 대화형 AI",apiDesc:"OpenAPI/Swagger 사양을 가져와 API Agent를 자동 생성",infoTitle:"Agent 아이덴티티",infoDesc:"Agent에 이름과 개성을 부여하세요",agentName:"Agent 이름",namePlaceholder:"예: 고객 지원 봇",systemPrompt:"시스템 프롬프트",promptPlaceholder:"당신은 도움이 되는 AI 어시스턴트입니다...",promptHint:"이 지시가 Agent의 행동과 응답 방식을 결정합니다.",llmTitle:"LLM 구성",llmDesc:"Agent를 구동하는 AI 모델 선택",provider:"제공자",model:"모델",apiKey:"API 키",baseUrl:"기본 URL",baseUrlPlaceholder:"사용자 지정 엔드포인트 URL",optional:"선택 사항",apiSpecTitle:"OpenAPI 사양",apiSpecDesc:"API의 OpenAPI/Swagger 사양을 제공하세요",specByUrl:"URL",specByFile:"파일",specByPaste:"붙여넣기",fetch:"가져오기",specFetched:"사양이 로드되었습니다!",specFetchError:"사양 가져오기 실패",dropFile:"OpenAPI 파일을 여기에 드롭",dropHint:"JSON 또는 YAML 형식",browse:"파일 찾기",pasteSpec:"OpenAPI/Swagger JSON 또는 YAML을 여기에 붙여넣으세요...",specLoaded:"파일 로드 완료: {{name}}",specReady:"사양 로드 완료 ({{chars}}자)",apiBaseUrlLabel:"API 기본 URL",apiAuthLabel:"API 인증 헤더",endpointFilter:"Endpoint 필터",endpointFilterPlaceholder:"쉼표로 구분: GET /users, POST /orders",featuresTitle:"기능 및 옵션",featuresDesc:"Agent의 기능을 사용자 지정하세요",introMessage:"환영 메시지",introMessageDesc:"대화 시작 시 표시되는 인사말",quickReplies:"빠른 답변",quickRepliesDesc:"LLM이 클릭 가능한 답변 제안을 생성합니다",sentiment:"감정 분석",sentimentDesc:"사용자의 감정, 의도, 긴급도를 실시간으로 추적",structuredOutput:"구조화된 출력",structuredOutputDesc:"LLM이 일반 텍스트 대신 JSON 객체로 응답합니다",structuredOutputInfo:"이 기능을 활성화하면 LLM이 구조화된 필드가 포함된 JSON 객체로 응답합니다. JSON 스키마가 시스템 프롬프트에 추가되고 모델이 JSON 응답 모드로 설정됩니다.",builtInTools:"내장 도구",builtInToolsDesc:"EDDI의 내장 도구 라이브러리 활성화 (계산기, 날짜/시간 등)",toolsWhitelist:"화이트리스트 (비어있으면 = 전체)",mcpServers:"MCP 서버",mcpServersDesc:"외부 도구를 위한 Model Context Protocol 서버",autoDeploy:"자동 배포",autoDeployDesc:"생성 후 즉시 Agent 배포",environment:"환경",envProduction:"프로덕션",envTest:"테스트",reviewTitle:"검토 및 생성",reviewDesc:"생성 전에 구성을 검토하세요",reviewType:"유형",reviewName:"이름",reviewPrompt:"시스템 프롬프트",reviewProvider:"제공자",reviewModel:"모델",reviewSpec:"OpenAPI 사양",reviewIntro:"환영 메시지",reviewDeploy:"배포",success:"Agent가 성공적으로 생성되었습니다!",agentCreated:"Agent가 생성되었습니다!",deployed:"배포됨",endpointsParsed:"{{count}}개의 API endpoints 분석 완료",viewAgent:"Agent 보기",createAnother:"다른 Agent 생성",allTools:"모든 도구",selectSpecific:"직접 선택",allToolsInfo:"모든 {{count}}개 내장 도구가 에이전트에 제공됩니다. 「직접 선택」으로 활성화할 도구를 제한하세요.",availableTools:"사용 가능한 도구",toolCount:"{{total}}개 중 {{selected}}개 선택"},rwt={createWorkflow:"Workflow 생성",createTitle:"새 Workflow 생성",name:"이름",namePlaceholder:"내 Workflow",description:"설명",descriptionPlaceholder:"이 Workflow의 기능을 설명하세요...",noDescription:"설명 없음",empty:"아직 Workflow가 없습니다. 첫 번째 Workflow를 만들어 보세요!",confirmDelete:"이 Workflow를 삭제하시겠습니까?",count_one:"{{count}}개 워크플로",count_other:"{{count}}개 워크플로",emptyDescription:"워크플로는 에이전트의 처리 파이프라인을 정의합니다."},owt={title:"Workflow 상세",backToWorkflows:"Workflows로 돌아가기",extensions:"확장 기능",noExtensions:"이 Workflow에 확장 기능이 없습니다",rawConfig:"원시 구성"},awt={title:"Workflow 편집기",pipeline:"확장 Pipeline",addHint:"확장 기능을 추가하여 처리 Pipeline을 구축하세요",addHintDialog:"Pipeline에 추가할 확장 유형을 선택하세요",reorder:"확장 기능 순서 변경",saved:"Workflow가 성공적으로 저장되었습니다",saveError:"워크플로 저장 실패",noTasks:"이 워크플로에는 작업이 없습니다",addTask:"작업 추가"},lwt={searchPlaceholder:"대화 ID로 검색...",id:"대화",agent:"에이전트",state:"상태",lastActivity:"최근 활동",actions:"작업",empty:"아직 대화가 없습니다. Agent를 배포하고 채팅을 시작하세요!",confirmDelete:"이 대화를 삭제하시겠습니까?",count_one:"{{count}}개 대화",count_other:"{{count}}개 대화",emptyDescription:"에이전트를 배포하고 Chat 페이지에서 대화를 시작하세요."},cwt={continueChat:"채팅에서 계속",searchTranscript:"대화에서 검색…",exportMd:"Markdown으로 내보내기",toolSummary:"도구 사용 요약",totalCost:"총 비용",cacheHitRate:"캐시 적중률"},dwt={selectAgent:"Agent 선택...",noAgents:"배포된 Agent가 없습니다. 먼저 Agent를 배포하세요.",placeholder:"메시지 입력...",send:"전송",newConversation:"새 대화",endConversation:"대화 종료",streaming:"스트리밍",thinking:"생각 중...",connectionError:"연결 오류입니다. 다시 시도해 주세요.",empty:"Agent를 선택하고 채팅을 시작하세요!",history:"기록",undo:"마지막 메시지 취소",redo:"메시지 복원",continueConversation:"계속",noHistory:"대화 기록이 없습니다.",attach:"파일 첨부",attachUploading:"업로드 중...",attachSuccess:"파일 첨부됨",attachError:"파일 업로드 실패",retry:"마지막 단계 재시도",retrySuccess:"단계 재실행 완료",retryError:"재시도 실패",showActivity:"활동 표시",hideActivity:"활동 숨기기",scrollToBottom:"맨 아래로",copyMessage:"메시지 복사",copied:"복사됨!",activity:{processing:"처리 중…",steps:"단계",toolCalls:"도구 호출",toolCall:"도구 호출",toolResult:"결과"},channels:{title:"채널",subtitle:"에이전트와 그룹을 Slack 등 메시징 플랫폼에 연결"},context:{conversationId:"대화 ID",agentVersion:"에이전트 버전",startTime:"시작 시간",stepCount:"단계 수",show:"대화 정보 표시",hide:"대화 정보 숨기기"},agentTyping:"에이전트가 입력 중"},uwt={unnamed:"이름 없는 리소스",noDescription:"설명 없음",backToResources:"리소스로 돌아가기",backToList:"{{type}}(으)로 돌아가기",unknownType:"알 수 없는 리소스 유형",rawConfig:"원시 구성",rawConfigHint:"이 리소스의 JSON 구성",create:"{{type}} 생성",createTitle:"{{type}} 생성",createDescription:"빈 {{type}} 구성을 생성합니다. 생성 후 편집할 수 있습니다.",confirmDelete:"이 {{type}}을(를) 삭제하시겠습니까?",empty:"아직 {{type}} 리소스가 없습니다.",itemCount_one:"{{count}}개 항목",itemCount_other:"{{count}}개 항목",count_one:"{{count}}개 리소스",count_other:"{{count}}개 리소스",types:{rules:{name:"동작 규칙",description:"대화 흐름 규칙과 의사 결정 로직 정의"},apicalls:{name:"HTTP 호출",description:"외부 API 통합 및 Webhook 구성"},output:{name:"출력 세트",description:"응답 템플릿 및 출력 변형 관리"},dictionary:{name:"사전",description:"단어 및 구문 인식 패턴 정의"},llm:{name:"LLM",description:"AI 모델, Prompt, 도구 바인딩 구성"},propertysetter:{name:"속성 설정기",description:"대화 속성 설정 및 슬롯 채우기 관리"},mcpcalls:{name:"MCP 호출",description:"MCP 서버 연결 및 결정적 도구 호출 구성"},rag:{name:"지식 베이스",description:"문서 검색용 RAG 지식 베이스 구성"},snippets:{name:"프롬프트 스니펫",description:"Reusable system prompt building blocks"}},emptyDescription:"워크플로에서 사용할 첫 번째 {{type}}을(를) 만드세요."},hwt={formTab:"폼",jsonTab:"JSON",save:"저장",discard:"취소",saving:"저장 중...",saved:"성공적으로 저장되었습니다",saveError:"저장 실패",dirty:"저장되지 않은 변경 사항",version:"버전",versionPicker:"버전 선택",readOnly:"읽기 전용",formPlaceholder:"비주얼 편집기가 곧 제공됩니다. JSON 탭에서 편집하세요.",jsonSchema:"스키마 유효성 검사 활성",cascadeMode:"변경 사항이 상위 Workflow 및 Agent에 반영됩니다",usedInAgents:"{{count}}개의 Agent에서 사용 중",updateUsageHint:"선택한 Workflows와 Agents를 새 버전으로 업데이트하시겠습니까?",updateUsage:"선택 업데이트",skipUpdate:"건너뛰기",cascading:"업데이트 중...",cascadeSuccess:"캐스케이드 업데이트 완료",invalidJson:"잘못된 JSON — JSON 탭으로 전환하여 수정하세요."},gwt={appendActions:"작업 추가",expressionsAsActions:"표현식을 작업으로",groups:"동작 그룹",addGroup:"그룹 추가",groupName:"그룹 이름",executionStrategy:"실행 전략",rules:"규칙",addRule:"규칙 추가",ruleName:"규칙 이름",actions:"작업",noActions:"작업 없음",addAction:"추가",actionPlaceholder:"예: greet, get_weather",conditions:"조건",addCondition:"조건 추가",conditionType:"조건 유형",nestedConditions:"중첩 조건",configKey:"키",configValue:"값",addConfig:"구성 추가",removeRule:"규칙 제거",removeGroup:"그룹 제거",removeCondition:"조건 제거",noGroups:"동작 그룹이 정의되지 않았습니다",noRules:"이 그룹에 규칙이 없습니다",noConditions:"조건 없음"},fwt={targetServerUrl:"대상 서버 URL",targetServerUrlPlaceholder:"https://api.example.com",calls:"HTTP 호출",addCall:"HTTP 호출 추가",callName:"호출 이름",callDescription:"설명",descriptionPlaceholder:"LLM Agent를 위한 자연어 설명",request:"요청",method:"메서드",path:"경로",pathPlaceholder:"/api/endpoint",headers:"헤더",addHeader:"Header 추가",queryParams:"쿼리 매개변수",addQueryParam:"매개변수 추가",contentType:"콘텐츠 타입",body:"요청 본문",bodyPlaceholder:"JSON 본문 템플릿...",parameters:"매개변수 (LLM Agent용)",paramName:"매개변수 이름",paramDescription:"설명",addParam:"매개변수 추가",options:"옵션",saveResponse:"응답 저장",responseObjectName:"응답 객체 이름",responseHeaderObjectName:"응답 Header 객체 이름",fireAndForget:"비동기 전송",batchCalls:"배치 호출",iterationObjectName:"반복 객체 이름",prePostInstructions:"전/후 지시",preRequest:"요청 전",postResponse:"응답 후",removeCall:"호출 제거",noCalls:"구성된 HTTP 호출이 없습니다",actions:"트리거 작업",noActions:"작업 없음",actionPlaceholder:"예: get_weather"},pwt={tasks:"LLM 작업",addTask:"작업 추가",noTasks:"구성된 LangChain 작업이 없습니다",removeTask:"작업 제거",taskId:"작업 ID",description:"설명",descriptionPlaceholder:"이 작업의 기능",triggerActions:"트리거 작업",noActions:"작업 없음",actionPlaceholder:"예: help, chat",systemPrompt:"시스템 프롬프트",systemPromptPlaceholder:"당신은 도움이 되는 어시스턴트입니다...",modelParams:"모델 매개변수",addParam:"매개변수 추가",agentMode:"에이전트 모드",enableBuiltInTools:"내장 도구 활성화",toolWhitelist:"도구 화이트리스트 (비어있으면 = 전체)",enableHttpCallTools:"HTTP Call 도구 자동 검색",enableHttpCallToolsDesc:"Workflow의 모든 httpcall 확장을 LLM 도구로 자동 노출",httpCallTools:"HTTP 호출 도구 URI",httpCallToolsHint:"명시적 httpcall URIs (자동 검색 외)",addTool:"도구 URI 추가",mcpServers:"MCP 서버",mcpServersDesc:"외부 MCP 서버의 도구를 LLM에서 사용 가능하게 합니다",addMcpServer:"MCP 서버 추가",mcpUrlPlaceholder:"http://localhost:7070/mcp",mcpName:"이름",mcpApiKey:"API Key / Vault 참조",historyLimit:"기록 제한",historyLimitHint:"(-1 = 무제한)",budgetPerf:"예산 및 성능",maxBudget:"최대 예산 ($)",costTracking:"비용 추적",toolCaching:"도구 캐싱",rateLimiting:"속도 제한",defaultRate:"기본 속도 (요청/분)",prePostInstructions:"전/후 지시",preRequest:"요청 전",postResponse:"응답 후",enableMcpCallTools:"MCP 도구 자동 검색",enableMcpCallToolsDesc:"워크플로의 모든 mcpcalls 확장을 LLM 도구로 자동 노출",a2aAgents:"A2A 에이전트",a2aAgentsDesc:"스킬이 LLM 도구가 되는 A2A 호환 원격 에이전트",addA2aAgent:"A2A 에이전트 추가",a2aUrlPlaceholder:"https://remote.example.com/a2a/agents/...",a2aName:"표시 이름",a2aApiKey:"${vault:my-a2a-key}",a2aTimeout:"타임아웃 (ms)",a2aSkillsFilter:"스킬 필터 (비워두면 전체)",cascade:"모델 캐스케이드",cascadeDesc:"Try a cheap/fast model first. If confidence is too low, automatically escalate to a more powerful (and expensive) model.",cascadeEnable:"모델 캐스케이드 활성화",cascadeStrategy:"전략",strategyCascade:"순차 에스컬레이션",strategyParallel:"병렬 (향후)",cascadeStrategyHint:"저비용 모델부터 시도하고 신뢰도가 낮으면 에스컬레이션",cascadeEvalStrategy:"신뢰도 평가",cascadeEvalHint:"응답이 충분한지 판단하는 방법",evalStructured:"구조화된 출력 (JSON)",evalHeuristic:"휴리스틱 (망설임 감지)",evalJudge:"심판 모델 (보조 LLM)",evalNone:"없음 (항상 수락)",cascadeInAgent:"에이전트 모드(도구 사용)에서도 캐스케이드 적용",cascadeSteps:"Cascade Steps",cascadeStepsDesc:"Order matters: first step tried first. Last step is always accepted.",cascadeModelName:"예: claude-sonnet-4-6",cascadeConfidence:"Min. Confidence (0-1)",cascadeConfidencePlaceholder:"비워두면 항상 수락",cascadeTimeout:"타임아웃 (ms)",addCascadeStep:"캐스케이드 단계 추가",parallelExecution:"병렬 도구 실행",parallelExecutionDesc:"Run independent tool calls concurrently",parallelTimeout:"타임아웃 (ms)",maxToolIterations:"최대 도구 반복 횟수",maxToolIterationsHint:"(기본값 10)",toolRateLimits:"도구별 속도 제한",toolRateLimitsDesc:"Override default rate for specific tools",toolName:"도구 이름",addToolRate:"속도 제한 추가",retryConfig:"재시도 설정",retryDesc:"Configure automatic retries with exponential backoff.",retryMaxAttempts:"최대 시도 횟수",retryDelay:"초기 지연 (ms)",retryMultiplier:"백오프 배율",retryMaxDelay:"최대 지연 (ms)",ragConfig:"RAG (지식 검색)",ragDesc:"Augment LLM responses with retrieved documents.",ragHttpCall:"HTTP 호출 URI",ragEmbeddingModel:"임베딩 모델",ragEmbeddingModelPlaceholder:"예: text-embedding-3-small",ragEmbeddingStore:"임베딩 저장소",ragEmbeddingStorePlaceholder:"예: pgvector, qdrant",ragMaxResults:"최대 결과 수",ragMinScore:"Min Similarity Score (0-1)",moveDown:"아래로",moveUp:"위로",execution:"실행",budgetCosts:"예산 및 비용",preRequestDesc:"LLM 실행 전에 속성을 설정하거나 변환합니다.",postResponseDesc:"LLM 출력 처리: 속성 설정, 출력 메시지 빌드 및 빠른 답장 생성.",postPropertyInstructions:"속성 지침",postOutputInstructions:"출력 빌드 지침",postQrInstructions:"빠른 답장 빌드 지침",allSkills:"모든 스킬",skillPlaceholder:"예: order-tracking",modeAgent:"에이전트",modeChat:"채팅",perMinute:"/분",allTools:"모든 도구",selectSpecific:"직접 선택",allToolsInfo:"모든 {{count}}개 내장 도구가 LLM에 제공됩니다. 「직접 선택」으로 노출할 도구를 제한하세요.",availableTools:"사용 가능한 도구",toolCount:"{{total}}개 중 {{selected}}개 선택",toolSources:"워크플로 도구 소스",toolSourcesInfo:"기본적으로 두 소스 모두 활성화 — 워크플로의 모든 HTTP 호출 및 MCP 호출이 LLM 도구로 자동 노출됩니다. 소스를 비활성화하여 제외할 수 있습니다.",included:"포함됨"},mwt={language:"언어",langPlaceholder:"예: en, ko",outputSets:"출력 세트",addOutputSet:"출력 세트 추가",noOutputSets:"구성된 출력 세트가 없습니다",actionName:"작업 이름",timesOccurred:"×",removeOutput:"제거",outputs:"출력",alternativeGroup:"대안 그룹",addAlternative:"대안 추가",addOutputGroup:"출력 그룹 추가",textPlaceholder:"출력 텍스트...",urlPlaceholder:"URL…",delayMs:"지연 (ms)",quickReplies:"빠른 답변",noQuickReplies:"Quick Replies 없음",addQuickReply:"Quick Reply 추가",qrValue:"버튼 텍스트",qrExpressions:"표현식",default:"기본값"},bwt={setters:"속성 설정기",addSetter:"Setter 추가",noSetters:"구성된 Property Setter가 없습니다",removeSetter:"제거",triggerActions:"트리거 작업",noActions:"작업 없음",actionPlaceholder:"예: greet, fallback",properties:"속성",noProperties:"속성 없음",addProperty:"속성 추가",propName:"속성 이름",propValue:"값 / 표현식",fromPath:"소스 경로",fromObjectPath:"fromObjectPath",override:"덮어쓰기",propsCount:"속성",untitled:"(작업 없음)"},xwt={language:"언어",langPlaceholder:"예: en, ko",words:"단어",addWord:"단어 추가",wordPlaceholder:"예: 안녕하세요",phrases:"구문",addPhrase:"구문 추가",phrasePlaceholder:"예: 좋은 아침",regExs:"정규 표현식",addRegEx:"RegEx 추가",regexPlaceholder:"정규 표현식",expressionPlaceholder:"예: greeting(hello)",frequency:"빈도",none:"정의되지 않음"},vwt={title:"코디네이터 대시보드",subtitle:"대화 처리를 모니터링하고 Dead-Letter 항목을 관리합니다",type:"Coordinator 유형",connection:"연결",processed:"처리된 작업",deadLettered:"데드레터",activeQueues:"활성 큐",queued:"대기 중",deadLetterTitle:"데드레터 대기열",noDeadLetters:"Dead-Letter 항목 없음",colId:"ID",colConversation:"대화",colError:"오류",colTime:"시간",colActions:"작업",replay:"재생",discard:"폐기",purgeAll:"전체 삭제",confirmPurge:"전체 삭제하시겠습니까?",yes:"예",cancel:"취소",replaySuccess:"Dead-Letter가 재생되었습니다",replayError:"재생 실패",discardSuccess:"Dead-Letter가 폐기되었습니다",discardError:"폐기 실패",purgeSuccess:"모든 Dead-Letter 항목이 삭제되었습니다",purgeError:"삭제 실패",empty:"사용 가능한 Coordinator 데이터가 없습니다",emptyHint:"Coordinator 서비스가 아직 시작 중일 수 있습니다. 데이터가 자동으로 나타납니다."},_wt={expand:"확장",expandHint:"전체 화면 (Ctrl+Shift+F)",close:"완료",lines:"줄",chars:"문자",fullscreenTitle:"콘텐츠 편집기",fullscreenDescription:"전체 화면 편집기. Escape로 닫습니다."},ywt={title:"로그",description:"실시간 로그 스트림을 모니터링하거나 기록 로그를 검색합니다.",tabLive:"실시간",tabHistory:"기록",connected:"연결됨",disconnected:"연결 끊김",filterAgent:"에이전트 ID…",filterConversation:"대화 ID...",filterInstance:"인스턴스 ID...",allLevels:"전체 레벨",pause:"일시 정지",resume:"재개",clear:"지우기",search:"검색",waitingForLogs:"로그 대기 중...",connectingStream:"스트림에 연결 중...",noHistoryLogs:"기록 로그를 찾을 수 없습니다.",entryCount:"{{count}}개 항목",showStacktrace:"스택트레이스 표시 ({{count}} 프레임)",hideStacktrace:"스택트레이기 숨기기",allAgents:"모든 에이전트",allConversations:"모든 대화",waitingHint:"백엔드에서 스트리밍되는 로그가 여기에 표시됩니다.",noHistoryHint:"필터를 조정하거나 다른 에이전트 또는 대화를 검색해 보세요.",searchConversations:"ID, 에이전트, 사용자로 검색…",stepsCount:"{{count}} 단계",noConversationsFound:"대화를 찾을 수 없습니다",useConversationId:"ID 사용: {{id}}",searchLogs:"로그 검색…",errors:"오류",warnings:"경고",infos:"정보",debugs:"디버그",filteredCount:"{{shown}} / {{total}} 항목",copyEntry:"로그 항목 복사",export:"내보내기",stateReady:"준비",stateActive:"활성",stateError:"오류",stateEnded:"종료"},wwt={title:"시크릿 저장소",description:"Vault의 암호화된 Secrets를 관리합니다. 값은 노출되지 않습니다.",tenantId:"테넌트 ID",refresh:"Secrets 로드",create:"Secret 추가",createTitle:"Secret 추가",keyName:"키 이름",keyNameLabel:"키 이름",keyNamePlaceholder:"예: apiKey, dbPassword",valueLabel:"Secret 값",valuePlaceholder:"Secret 값 입력…",storeWarning:"값이 암호화됩니다. 저장 후 검색할 수 없습니다.",store:"Secret 저장",storeSuccess:'Secret "{{key}}" 저장됨',deleteSuccess:'Secret "{{key}}" 삭제됨',created:"생성일",lastAccessed:"마지막 접근",checksum:"체크섬",actions:"작업",confirmDeleteTitle:"Secret 삭제",confirmDeleteMessage:'"{{key}}"을(를) 영구적으로 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다.',empty:"Secret을 찾을 수 없습니다",emptyHint:"Secret을 생성하거나 위의 네임스페이스 필터를 변경하세요.",vaultUp:"Vault 온라인",vaultDown:"Vault 오프라인",descriptionLabel:"설명 (선택)",descriptionPlaceholder:"예: 프로덕션용 OpenAI API 키",descriptionCol:"설명",reference:"참조",willUseRef:"참조:",copyRef:"볼트 참조 복사",refCopied:"복사됨: {{ref}}",lastRotated:"최근 변경",scopeExplanation:"시크릿은 테넌트 단위로 등록되며 모든 에이전트 간 공유됩니다. 구성 내에서 ${vault:keyName} 형태로 참조하세요.",creatingFor:'테넌트 "{{tenant}}"에 저장 — 모든 에이전트 사용 가능',vaultNotConfigured:"시크릿 볼트가 구성되지 않음",viewDocs:"문서 보기",selectAgentFirst:"먼저 에이전트를 선택하세요",tableTitle:'테넌트 "{{tenant}}"의 시크릿 (총 {{count}}개)'},Cwt={title:"감사 로그",description:"규정 준수 및 디버깅을 위한 변경 불가 감사 원장을 탐색합니다.",byConversation:"대화별",byAgent:"에이전트별",conversationIdPlaceholder:"대화 ID 입력...",agentIdPlaceholder:"에이전트 ID 입력...",versionPlaceholder:"버전 (선택 사항)",search:"검색",entries:"항목",totalDuration:"총 시간",totalCost:"총 비용",step:"단계",tasks:"작업",input:"입력",output:"출력",llmDetail:"LLM 상세",toolCalls:"도구 호출",hmacIntegrity:"HMAC 무결성 검증됨",empty:"감사 항목 검색",emptyHint:"위에서 대화 또는 에이전트 ID를 입력하여 Audit Trail을 탐색하세요.",noResults:"감사 항목을 찾을 수 없습니다",noResultsHint:"다른 ID를 시도하거나 대화가 처리되었는지 확인하세요.",loadMore:"더 보기",selectAgent:"Select an agent…",conversations:"conversations",emptyAgent:"Select an agent to view its audit trail",emptyAgentHint:"Choose a deployed agent from the dropdown above to see all its audit records.",export:"Export",autoRefreshToggle:"Toggle auto-refresh (every 10s)",autoRefreshOn:"Auto",autoRefreshOff:"Auto",integrityVerified:"All entries cryptographically signed",integrityVerifiedDesc:"{{count}} of {{total}} entries have HMAC-SHA256 signatures",integrityPass:"SIGNED",integrityPartial:"Partially signed audit trail",integrityPartialDesc:"{{count}} of {{total}} entries have HMAC signatures",integrityNone:"Unsigned audit entries",integrityNoneDesc:"Configure a vault master key to enable automatic HMAC-SHA256 signing on all future audit entries.",signed:"Signed",allSigned:"All signed"},Swt={title:"스케줄",subtitle:"에이전트 스케줄 트리거 관리 — Cron 작업 및 하트비트",create:"스케줄 생성",createTitle:"스케줄 생성",createSuccess:"스케줄이 성공적으로 생성되었습니다",createError:"스케줄 생성 실패",creating:"생성 중...",name:"이름",namePlaceholder:"예: 일일 상태 확인",triggerType:"트리거 유형",cronExpression:"Cron 표현식",interval:"간격 (초)",agentId:"Agent ID",agentIdPlaceholder:"에이전트 ID 입력...",environment:"환경",message:"메시지",messagePlaceholder:"에이전트에게 보낼 메시지",conversationStrategy:"대화 전략",total:"전체 스케줄",active:"활성",failedCount:"실패 / Dead-Lettered",nextFireLabel:"다음 실행",tableTitle:"전체 스케줄",empty:"아직 스케줄이 없습니다",emptyHint:"에이전트 트리거를 자동화하려면 스케줄을 생성하세요.",colName:"이름",colType:"유형",colSchedule:"스케줄",colAgent:"에이전트",colStatus:"상태",colNextFire:"다음",colLastFired:"이전",colActions:"작업",enable:"활성화",disable:"비활성화",enabled:"스케줄 활성화됨",disabled:"스케줄 비활성화됨",toggleError:"스케줄 전환 실패",fireNow:"지금 실행",fired:"스케줄이 성공적으로 실행되었습니다",fireError:"실행 실패",retry:"재시도",retrySuccess:"스케줄이 다시 대기열에 추가됨",retryError:"재시도 실패",deleteSuccess:"스케줄 삭제됨",deleteError:"스케줄 삭제 실패",fireHistory:"실행 기록"},kwt={title:"디버그",tabPipeline:"파이프라인",tabCosts:"비용",tabMemory:"메모리",tabLogs:"로그",tabPrompt:"프롬프트",turn:"턴",latest:"최신",noPipeline:"파이프라인 트레이스를 보려면 메시지를 보내세요",processing:"처리 중...",actions:"작업",confidence:"신뢰도",duration:"소요 시간"},Nwt={thisTurn:"이번 턴",conversationTotal:"대화 합계",tokens:"Tokens",cost:"비용",duration:"소요 시간",model:"모델",toolCalls:"도구 호출",toolUsage:"도구 사용량",cacheStats:"캐시",hitRate:"적중률",empty:"비용 지표를 보려면 메시지를 보내세요",in:"입력",out:"출력",total:"총 시간",calls:"호출"},Ewt={title:"대화 메모리",noConversation:"메모리를 검사하려면 대화를 시작하세요",empty:"사용 가능한 메모리 데이터 없음",properties:"속성",step:"단계",keys:"키",input:"입력"},Lwt={noAgent:"로그를 보려면 에이전트를 선택하세요",search:"검색...",pause:"일시 정지",resume:"재개",clear:"지우기",waiting:"로그 대기 중...",connected:"연결됨",disconnected:"연결 끊김",logOutput:"로그 출력"},Dwt={noConversation:"프롬프트를 검사하려면 대화를 시작하세요",noLlm:"아직 LLM 상호작용이 없습니다",turn:"턴",latest:"최신",tokens:"Tokens",model:"모델",cost:"비용",copy:"프롬프트 복사",copied:"복사됨!",replay:"이 턴 다시 재생",toolCalls:"도구 호출",step:"단계",roleSystem:"시스템 프롬프트",roleUser:"사용자",roleAssistant:"어시스턴트",roleTool:"도구 결과"},Twt={preview:"미리보기",edit:"편집",switchToPreview:"해석된 프롬프트 미리보기",switchToEdit:"편집으로 전환",refresh:"새로고침",sampleData:"샘플 데이터 (대화 없음)",disclaimerReal:"미리보기는 실제 대화 데이터로 Qute 엔진을 사용합니다.",disclaimerSample:"미리보기는 샘플 데이터로 Qute 엔진을 사용합니다. 실제 값을 확인하려면 대화를 선택하세요.",resolvedPrompt:"해석된 프롬프트",copy:"복사",copied:"복사됨!",error:"템플릿 해석 오류",loading:"템플릿 해석 중…",availableVariables:"사용 가능한 변수",copyVariable:"클릭하여 변수 참조 복사",varProperties:"속성",varMemory:"메모리",varContext:"컨텍스트",varSnippets:"스니펫",varUserInfo:"사용자 정보",varConversationInfo:"대화 정보",varInput:"입력",varConversationLog:"대화 로그"},Iwt={title:"에이전트 스튜디오",subtitle:"하나의 작업 공간에서 에이전트를 구축, 테스트 및 디버그하세요",pipeline:"파이프라인",editor:"편집기",debug:"디버그 & 채팅",selectStage:"편집기를 열려면 파이프라인 단계를 클릭하세요",openInStudio:"스튜디오에서 열기",loading:"에이전트 로딩 중...",notFound:"에이전트를 찾을 수 없습니다",hideChat:"채팅 숨기기",showChat:"채팅 표시",openEditor:"편집기에서 열기",editorComingSoon:"인라인 편집기 통합이 곧 제공됩니다",noPipeline:"파이프라인 단계 없음",type:{parser:"파서",rules:"규칙",property:"속성 설정기",apicalls:"API 호출",llm:"LLM",output:"출력","output.template":"출력 템플릿",mcpcalls:"MCP 호출",rag:"지식 베이스",dictionary:"사전"},landingDescription:"에이전트를 선택하여 비주얼 파이프라인 편집기, 디버거, 라이브 채팅을 여세요",noAgents:"에이전트를 찾을 수 없습니다 — 에이전트 페이지에서 생성하세요",chat:"채팅",backToAgent:"에이전트로 돌아가기",selectStageHint:"파이프라인의 확장을 선택하여 인라인으로 설정을 보고 편집하세요",noConfig:"이 파이프라인 단계에는 설정 URI가 없습니다",unsupportedType:"이 확장 유형의 편집기를 사용할 수 없습니다"},Awt={general:"일반",kbName:"지식 베이스 이름",kbNamePlaceholder:"예: product-docs, faq, internal-wiki",kbNameHint:"LLM 작업에서 이 KB를 참조하는 데 사용됩니다",embeddingModel:"임베딩 모델",provider:"제공자",embeddingParams:"제공자 파라미터",embeddingParamsHint:"모델 이름, API 키 (보안을 위해 ${vault:...} 사용), 기본 URL 등",vectorStore:"벡터 스토어",storeType:"스토어 유형",storeParams:"연결 파라미터",chunking:"문서 청킹",chunkStrategy:"전략",chunkSize:"청크 크기",chunkOverlap:"청크 오버랩",overlapHint:"오버랩은 청크 간 문맥을 유지하는 데 도움이 됩니다",chunkPreview:"미리보기 (문서 분할 방식)",chunkBlocks:"{{overlap}}자 오버랩으로 약 {{size}}자의 {{count}}개 청크",retrievalDefaults:"검색 기본값",retrievalHint:"이 기본값은 LLM 구성에서 작업별로 재정의할 수 있습니다.",maxResults:"최대 결과 (top-K)",minScore:"최소 유사도 점수",ingestion:"문서 수집",dropFiles:"여기에 문서를 드래그 앤 드롭하세요",dropHint:"텍스트, 마크다운 또는 기타 텍스트 기반 파일",browse:"찾아보기",pasteText:"또는 텍스트 콘텐츠 붙여넣기",pastePlaceholder:"여기에 문서 텍스트를 붙여넣으세요...",ingestText:"텍스트 수집",ingestionHistory:"수집 상태",saveFirstIngestion:"문서 수집을 활성화하려면 먼저 이 지식 베이스를 저장하세요.",addParam:"파라미터 추가"},Rwt={welcome:{title:"EDDI에 오신 것을 환영합니다",subtitle:"당신의 AI 에이전트 지휘 본부",introText:"EDDI Manager는 대화형 AI 에이전트를 구축, 테스트 및 운영하기 위한 완벽한 지휘 본부입니다.",capabilitiesTitle:"주요 기능",capabilitiesSubtitle:"프로덕션급 AI 에이전트를 만드는 데 필요한 모든 것",buildAgents:"에이전트 구축",buildAgentsDesc:"마법사를 사용하거나 처음부터 AI 에이전트를 생성하고 구성합니다.",designWorkflows:"워크플로 설계",designWorkflowsDesc:"행동 규칙, LLM 체인 및 도구를 사용한 드래그 앤 드롭 파이프라인 빌더",testRealtime:"실시간 테스트",testRealtimeDesc:"스트리밍 응답 및 내장된 디버깅 기능으로 에이전트와 대화합니다.",monitorOperate:"모니터링 및 운영",monitorOperateDesc:"대화, 감사 추적, 암호 키 및 할당량을 한 곳에서 관리합니다.",readyTitle:"시작할 준비가 되셨나요?",readySubtitle:"사이드바의 도움말 메뉴에서 언제든지 투어를 다시 시작할 수 있습니다.",startTour:"투어 시작",exploreOwn:"직접 둘러보기"},tour:{back:"뒤로",next:"다음",skip:"투어 건너뛰기",finish:"완료",stepOf:"단계 {{current}} / {{total}}",dashboard:{title:"대시보드 투어",step1Title:"당신의 지휘 본부",step1Desc:"사이드바는 관리, 개발, 운영의 세 영역으로 모든 것을 구성합니다. 필요한 것을 언제든지 찾을 수 있습니다.",step2Title:"플랫폼 개요",step2Desc:"에이전트, 워크플로, 대화의 실시간 개수입니다. 카드를 클릭하면 해당 섹션으로 바로 이동합니다.",step3Title:"빠른 작업",step3Desc:"일반적인 작업으로 바로 이동합니다. 에이전트 마법사는 첫 번째 에이전트를 만드는 가장 빠른 방법이며, 2분도 채 걸리지 않습니다.",step4Title:"환경 설정",step4Desc:"라이트, 다크, 시스템 테마를 전환합니다. EDDI Manager는 11개 언어를 지원합니다. 언어 선택기에서 선택하세요."},agents:{title:"에이전트 투어",step1Title:"에이전트 마법사",step1Desc:"마법사는 모델 선택, 성격 설정, 도구 활성화, 배포 등 완벽하게 구성된 에이전트를 만드는 과정을 안내합니다.",step2Title:"수동 생성",step2Desc:"고급 사용자용: 빈 에이전트를 만들고 완전한 JSON 제어로 구성합니다. 복잡한 설정에 적합합니다.",step3Title:"검색 및 필터",step3Desc:"이름으로 에이전트를 즉시 찾습니다. 오른쪽 버튼으로 카드 뷰와 목록 뷰를 전환합니다.",step4Title:"에이전트 목록",step4Desc:"각 카드는 에이전트 이름, 버전 및 최종 수정 시간을 표시합니다. 에이전트를 클릭하면 배포, 채팅, 워크플로 제어가 있는 세부 정보 페이지가 열립니다."},workflows:{title:"워크플로 투어",step1Title:"워크플로 생성",step1Desc:"워크플로는 파이프라인(LLM 호출, 행동 규칙, HTTP 통합과 같은 작업의 시퀀스)을 정의합니다.",step2Title:"당신의 워크플로",step2Desc:"각 워크플로는 하나 이상의 에이전트에 연결할 수 있습니다. 클릭하여 드래그 앤 드롭 파이프라인 편집기를 엽니다.",step3Title:"뷰 구성",step3Desc:"이름으로 검색하고 카드 그리드와 정렬 가능한 테이블 뷰 간을 전환합니다."},chat:{title:"채팅 투어",step1Title:"에이전트 선택",step1Desc:"배포된 에이전트를 선택하여 대화를 시작하세요. 배포된 상태의 에이전트만 여기에 나타납니다.",step2Title:"스트리밍 모드",step2Desc:"실시간 토큰 스트리밍을 전환하세요. 활성화되면 응답이 단어 단위로 나타나며, 지연 시간 디버깅에 매우 유용합니다.",step3Title:"대화 기록",step3Desc:"사이드바를 열어 이전 대화를 찾아보고 다시 시작할 수 있습니다.",step4Title:"채팅 시작",step4Desc:"메시지를 입력하고 Enter 키를 누르세요. 계정은 구성하신 워크플로, 도구, 그리고 LLM을 사용하여 답변합니다."},channels:{title:"채널",subtitle:"에이전트와 그룹을 Slack 등 메시징 플랫폼에 연결"},resources:{title:"리소스 투어",step1Title:"확장 라이브러리",step1Desc:"리소스는 워크플로의 구성 요소입니다. 각 유형은 에이전트의 다양한 행동 논리를 제어합니다.",step2Title:"LLM 구성",step2Desc:"에이전트를 구동하는 AI 모델을 정의하며, 시스템 프롬프트, 도구, MCP 서버 및 연쇄 구성 등이 포함됩니다. 이것은 에이전트의 두뇌입니다.",step3Title:"규칙 및 API 호출",step3Desc:"행동 규칙(Rules)은 대화 흐름을 제어합니다. HTTP 호출은 외부 API에 연결합니다. 두 가지 모두 LLM의 도구로 사용할 수 있습니다."},conversations:{title:"대화 투어",step1Title:"검색",step1Desc:"ID, 에이전트 또는 최신 사용자 메시지를 통해 대화를 빠르게 찾으세요.",step2Title:"상태 필터",step2Desc:"대화 상태 (활성화, 처리 중, 끝남 또는 에러) 에 따라 대화를 필터링하세요.",step3Title:"대화 목록",step3Desc:"모든 세션을 찾아보세요. 아무 대화 카드나 클릭하면 타임라인이 열리고 디버그 할 수 있습니다."},groups:{title:"토론 그룹 투어",step1Title:"그룹 만들기",step1Desc:"통합 채팅 환경을 만들어 다수의 에이전트들이 협력하고 논쟁할 수 있도록 만드세요.",step2Title:"그룹 검색",step2Desc:"기존에 존재하던 다단계 클러스터를 찾아보세요.",step3Title:"그룹 표",step3Desc:"협동 환경 관리, 정책 수정 및 더 이상 사용되지 않는 그룹들을 삭제하세요."},logs:{title:"시스템 로그 투어",step1Title:"라이브 대 옛 기록",step1Desc:"시스템 로그의 실시간 스트림과 과거 로그 검색 사이를 쉽게 전환하세요.",step2Title:"스트림 필터",step2Desc:"에이전트별이거나 핵심적인 사항들에 한해서 들어오는 라이브 스트림을 필터링 하세요.",step3Title:"내보내기",step3Desc:"외부적인 분석을 위해 현재의 필터된 기록들을 텍스트 파일로 다운 받으세요."},secrets:{title:"보안 금고 투어",step1Title:"암호 생성",step1Desc:"에이전트가 참조할 수 있는 새로운 API 키, 토큰 또는 비밀번호를 안전하게 저장합니다.",step2Title:"테넌트 격리",step2Desc:"특정 테넌트 ID로 범위가 지정된 비밀만 표시하도록 볼트 보기를 필터링합니다.",step3Title:"참조 구문",step3Desc:"비밀을 정적으로 코딩하지 않고 LLM 구성 요소(${vault:...})에 동적으로 주입하는 방법을 알아보세요."},audit:{title:"감사 원장 투어",step1Title:"검색 모드",step1Desc:"특정 대화 ID나 에이전트 버전으로 변형되지 않는 감사 원장을 찾으세요.",step2Title:"검색 실행",step2Desc:"아이디를 입력 한 다음 검색을 눌러서 예전의 검증 가능했던 기록들을 불러오세요.",step3Title:"원장 수출",step3Desc:"규정 준수 및 보고 목적으로 검색된 감사 기록을 JSON으로 내보냅니다."},schedules:{title:"스케쥴의 투어",step1Title:"스케쥴 생성",step1Desc:"에이전트의 워크플로를 자동으로 트리거할 새로운 Cron 크론 잡 또는 지속되는 하트비트 설정.",step2Title:"체력 능력치",step2Desc:"플랫폼 전반의 전체적인 결과물, 일의 양, 및 실패했던 일정들을 전부 모니터링하세요.",step3Title:"스케쥴 관리",step3Desc:"작동을 멈추고 지연시키며 수정 또는 파이어 작동을 스스로 체크하며 자동화된 트리거들을 직접 운영 관리 해보세요."},quotas:{title:"할당량 배정의 투어",step1Title:"구성 제약조건",step1Desc:"이 테넌트에 대한 총 에이전트, 지속적인 대화들, 그리고 지불해야 될 토큰 비용에 관하여 한계선을 정확히 정의하세요.",step2Title:"사용 상황 분석",step2Desc:"배분받은 할당량만큼 테넌트가 어느정도를 잘 소비하고있는지 실시간으로 관찰하고 감시하세요.",step3Title:"실질적용 단계",step3Desc:"나에게 맞게 설정값을 정하시고 만약 이 한계점을 벗어난 다른 트래픽이 접근시 시스템이 알아서 차단할 것입니다."},coordinator:{title:"협조 프로그램의 투어",step1Title:"라이브 커넥션",step1Desc:"후방의 지원 협력 프로그램에 연결되어 활동하는 상태 창과 진행 현황을 뷰로 열어봅니다.",step2Title:"큐 처리",step2Desc:"본인의 클러스터 전체 영역의 실시간 큐 업무와 액티브한 실행 일들을 전부 모니터링합니다.",step3Title:"데드레터",step3Desc:"안좋은 결과물을 초례한 일들을 조사 또는 일련으로 치우거나 재시도를 통하여 본 시스템을 안정적으로 지켜주세요."},orphans:{title:"고아객체 투어",step1Title:"스캔의 불꽃",step1Desc:"플랫폼 스캔을 시작해보고 혹여라도 에이전트로부터 연결이 끊긴 미흡했던 설정값들을 다시 재발견해줍니다.",step2Title:"부드러운 삭제기능",step2Desc:"예전에 부드럽게 기록상 사라져 보였건만 사실상 남겨진 자료들을 완전 삭제하기를 위한 옵션.",step3Title:"리뷰와 퍼지단계",step3Desc:"다시 돌아보아 필요없는 요소들을 걸러내어 선택함으로서 DB 공간확보를 위한 비가역의 조치를 이룹니다."}},help:{title:"도움말 및 투어",platformTour:"플랫폼 투어",resetAll:"모든 투어 초기화",resetConfirm:"모든 투어 진행 상황을 초기화하시겠습니까?"},offer:{message:"처음이신가요? {{page}}을(를) 확인해 보세요",accept:"투어 시작",dontAsk:"다시 묻지 않음"}},Mwt={status:"플랫폼 상태",online:"온라인",offline:"오프라인",checking:"연결 확인 중…",connected:"연결됨",disconnected:"연결 끊김",instance:"인스턴스",latency:"지연 시간",lastChecked:"마지막 확인",justNow:"방금",secondsAgo:"{{count}}초 전"},Pwt={live:"실시간",reconnecting:"재연결 중…"},Owt={title:"새 {{type}}",newAgent:"새 에이전트",newGroup:"새 그룹",quickCreate:"빠른 생성",quickCreateTitle:"빠른 생성 {{type}}",quickCreateDesc:"이름과 설명을 설정하고 세부 정보는 나중에 구성합니다.",guidedSetup:"가이드 설정",guidedSetupDesc:"LLM 제공자, 프롬프트 및 배포를 포함한 단계별 마법사."},jwt={empty:"아직 그룹이 없습니다",emptyDescription:"그룹을 사용하면 여러 에이전트가 구조화된 토론에서 협업할 수 있습니다.",createGroup:"그룹 만들기",unnamed:"이름 없는 그룹",count_one:"{{count}}개 그룹",count_other:"{{count}}개 그룹",confirmDelete:"이 그룹을 삭제하시겠습니까?",confirmDeleteDesc:"그룹 구성이 영구적으로 삭제됩니다.",duplicateSuccess:"그룹이 복제되었습니다",noDescription:"No description",members:"members",discussionStyle:"Discussion Style",maxRounds:"Max Rounds"},Fwt={title:"사용자 메모리",subtitle:"에이전트가 저장한 영구 사용자 메모리를 탐색하고 관리",userIdPlaceholder:"사용자 ID를 입력…",searchPlaceholder:"메모리 검색…",enterUserId:"메모리를 탐색할 사용자 ID를 입력하세요",totalEntries:"총 항목 수",preferences:"선호도",facts:"사실",conflicts:"충돌",cat_all:"전체",cat_preference:"선호도",cat_fact:"사실",cat_context:"컨텍스트",deleteAll:"모두 삭제",deleteAllTitle:"모든 메모리 삭제",deleteAllDesc:"이 사용자의 모든 메모리가 영구 삭제됩니다. 이 작업은 되돌릴 수 없습니다.",deleteAllConfirm:"모두 삭제",entryDeleted:"메모리 항목이 삭제되었습니다",allDeleted:"사용자의 모든 메모리가 삭제되었습니다",noResults:"메모리 항목을 찾을 수 없습니다",value:"값",sourceAgent:"소스 에이전트",accessCount:"접근 횟수",created:"생성일",updated:"수정일",sourceConversation:"소스 대화",conflicted:"충돌 있음"},Bwt={title:"사용자 속성",subtitle:"사용자별로 저장된 longTerm 속성을 탐색하고 관리",userIdPlaceholder:"사용자 ID를 입력…",searchPlaceholder:"속성 필터링…",enterUserId:"속성을 볼 사용자 ID를 입력하세요",key:"키",type:"유형",value:"값",deleteAll:"모두 삭제",deleteAllTitle:"모든 속성 삭제",deleteAllDesc:"이 사용자의 모든 속성이 영구 삭제됩니다.",deleted:"속성이 삭제되었습니다",noResults:"속성을 찾을 수 없습니다",showingCount:"{{count}}개 속성"},Hwt={title:"에이전트 트리거",subtitle:"자동 라우팅을 위해 인텐트를 에이전트 배포에 매핑",create:"새 트리거",createTitle:"트리거 생성",editTitle:"트리거 편집",intent:"인텐트",deployments:"에이전트 배포",addDeployment:"에이전트 추가",agents:"에이전트",empty:"아직 트리거가 설정되지 않았습니다",created:"트리거가 생성되었습니다",updated:"트리거가 업데이트되었습니다",deleted:"트리거가 삭제되었습니다",deleteTitle:"트리거 삭제",deleteDesc:"인텐트 「{{intent}}」의 트리거를 영구 삭제하시겠습니까?",searchPlaceholder:"인텐트 또는 에이전트 ID로 필터링…"},Wwt={title:"기능 검색",subtitle:"선언된 스킬과 기능으로 에이전트 검색",searchPlaceholder:"스킬 검색…",strategyHighest:"최고 신뢰도",strategyAll:"모든 일치",registeredSkills:"등록된 스킬",noSkills:"스킬을 찾을 수 없습니다",matchingAgents:"일치하는 에이전트",noMatches:"이 스킬에 일치하는 에이전트가 없습니다"},Vwt={title:"에이전트 내보내기",loading:"리소스 트리 로드 중...",selectResources:"내보낼 리소스 선택",required:"필수",snippets:"스니펫",allSelected:"모든 리소스 선택됨",countSelected:"{{total}}개 중 {{count}}개 리소스 선택됨",exportSelected:"선택 항목 내보내기"},zwt={title:"에이전트 가져오기",dropZone:"여기에 .zip 파일 드래그 또는 찾아보기 클릭",dropZoneHint:"내보낸 에이전트 아카이브 (.zip)",strategyLabel:"가져오기 전략",createNew:"새 에이전트로 생성",createNewDesc:"새 ID로 복사본 생성. 초기 가져오기에 가장 적합합니다.",mergeSync:"기존 데이터와 병합/동기화",mergeSyncDesc:"이전에 가져왔으면 기존 리소스 업데이트. 없으면 새로 생성.",upgradeExisting:"기존 에이전트 업그레이드",upgradeDesc:"리소스를 대상 에이전트와 구조적으로 매칭합니다. 환경 간 промо션에 추천.",syncRemote:"원격 인스턴스에서 동기화",syncDesc:"다른 EDDI 인스턴스에 연결하여 특정 에이전트를 실시간으로 동기화합니다.",importNow:"지금 가져오기",previewChanges:"변경사항 미리보기",selectTargetAgent:"대상 에이전트 선택",upgradeTargetHint:"가져온 리소스는 이 에이전트와 구조적으로 매칭됩니다.",chooseAgent:"— 에이전트 선택 —",sourceAgent:"원본 에이전트 (원격)",targetAgent:"대상 에이전트 (로컬)",createNewTarget:"새 에이전트 만들기",resource:"리소스",type:"유형",match:"매칭",action:"작업",new:"신규",updated:"업데이트됨",unchanged:"변경 없음",selected:"선택됨",mergeNow:"선택 항목 가져오기",syncNow:"지금 동기화",upgradeNow:"지금 업그레이드",importing:"에이전트 가져오는 중...",contentIdentical:"내용 동일함",targetContent:"대상 (Target)",sourceContent:"원본 (Source)"},Uwt={title:"에이전트 동기화",subtitle:"EDDI 인스턴스 간 에이전트 동기화",connection:"원본 인스턴스",sourceUrl:"원본 EDDI 인스턴스 URL",authToken:"인증 토큰",authHint:"선택사항. X-Source-Authorization 헤더로 전송.",connect:"연결",connected:"연결됨",agentsFound:"에이전트",connectionFailed:"연결 실패",agentMapping:"에이전트 매핑",previewAll:"모두 미리보기",syncSelected:"선택 항목 동기화",remote:"원격",createNew:"새로 생성",changes:"개의 변경사항",agentsSelected:"개의 에이전트 선택됨",totalResources:"개 리소스",syncSuccess:"동기화 완료",syncError:"동기화 실패",empty:"에이전트 동기화를 시작하려면 원본 인스턴스에 접속하세요.",autoMatched:"자동 매칭됨",previewFirst:"동기화 전에 변경사항 미리보기"},$wt={actionCreate:"신규",actionUpdate:"업데이트",actionSkip:"최신 상태",actionConflict:"충돌"},qwt={title:"사용자 대화",subtitle:"인텐트 → 사용자 → 대화 바인딩 관리",lookup:"조회",intent:"인텐트",userId:"사용자 ID",agentId:"에이전트 ID",environment:"환경",conversationId:"대화 ID",binding:"활성 바인딩",enterBoth:"인텐트와 사용자 ID를 입력하세요",notFound:"바인딩을 찾을 수 없습니다",create:"바인딩 생성",createTitle:"바인딩 생성",created:"바인딩이 생성되었습니다",deleteTitle:"바인딩 삭제",deleteDesc:'인텐트 "{{intent}}"과 사용자 "{{userId}}"의 바인딩을 삭제하시겠습니까?',deleted:"바인딩이 삭제되었습니다"},Kwt={placeholder:"페이지, 에이전트, 작업 검색…",noResults:"결과를 찾을 수 없습니다.",recent:"최근",navigate:"탐색",agents:"에이전트",actions:"빠른 작업",createAgent:"새 에이전트 만들기",openChat:"채팅 열기",kbdNavigate:"탐색",kbdSelect:"선택",kbdClose:"닫기"},Gwt={title:"Group Setup Wizard",subtitle:"Assemble a team of AI advisors to discuss your questions",backToGroups:"Back to Groups",templateTitle:"Start from a template",templateDesc:"Choose a preset group configuration or start from scratch.",startBlank:"Start from Scratch",blankDesc:"Configure everything manually",configTitle:"Group Configuration",configDesc:"Name your group and choose how the agents will discuss",namePlaceholder:"e.g. Advisory Board",descPlaceholder:"What is this group for?",membersTitle:"Assemble Your Team",membersDesc:"For each seat, choose an existing agent or create a new one on the fly.",addMember:"Add Member",refreshAgents:"Refresh agent list",existingAgents:"existing agents",displayName:"Agent Name",displayNamePlaceholder:"Give this agent a name…",rolePlaceholder:"Role (e.g. Marketing, Engineering)",useExisting:"Use Existing",createNew:"Create New",selectAgent:"Select agent…",systemPrompt:"System Prompt",provider:"LLM Provider",model:"Model",apiKey:"API Key",apiKeyPlaceholder:"sk-…",createThisAgent:"Create Agent",creatingAgent:"Creating agent…",agentReady:"Agent created & deployed",agentCreated:'Agent "{{name}}" created',agentCreateFailed:"Failed to create agent: {{error}}",moderator:"Moderator",moderatorHint:"Synthesizes the discussion",addModerator:"Add Moderator",removeModerator:"Remove moderator",createModerator:"Create Moderator Agent",moderatorReady:"Moderator agent ready",moderatorCreated:"Moderator agent created",creatingModerator:"Creating moderator…",creatingSlot:"Creating {{name}}…",creatingGroup:"Creating group…",needMembers:"Add at least 2 members to proceed",reviewTitle:"Review & Create",reviewDesc:"Review your group configuration before creating.",reviewMembers:"Members",autoCreateNotice:"{{count}} agents will be auto-created when you click Create Group",autoCreateHint:"Each agent will be created and deployed automatically before the group is assembled.",unassignedWarning:"{{count}} members set to 'Use Existing' but no agent selected",unassignedHint:"These members will be skipped during discussions. Go back to assign agents.",flowPreview:"Discussion Flow",createGroup:"Create Group",created:"Group Created!",viewGroup:"Open Group",createAnother:"Create Another",success:"Group created successfully!"},Ywt={advisoryBoard:"Advisory Board",advisoryBoardDesc:"A panel of expert advisors consulting on strategic decisions.",codeReview:"Code Review Panel",codeReviewDesc:"Structured code review with independent opinions, peer critique, and revision.",riskAssessment:"Risk Assessment",riskAssessmentDesc:"A panel with a devil's advocate who challenges assumptions.",forecasting:"Forecasting Panel",forecastingDesc:"Delphi-style anonymous deliberation for unbiased estimates.",proCon:"Pro/Con Debate",proConDesc:"Formal debate with pro and con teams arguing their positions.",roles:{marketingExpert:"Marketing Expert",techLead:"Tech Lead",financeDirector:"Finance Director",legalCounsel:"Legal Counsel",strategyConsultant:"Strategy Consultant",seniorEngineer:"Senior Engineer",architect:"Architect",securityReviewer:"Security Reviewer",riskAnalyst:"Risk Analyst",domainExpert:"Domain Expert",devilsAdvocate:"Devil's Advocate",analystA:"Analyst A",analystB:"Analyst B",analystC:"Analyst C",analystD:"Analyst D",proAdvocate1:"Pro Advocate 1",proAdvocate2:"Pro Advocate 2",conAdvocate1:"Con Advocate 1",conAdvocate2:"Con Advocate 2"}},Qwt={agentIdPlaceholder:"메시지를 처리할 에이전트 ID",botToken:"봇 토큰",botTokenHint:"봇 사용자 OAuth 토큰. 보안을 위해 볼트 참조를 사용하세요.",botTokenPlaceholder:"xoxb-… 또는 ${vault:slack-bot-token}",channel:"채널",channelId:"Slack 채널 ID",channelIdCol:"채널 ID",channelIdHint:"Slack 채널을 우클릭 → 채널 세부 정보 보기 → 채널 ID 복사",channelsPlural:"채널",channelType:"채널 유형",confirmDelete:"채널을 삭제하시겠습니까?",confirmDeleteDesc:"이 채널 통합이 영구적으로 제거됩니다.",create:"채널 만들기",createTitle:"채널 통합 만들기",defaultAgentId:"기본 에이전트 ID",defaultTargetHint:"기본 대상은 트리거 키워드와 일치하지 않는 모든 메시지를 처리합니다. 생성 후 대상을 추가할 수 있습니다.",empty:"아직 채널이 없습니다",emptyDesc:"채널 통합을 만들어 에이전트를 Slack에 연결하세요.",name:"이름",namePlaceholder:"예: Engineering AI Hub",openSlackApps:"Slack 앱 대시보드 열기",searchPlaceholder:"채널 검색…",signingSecret:"서명 비밀",signingSecretHint:"Slack 앱의 기본 정보 페이지에서 확인할 수 있습니다.",signingSecretPlaceholder:"16진수 문자열 또는 ${vault:slack-signing-secret}",slackSetupGuide:"Slack 설정 가이드",slackSetupSummary:"Slack 앱을 만들고, 봇 토큰 범위(app_mentions:read, chat:write, im:history, channels:history, groups:history)를 구성한 후 여기에 자격 증명을 붙여넣으세요.",target:"대상",targets:"대상",targetsCol:"대상",type:"유형",unnamed:"이름 없는 채널",version:"버전"},Xwt={addTarget:"대상 추가",addTrigger:"트리거 추가…",agentId:"에이전트 ID",botToken:"봇 토큰",channelId:"Slack 채널 ID",cooldown:"대기 시간(초)",general:"일반",groupId:"그룹 ID",isDefault:"기본",maxCost:"최대 $/일",maxDaily:"최대/일",name:"이름",observe:"관찰",observeDesc:"수동적으로 모니터링하고 선택적으로 응답",observeKeywords:"트리거 키워드",observeMimeTypes:"트리거 MIME 유형",observeMode:"관찰 모드",observeSettings:"관찰 모드 설정",platformConfig:"플랫폼 구성",rawConfig:"원시 구성",removeTarget:"제거",requiredEvents:"필수 이벤트 구독:",requiredScopes:"필수 봇 토큰 범위:",setDefault:"기본으로 설정",signingSecret:"서명 비밀",targetName:"이름",targets:"메시지 라우팅 대상",targetType:"유형",triggerHint:'사용자가 "키워드: 메시지"를 입력하면 이 대상으로 라우팅됩니다',triggerKeywords:"트리거 키워드",triggers:"트리거",type:"채널 유형",webhookHint:"이 URL을 Slack 앱의 Event Subscriptions → Request URL 필드에 붙여넣으세요.",webhookUrl:"Webhook URL"},Zwt={app:G1t,auth:Y1t,nav:Q1t,theme:X1t,language:Z1t,pages:J1t,common:ewt,agents:twt,agentDetail:nwt,wizard:iwt,setupWizard:swt,packages:rwt,packageDetail:owt,packageEditor:awt,conversations:lwt,conversationDetail:cwt,chat:dwt,resources:uwt,editor:hwt,rulesEditor:gwt,apiCallsEditor:fwt,llmEditor:pwt,outputEditor:mwt,propertySetterEditor:bwt,dictionaryEditor:xwt,coordinator:vwt,contentEditor:_wt,logs:ywt,secrets:wwt,audit:Cwt,schedules:Swt,debugDrawer:kwt,costDashboard:Nwt,memoryInspector:Ewt,logViewer:Lwt,promptViewer:Dwt,promptPreview:Twt,studio:Iwt,ragEditor:Awt,onboarding:Rwt,platform:Mwt,stream:Pwt,createOrWizard:Owt,groups:jwt,memories:Fwt,properties:Bwt,triggers:Hwt,capabilities:Wwt,exportDialog:Vwt,importDialog:zwt,syncPage:Uwt,sync:$wt,userConversations:qwt,commandPalette:Kwt,groupWizard:Gwt,groupTemplates:Ywt,channels:Qwt,channelDetail:Xwt},Jwt={title:"EDDI Manager",description:"Painel de administração da plataforma de IA conversacional EDDI"},eCt={login:"Entrar",logout:"Sair",loading:"Autenticando…",sessionExpired:"Sessão expirada. Faça login novamente.",profile:"Perfil",guest:"Visitante",userMenu:"Menu do utilizador"},tCt={dashboard:"Painel",agents:"Agentes",packages:"Fluxos de trabalho",conversations:"Conversas",coordinator:"Coordenador",schedules:"Agendamentos",logs:"Registros",orphans:"Órfãos",secrets:"Segredos",audit:"Registo de auditoria",quotas:"Cotas",groups:"Grupos",chat:"Chat",resources:"Recursos",sectionManagement:"Gestão",sectionDevelopment:"Desenvolvimento",sectionOperations:"Operações",mainNavigation:"Navegação principal",openMenu:"Abrir menu de navegação",sectionCore:"Principal",sectionBuild:"Criar e testar",sectionMonitor:"Monitorizar",sectionAdmin:"Administração",studio:"Estúdio",gdpr:"Privacidade",memories:"Memória do utilizador",properties:"Propriedades",triggers:"Gatilhos",capabilities:"Capacidades",sync:"Sincronização",channels:"Canais",userConversations:"Conversas do usuário",userData:"Dados do utilizador",variables:"Variáveis"},nCt={light:"Claro",dark:"Escuro",system:"Sistema"},iCt={label:"Idioma",en:"English",de:"Deutsch",fr:"Français",es:"Español",ar:"العربية",zh:"中文",th:"ไทย",ja:"日本語",ko:"한국어",pt:"Português",hi:"हिन्दी"},sCt={dashboard:{title:"Painel",subtitle:"Visão geral dos seus agents e conversas EDDI",activeAgents:"Agents ativos",totalWorkflows:"Fluxos de trabalho",totalResources:"Recursos",totalConversations:"Conversas",quickActions:"Ações rápidas",recentAgents:"Agents recentes",noRecentAgents:"Nenhum agent ainda. Crie seu primeiro agent!"},agents:{title:"Agentes",subtitle:"Gerencie seus agents de IA conversacional"},packages:{title:"Fluxos de trabalho",subtitle:"Configure workflows e extensões de agents"},conversations:{title:"Conversas",subtitle:"Visualize e gerencie as conversas dos agents"},resources:{title:"Recursos",subtitle:"Gerencie regras de comportamento, dicionários, saídas e mais"},chat:{title:"Chat",subtitle:"Converse com seus agents implantados"},channels:{title:"Canais",subtitle:"Conecte agentes e grupos a plataformas de mensagens como o Slack"},groups:{title:"Grupos",subtitle:"Grupos de discussão multi-agente para debate estruturado e colaboração"}},rCt={loading:"Carregando...",error:"Algo deu errado",retry:"Tentar novamente",save:"Salvar",cancel:"Cancelar",delete:"Excluir",create:"Criar",edit:"Editar",search:"Pesquisar...",noResults:"Nenhum resultado encontrado",duplicate:"Duplicar",close:"Fechar",skipToMain:"Ir para o conteúdo principal",opensNewTab:"abre em nova aba",moreActions:"Mais ações",sortByName:"Ordenar por nome",sortByVersion:"Ordenar por versão",sortByModified:"Ordenar por data de modificação",apply:"Aplicar",copied:"Copiado",copy:"Copiar",saving:"A guardar…",showMore:"Show More",showLess:"Show Less",copyFailed:"Falha ao copiar para a área de transferência"},oCt={deploy:"Implementar",undeploy:"Remover",createAgent:"Criar agent",createTitle:"Criar novo agent",name:"Nome",namePlaceholder:"Meu Agent",description:"Descrição",descriptionPlaceholder:"Descreva o que este agent faz...",empty:"Nenhum agent ainda. Crie seu primeiro agent!",confirmDelete:"Tem certeza de que deseja excluir este agent?",count_one:"{{count}} agente",count_other:"{{count}} agentes",export:"Exportar",exporting:"Exportando...",exportSuccess:"Agent exportado com sucesso",import:"Importar agent",importing:"Importando...",importSuccess:"Agent importado com sucesso",importError:"Falha ao importar o agent",emptyDescription:"Use o assistente para criar um agente totalmente configurado em minutos.",chat:"Chat",deployAndChat:"Implantar e conversar",openExternalChat:"Abrir em nova aba"},aCt={title:"Detalhes do agent",backToAgents:"Voltar para Agents",packages:"Fluxos de trabalho",noWorkflows:"Nenhum workflow adicionado ainda",addWorkflow:"Adicionar workflow",selectWorkflow:"Selecionar workflow para adicionar",rawConfig:"Configuração bruta",editName:"Editar nome",editDescription:"Editar descrição",clickToEdit:"Clique para editar",noDescription:"Sem descrição",duplicate:"Duplicar",duplicating:"Duplicando...",duplicateSuccess:"Agent duplicado com sucesso",environments:"Ambientes",envProduction:"Produção",envTest:"Teste",savingAgent:"Salvando agent...",savedAgent:"Agent salvo com sucesso",saveError:"Falha ao salvar o agent",deployToEnv:"Implantar em {{env}}",undeployFromEnv:"Remover de {{env}}",openStudio:"Abrir no Estúdio",maxKeyLength:"Comprimento máx. da chave",maxValueLength:"Comprimento máx. do valor",maxWritesPerTurn:"Escritas máx./turno",dreamSchedule:"Agendamento (cron)",dreamLlmProvider:"Fornecedor LLM",dreamLlmModel:"Modelo LLM",dreamMaxCost:"Custo máx./execução ($)",dreamPruneDays:"Limpar após (dias)",dreamBatchSize:"Tamanho do lote",detectContradictions:"Detetar contradições",summarizeInteractions:"Resumir interações",confidenceLow:"Baixa",confidenceMedium:"Médio",confidenceHigh:"Alto",visibilitySelf:"próprio",visibilityGlobal:"global",onCapEvict:"Remover o mais antigo",onCapReject:"Rejeitar",recallMostRecent:"Mais recente",recallMostRelevant:"Mais relevante",channels:"Conectores de canal",channelsDesc:"Conecte este agente a canais do Slack. Cada conector é configurado independentemente com suas próprias credenciais, suportando configurações multi-workspace.",noChannels:"Nenhum canal configurado",noChannelsDesc:"Adicione um canal do Slack para permitir que os usuários interajam com este agente pelo Slack.",addSlackChannel:"Adicionar canal Slack",slackChannel:"Canal Slack",removeChannel:"Remover canal",removeChannelConfirm:"Remover este conector de canal Slack?",removeChannelDesc:"This action will permanently disconnect this channel.",channelId:"ID do canal",channelIdHint:"IDs de canal começam com C seguido de caracteres alfanuméricos maiúsculos",botToken:"Token do bot",botTokenPlaceholder:"xoxb-… ou ${vault:slack-bot-token}",botTokenHint:"Token OAuth de usuário bot do Slack. Use uma referência de vault para segurança.",signingSecret:"Segredo de assinatura",signingSecretPlaceholder:"String hexadecimal ou ${vault:slack-signing-secret}",signingSecretHint:"Da página de informações básicas do seu app Slack. Use uma referência de vault para segurança.",groupIdOptional:"ID do grupo (opcional)",groupIdPlaceholder:"ID de configuração de grupo multi-agente",groupIdHint:'Ative discussões multi-agente "group: pergunta" a partir deste canal Slack.',slackSetupGuide:"Guia de configuração do Slack",slackWebhookUrl:"URL do webhook",slackWebhookCopied:"URL do webhook copiada",slackStep1:"Crie um app Slack em api.slack.com/apps e instale-o no seu workspace.",slackStep2:"Copie o token do bot (xoxb-…) e o segredo de assinatura para o vault do EDDI e configure os canais abaixo.",slackStep3:"Em seguida, ative Event Subscriptions no seu app Slack, cole a URL do webhook acima e inscreva-se em:",slackSetupNote:"Importante: Configure o canal abaixo antes de ativar Event Subscriptions — o Slack envia um desafio de verificação de URL que requer que o segredo de assinatura esteja configurado no EDDI.",slackRequiredScopes:"Permissões de token do bot necessárias"},lCt={title:"Assistente de Agent"},cCt={title:"Assistente de criação de agent",subtitle:"Crie um agent totalmente configurado em minutos",backToAgents:"Voltar para Agents",next:"Próximo",back:"Voltar",createOnly:"Apenas criar",createAndDeploy:"Criar e implantar",typeTitle:"Que tipo de agent?",typeDesc:"Escolha o tipo de agent que deseja criar",standardAgent:"Agente padrão",apiAgent:"Agente API",standardDesc:"IA conversacional com LLM, ferramentas opcionais, Quick Replies e análise de sentimento",apiDesc:"Importe uma especificação OpenAPI/Swagger para gerar automaticamente um agent API",infoTitle:"Identidade do agent",infoDesc:"Dê um nome e personalidade ao seu agent",agentName:"Nome do agent",namePlaceholder:"ex. Bot de suporte ao cliente",systemPrompt:"Prompt do sistema",promptPlaceholder:"Você é um assistente de IA útil que...",promptHint:"Esta instrução define como seu agent se comporta e responde.",llmTitle:"Configuração LLM",llmDesc:"Escolha o modelo de IA que alimenta seu agent",provider:"Fornecedor",model:"Modelo",apiKey:"Chave API",baseUrl:"URL base",baseUrlPlaceholder:"URL de endpoint customizado",optional:"opcional",apiSpecTitle:"Especificação OpenAPI",apiSpecDesc:"Forneça a especificação OpenAPI/Swagger da sua API",specByUrl:"URL",specByFile:"Arquivo",specByPaste:"Colar",fetch:"Buscar",specFetched:"Especificação carregada!",specFetchError:"Falha ao buscar especificação",dropFile:"Arraste seu arquivo OpenAPI aqui",dropHint:"Formato JSON ou YAML",browse:"Procurar arquivos",pasteSpec:"Cole seu JSON ou YAML OpenAPI/Swagger aqui...",specLoaded:"Arquivo carregado: {{name}}",specReady:"Especificação carregada ({{chars}} caracteres)",apiBaseUrlLabel:"URL base da API",apiAuthLabel:"Cabeçalho de autenticação API",endpointFilter:"Filtro de endpoints",endpointFilterPlaceholder:"Separados por vírgula: GET /users, POST /orders",featuresTitle:"Recursos e opções",featuresDesc:"Customize as capacidades do seu agent",introMessage:"Mensagem de boas-vindas",introMessageDesc:"Mensagem exibida no início de uma conversa",quickReplies:"Respostas rápidas",quickRepliesDesc:"O LLM gera sugestões de respostas clicáveis",sentiment:"Análise de sentimento",sentimentDesc:"Detectar humor, intenção e urgência do usuário em tempo real",structuredOutput:"Saída estruturada",structuredOutputDesc:"O LLM responde com um objeto JSON em vez de texto simples",structuredOutputInfo:"Ao ativar, o LLM responde com um objeto JSON com campos estruturados. Um esquema JSON é adicionado ao prompt do sistema e o modelo é configurado para o modo de resposta JSON.",builtInTools:"Ferramentas integradas",builtInToolsDesc:"Ativar a biblioteca de ferramentas integradas do EDDI (calculadora, data/hora, etc.)",toolsWhitelist:"Whitelist (vazio = todas)",mcpServers:"Servidores MCP",mcpServersDesc:"Servidores Model Context Protocol para ferramentas externas",autoDeploy:"Auto-Deploy",autoDeployDesc:"Implantar o agent imediatamente após a criação",environment:"Ambiente",envProduction:"Produção",envTest:"Teste",reviewTitle:"Revisar e criar",reviewDesc:"Revise sua configuração antes de criar",reviewType:"Tipo",reviewName:"Nome",reviewPrompt:"Prompt do sistema",reviewProvider:"Fornecedor",reviewModel:"Modelo",reviewSpec:"Espec. OpenAPI",reviewIntro:"Mensagem de boas-vindas",reviewDeploy:"Implementar",success:"Agent criado com sucesso!",agentCreated:"Agent criado!",deployed:"Implantado",endpointsParsed:"{{count}} endpoints API analisados",viewAgent:"Ver agent",createAnother:"Criar outro",allTools:"Todas as ferramentas",selectSpecific:"Selecionar manualmente",allToolsInfo:"As {{count}} ferramentas incorporadas estarão disponíveis para o seu agente. Escolha «Selecionar manualmente» para definir quais ativar.",availableTools:"Ferramentas disponíveis",toolCount:"{{selected}} de {{total}} selecionadas"},dCt={createWorkflow:"Criar workflow",createTitle:"Criar novo workflow",name:"Nome",namePlaceholder:"Meu Workflow",description:"Descrição",descriptionPlaceholder:"Descreva o que este workflow faz...",noDescription:"Sem descrição",empty:"Nenhum workflow ainda. Crie seu primeiro workflow!",confirmDelete:"Tem certeza de que deseja excluir este workflow?",count_one:"{{count}} fluxo de trabalho",count_other:"{{count}} fluxos de trabalho",emptyDescription:"Os workflows definem o pipeline de processamento dos seus agentes."},uCt={title:"Detalhes do workflow",backToWorkflows:"Voltar para Workflows",extensions:"Extensões",noExtensions:"Nenhuma extensão neste workflow",rawConfig:"Configuração bruta"},hCt={title:"Editor de workflow",pipeline:"Pipeline de extensões",addHint:"Adicione extensões para construir sua pipeline",addHintDialog:"Selecione um tipo de extensão para adicionar",reorder:"Reordenar extensão",saved:"Workflow salvo com sucesso",saveError:"Erro ao salvar o workflow",noTasks:"Nenhuma tarefa neste workflow",addTask:"Adicionar tarefa"},gCt={searchPlaceholder:"Pesquisar por ID da conversa...",id:"Conversa",agent:"Agente",state:"Estado",lastActivity:"Última atividade",actions:"Ações",empty:"Nenhuma conversa ainda. Implante um agent e comece a conversar!",confirmDelete:"Tem certeza de que deseja excluir esta conversa?",count_one:"{{count}} conversa",count_other:"{{count}} conversas",emptyDescription:"Implante um agente e inicie uma conversa na página de Chat."},fCt={continueChat:"Continuar no chat",searchTranscript:"Pesquisar na conversa…",exportMd:"Exportar como Markdown",toolSummary:"Resumo de utilização de ferramentas",totalCost:"Custo total",cacheHitRate:"Taxa de acerto de cache"},pCt={selectAgent:"Selecione um agent...",noAgents:"Nenhum agent implantado disponível. Implante um agent primeiro.",placeholder:"Digite uma mensagem...",send:"Enviar",newConversation:"Nova conversa",endConversation:"Encerrar conversa",streaming:"Transmissão",thinking:"Pensando...",connectionError:"Erro de conexão. Tente novamente.",empty:"Selecione um agent e comece a conversar!",history:"Histórico",undo:"Desfazer última mensagem",redo:"Refazer mensagem",continueConversation:"Continuar",noHistory:"Nenhum histórico de conversas.",attach:"Anexar arquivo",attachUploading:"Enviando...",attachSuccess:"Arquivo anexado",attachError:"Falha ao enviar arquivo",retry:"Repetir última etapa",retrySuccess:"Etapa re-executada",retryError:"Falha na repetição",showActivity:"Mostrar atividade",hideActivity:"Ocultar atividade",scrollToBottom:"Descer",copyMessage:"Copiar mensagem",copied:"Copiado!",activity:{processing:"A processar…",steps:"passos",toolCalls:"chamadas de ferramentas",toolCall:"Chamada de ferramenta",toolResult:"Resultado"},channels:{title:"Canais",subtitle:"Conectar agentes e grupos a plataformas como Slack"},context:{conversationId:"ID da conversa",agentVersion:"Versão do agente",startTime:"Iniciado",stepCount:"Passos",show:"Mostrar informações da conversa",hide:"Ocultar informações da conversa"},agentTyping:"O agente está a escrever"},mCt={unnamed:"Recurso sem nome",noDescription:"Sem descrição",backToResources:"Voltar para Recursos",backToList:"Voltar para {{type}}",unknownType:"Tipo de recurso desconhecido",rawConfig:"Configuração bruta",rawConfigHint:"Configuração JSON deste recurso",create:"Criar {{type}}",createTitle:"Criar {{type}}",createDescription:"Criar uma configuração {{type}} vazia. Você pode editá-la após a criação.",confirmDelete:"Tem certeza de que deseja excluir este(a) {{type}}?",empty:"Nenhum recurso {{type}} ainda.",itemCount_one:"{{count}} item",itemCount_other:"{{count}} itens",count_one:"{{count}} recurso",count_other:"{{count}} recursos",types:{rules:{name:"Regras de comportamento",description:"Definir regras de fluxo de conversa e lógica de decisão"},apicalls:{name:"Chamadas HTTP",description:"Configurar integrações de API externas e webhooks"},output:{name:"Conjuntos de saída",description:"Gerenciar modelos de resposta e variantes de saída"},dictionary:{name:"Dicionários",description:"Definir padrões de reconhecimento de palavras e frases"},llm:{name:"LLM",description:"Configurar modelos de IA, prompts e vínculos de ferramentas"},propertysetter:{name:"Definidor de propriedades",description:"Definir propriedades de conversa e gerenciar preenchimento de slots"},mcpcalls:{name:"Chamadas MCP",description:"Configurar conexões MCP e chamadas de ferramentas deterministas"},rag:{name:"Bases de conhecimento",description:"Configurar bases de conhecimento RAG para recuperação de documentos"},snippets:{name:"Excertos",description:"Blocos de construcao reutilizaveis para prompts do sistema"}},emptyDescription:"Crie seu primeiro(a) {{type}} para usar em workflows."},bCt={formTab:"Formulário",jsonTab:"JSON",save:"Salvar",discard:"Descartar",saving:"Salvando...",saved:"Salvo com sucesso",saveError:"Falha ao salvar",dirty:"Alterações não salvas",version:"Versão",versionPicker:"Selecionar versão",readOnly:"Somente leitura",formPlaceholder:"Editor visual em breve. Use a aba JSON para editar.",jsonSchema:"Validação de esquema ativa",cascadeMode:"Alterações serão propagadas ao workflow e agent pai",usedInAgents:"Usado em {{count}} agent(s)",updateUsageHint:"Atualizar os workflows e agents selecionados para a nova versão?",updateUsage:"Atualizar selecionados",skipUpdate:"Pular",cascading:"Atualizando...",cascadeSuccess:"Atualização em cascata concluída",invalidJson:"JSON inválido — mude para a aba JSON para corrigir."},xCt={appendActions:"Adicionar ações",expressionsAsActions:"Expressões como ações",groups:"Grupos de comportamento",addGroup:"Adicionar grupo",groupName:"Nome do grupo",executionStrategy:"Estratégia de execução",rules:"Regras",addRule:"Adicionar regra",ruleName:"Nome da regra",actions:"Ações",noActions:"Sem ações",addAction:"Adicionar",actionPlaceholder:"ex. greet, get_weather",conditions:"Condições",addCondition:"Adicionar condição",conditionType:"Tipo de condição",nestedConditions:"Condições aninhadas",configKey:"Chave",configValue:"Valor",addConfig:"Adicionar config",removeRule:"Remover regra",removeGroup:"Remover grupo",removeCondition:"Remover condição",noGroups:"Nenhum grupo de comportamento definido",noRules:"Sem regras neste grupo",noConditions:"Sem condições"},vCt={targetServerUrl:"URL do servidor destino",targetServerUrlPlaceholder:"https://api.example.com",calls:"Chamadas HTTP",addCall:"Adicionar chamada HTTP",callName:"Nome da chamada",callDescription:"Descrição",descriptionPlaceholder:"Descrição em linguagem natural para agents LLM",request:"Requisição",method:"Método",path:"Caminho",pathPlaceholder:"/api/endpoint",headers:"Cabeçalhos",addHeader:"Adicionar header",queryParams:"Parâmetros de consulta",addQueryParam:"Adicionar parâmetro",contentType:"Tipo de conteúdo",body:"Corpo da requisição",bodyPlaceholder:"Modelo de corpo JSON...",parameters:"Parâmetros (para agents LLM)",paramName:"Nome do parâmetro",paramDescription:"Descrição",addParam:"Adicionar parâmetro",options:"Opções",saveResponse:"Salvar resposta",responseObjectName:"Nome do objeto resposta",responseHeaderObjectName:"Nome do objeto header resposta",fireAndForget:"Fire-and-Forget",batchCalls:"Chamadas em lote",iterationObjectName:"Nome do objeto iteração",prePostInstructions:"Instruções pré/pós",preRequest:"Pré-requisição",postResponse:"Pós-resposta",removeCall:"Remover chamada",noCalls:"Nenhuma chamada HTTP configurada",actions:"Ações disparadoras",noActions:"Sem ações",actionPlaceholder:"ex. get_weather"},_Ct={tasks:"Tarefas LLM",addTask:"Adicionar tarefa",noTasks:"Nenhuma tarefa LangChain configurada",removeTask:"Remover tarefa",taskId:"ID da tarefa",description:"Descrição",descriptionPlaceholder:"O que esta tarefa faz",triggerActions:"Ações disparadoras",noActions:"Sem ações",actionPlaceholder:"ex. help, chat",systemPrompt:"Prompt do sistema",systemPromptPlaceholder:"Você é um assistente útil...",modelParams:"Parâmetros do modelo",addParam:"Adicionar parâmetro",agentMode:"Modo agente",enableBuiltInTools:"Ativar ferramentas integradas",toolWhitelist:"Whitelist de ferramentas (vazio = todas)",enableHttpCallTools:"Auto-descoberta de ferramentas HTTP Call",enableHttpCallToolsDesc:"Expor automaticamente todas as extensões httpcall do workflow como ferramentas LLM",httpCallTools:"URIs de chamadas HTTP",httpCallToolsHint:"URIs httpcall explícitas (além das auto-descobertas)",addTool:"Adicionar URI de ferramenta",mcpServers:"Servidores MCP",mcpServersDesc:"Servidores MCP externos cujas ferramentas ficam disponíveis para o LLM",addMcpServer:"Adicionar servidor MCP",mcpUrlPlaceholder:"http://localhost:7070/mcp",mcpName:"Nome",mcpApiKey:"API Key / ref. vault",historyLimit:"Limite de histórico",historyLimitHint:"(-1 = ilimitado)",budgetPerf:"Desempenho e orçamento",maxBudget:"Orçamento máx. ($)",costTracking:"Rastreamento de custos",toolCaching:"Cache de ferramentas",rateLimiting:"Limitação de taxa",defaultRate:"Taxa padrão (req/min)",prePostInstructions:"Instruções pré/pós",preRequest:"Pré-requisição",postResponse:"Pós-resposta",enableMcpCallTools:"Deteção automática de ferramentas MCP",enableMcpCallToolsDesc:"Expor automaticamente todas as extensões mcpcalls do fluxo de trabalho como ferramentas LLM",a2aAgents:"Agentes A2A",a2aAgentsDesc:"Agentes remotos compatíveis com A2A cujas competências se tornam ferramentas LLM",addA2aAgent:"Adicionar agente A2A",a2aUrlPlaceholder:"https://remote.example.com/a2a/agents/...",a2aName:"Nome de exibição",a2aApiKey:"${vault:my-a2a-key}",a2aTimeout:"Tempo limite (ms)",a2aSkillsFilter:"Filtro de competências (vazio = todas)",cascade:"Cascata de modelos",cascadeDesc:"Try a cheap/fast model first. If confidence is too low, automatically escalate to a more powerful (and expensive) model.",cascadeEnable:"Ativar cascata de modelos",cascadeStrategy:"Estratégia",strategyCascade:"Escalamento sequencial",strategyParallel:"Paralelo (futuro)",cascadeStrategyHint:"Tenta primeiro o modelo económico, escala se a confiança for baixa",cascadeEvalStrategy:"Avaliação de confiança",cascadeEvalHint:"Como determinar se a resposta é suficientemente boa",evalStructured:"Saída estruturada (JSON)",evalHeuristic:"Heurística (deteção de hesitação)",evalJudge:"Modelo juiz (LLM secundário)",evalNone:"Nenhuma (aceitar sempre)",cascadeInAgent:"Usar cascata também no modo agente (com ferramentas)",cascadeSteps:"Cascade Steps",cascadeStepsDesc:"Order matters: first step tried first. Last step is always accepted.",cascadeModelName:"ex. claude-sonnet-4-6",cascadeConfidence:"Min. Confidence (0-1)",cascadeConfidencePlaceholder:"vazio = aceitar sempre",cascadeTimeout:"Tempo limite (ms)",addCascadeStep:"Adicionar passo de cascata",parallelExecution:"Execução paralela de ferramentas",parallelExecutionDesc:"Run independent tool calls concurrently",parallelTimeout:"Tempo limite (ms)",maxToolIterations:"Máx. iterações de ferramentas",maxToolIterationsHint:"(predefinição 10)",toolRateLimits:"Limites de taxa por ferramenta",toolRateLimitsDesc:"Override default rate for specific tools",toolName:"Nome da ferramenta",addToolRate:"Adicionar limite de taxa",retryConfig:"Configuração de novas tentativas",retryDesc:"Configure automatic retries with exponential backoff.",retryMaxAttempts:"Máx. tentativas",retryDelay:"Atraso inicial (ms)",retryMultiplier:"Multiplicador de backoff",retryMaxDelay:"Atraso máx. (ms)",ragConfig:"RAG (Recuperação de conhecimento)",ragDesc:"Augment LLM responses with retrieved documents.",ragHttpCall:"URI de chamada HTTP",ragEmbeddingModel:"Modelo de embedding",ragEmbeddingModelPlaceholder:"ex. text-embedding-3-small",ragEmbeddingStore:"Armazém de embeddings",ragEmbeddingStorePlaceholder:"ex. pgvector, qdrant",ragMaxResults:"Máx. resultados",ragMinScore:"Min Similarity Score (0-1)",moveDown:"Descer",moveUp:"Subir",execution:"Execução",budgetCosts:"Orçamento e custos",preRequestDesc:"Definir ou transformar propriedades antes da execução do LLM.",postResponseDesc:"Processar saída do LLM: definir propriedades, construir mensagens de saída e gerar respostas rápidas.",postPropertyInstructions:"Instruções de propriedades",postOutputInstructions:"Instruções de saída",postQrInstructions:"Instruções de respostas rápidas",allSkills:"Todas as competências",skillPlaceholder:"ex. order-tracking",modeAgent:"Agente",modeChat:"Chat",perMinute:"/min",allTools:"Todas as ferramentas",selectSpecific:"Selecionar manualmente",allToolsInfo:"Todas as {{count}} ferramentas incorporadas estão disponíveis para o LLM. Escolha «Selecionar manualmente» para definir quais expor.",availableTools:"Ferramentas disponíveis",toolCount:"{{selected}} de {{total}} selecionadas",toolSources:"Fontes de ferramentas do fluxo de trabalho",toolSourcesInfo:"Ambas as fontes estão ativas por predefinição — todas as chamadas HTTP e MCP do fluxo de trabalho são automaticamente expostas como ferramentas LLM. Desative uma fonte para excluí-la.",included:"Incluído"},yCt={language:"Idioma",langPlaceholder:"ex. en, pt",outputSets:"Conjuntos de saída",addOutputSet:"Adicionar conjunto de saída",noOutputSets:"Nenhum conjunto de saída configurado",actionName:"Nome da ação",timesOccurred:"×",removeOutput:"Remover",outputs:"Saídas",alternativeGroup:"Grupo alternativo",addAlternative:"Adicionar alternativa",addOutputGroup:"Adicionar grupo de saída",textPlaceholder:"Texto de saída...",urlPlaceholder:"URL…",delayMs:"Atraso (ms)",quickReplies:"Respostas rápidas",noQuickReplies:"Sem Quick Replies",addQuickReply:"Adicionar Quick Reply",qrValue:"Texto do botão",qrExpressions:"Expressões",default:"Padrão"},wCt={setters:"Definidores",addSetter:"Adicionar setter",noSetters:"Nenhum Property Setter configurado",removeSetter:"Remover",triggerActions:"Ações disparadoras",noActions:"Sem ações",actionPlaceholder:"ex. greet, fallback",properties:"Propriedades",noProperties:"Sem propriedades",addProperty:"Adicionar propriedade",propName:"Nome da propriedade",propValue:"Valor / expressão",fromPath:"Caminho de origem",fromObjectPath:"fromObjectPath",override:"Sobrescrever",propsCount:"prop.",untitled:"(sem ações)"},CCt={language:"Idioma",langPlaceholder:"ex. en, pt",words:"Palavras",addWord:"Adicionar palavra",wordPlaceholder:"ex. olá",phrases:"Frases",addPhrase:"Adicionar frase",phrasePlaceholder:"ex. bom dia",regExs:"Expressões regulares",addRegEx:"Adicionar RegEx",regexPlaceholder:"Expressão regular",expressionPlaceholder:"ex. greeting(hello)",frequency:"Frequência",none:"Nenhuma definida"},SCt={title:"Painel do coordenador",subtitle:"Monitorar processamento de conversas e gerenciar entradas dead-letter",type:"Tipo de coordinador",connection:"Conexão",processed:"Tarefas processadas",deadLettered:"Mensagens mortas",activeQueues:"Filas ativas",queued:"na fila",deadLetterTitle:"Mensagens mortas",noDeadLetters:"Sem entradas dead-letter",colId:"ID",colConversation:"Conversa",colError:"Erro",colTime:"Hora",colActions:"Ações",replay:"Reprocessar",discard:"Descartar",purgeAll:"Limpar tudo",confirmPurge:"Limpar tudo?",yes:"Sim",cancel:"Cancelar",replaySuccess:"Dead-letter reprocessada",replayError:"Falha ao reprocessar",discardSuccess:"Dead-letter descartada",discardError:"Falha ao descartar",purgeSuccess:"Todas as entradas dead-letter removidas",purgeError:"Falha ao limpar",empty:"Nenhum dado do coordenador disponível",emptyHint:"O serviço do coordenador pode ainda estar iniciando. Os dados aparecerão automaticamente."},kCt={expand:"Expandir",expandHint:"Tela cheia (Ctrl+Shift+F)",close:"Concluído",lines:"linhas",chars:"caracteres",fullscreenTitle:"Editor de conteúdo",fullscreenDescription:"Editor em tela cheia. Escape para fechar."},NCt={title:"Registros",description:"Monitorar o fluxo de logs em tempo real ou pesquisar no histórico.",tabLive:"Ao vivo",tabHistory:"Histórico",connected:"Conectado",disconnected:"Desconectado",filterAgent:"ID do agente…",filterConversation:"ID da conversa...",filterInstance:"ID da instância...",allLevels:"Todos os níveis",pause:"Pausa",resume:"Retomar",clear:"Limpar",search:"Pesquisar",waitingForLogs:"Aguardando logs...",connectingStream:"Conectando ao stream...",noHistoryLogs:"Nenhum log histórico encontrado.",entryCount:"{{count}} entradas",showStacktrace:"Mostrar stacktrace ({{count}} frames)",hideStacktrace:"Ocultar stacktrace",allAgents:"Todos os agentes",allConversations:"Todas as conversas",waitingHint:"Os logs aparecerão aqui conforme são transmitidos pelo backend.",noHistoryHint:"Tente ajustar os filtros ou pesquisar um agente ou conversa diferente.",searchConversations:"Pesquisar por ID, agente, usuário…",stepsCount:"{{count}} passos",noConversationsFound:"Nenhuma conversa encontrada",useConversationId:"Usar ID: {{id}}",searchLogs:"Pesquisar logs…",errors:"erros",warnings:"avisos",infos:"info",debugs:"depuração",filteredCount:"{{shown}} de {{total}} entradas",copyEntry:"Copiar entrada de log",export:"Exportar",stateReady:"Pronto",stateActive:"Ativo",stateError:"Erro",stateEnded:"Encerrado"},ECt={title:"Cofre de segredos",description:"Gerenciar secrets criptografados no vault. Os valores nunca são expostos.",tenantId:"ID do inquilino",refresh:"Carregar secrets",create:"Adicionar secret",createTitle:"Adicionar secret",keyName:"Nome da chave",keyNameLabel:"Nome da chave",keyNamePlaceholder:"ex. apiKey, dbPassword",valueLabel:"Valor do secret",valuePlaceholder:"Insira o valor do secret…",storeWarning:"O valor será criptografado. Não poderá ser recuperado após o armazenamento.",store:"Armazenar secret",storeSuccess:'Secret "{{key}}" armazenado',deleteSuccess:'Secret "{{key}}" excluído',created:"Criado",lastAccessed:"Último acesso",checksum:"Soma de controlo",actions:"Ações",confirmDeleteTitle:"Excluir secret",confirmDeleteMessage:'Tem certeza de que deseja excluir permanentemente "{{key}}"? Esta ação não pode ser desfeita.',empty:"Nenhum secret encontrado",emptyHint:"Crie um secret ou altere os filtros de namespace acima.",vaultUp:"Vault online",vaultDown:"Vault offline",descriptionLabel:"Descrição (opcional)",descriptionPlaceholder:"ex: Chave API OpenAI para produção",descriptionCol:"Descrição",reference:"Referência",willUseRef:"Referência:",copyRef:"Copiar referência do cofre",refCopied:"Copiado: {{ref}}",lastRotated:"Última rotação",scopeExplanation:"Segredos com escopo por locatário e partilhados. Referenciar como ${vault:keyName}.",creatingFor:'Armazenando no locatário "{{tenant}}" — disponível para todos os agentes',vaultNotConfigured:"Cofre de segredos não configurado",viewDocs:"Ver documentação",selectAgentFirst:"Selecione um agente primeiro",tableTitle:'{{count}} segredo(s) no locatário "{{tenant}}"'},LCt={title:"Registo de auditoria",description:"Explore o registro de auditoria imutável para conformidade e depuração.",byConversation:"Por conversa",byAgent:"Por agent",conversationIdPlaceholder:"Insira ID da conversa...",agentIdPlaceholder:"Insira Agent ID...",versionPlaceholder:"Versão (opcional)",search:"Pesquisar",entries:"entradas",totalDuration:"total",totalCost:"custo total",step:"Etapa",tasks:"tarefas",input:"Entrada",output:"Saída",llmDetail:"Detalhe LLM",toolCalls:"Chamadas de ferramentas",hmacIntegrity:"Integridade HMAC verificada",empty:"Pesquisar entradas de auditoria",emptyHint:"Insira um ID de conversa ou agent acima para explorar o audit trail.",noResults:"Nenhuma entrada de auditoria encontrada",noResultsHint:"Tente outro ID ou verifique se a conversa foi processada.",loadMore:"Carregar mais",selectAgent:"Select an agent…",conversations:"conversations",emptyAgent:"Select an agent to view its audit trail",emptyAgentHint:"Choose a deployed agent from the dropdown above to see all its audit records.",export:"Export",autoRefreshToggle:"Toggle auto-refresh (every 10s)",autoRefreshOn:"Auto",autoRefreshOff:"Auto",integrityVerified:"All entries cryptographically signed",integrityVerifiedDesc:"{{count}} of {{total}} entries have HMAC-SHA256 signatures",integrityPass:"SIGNED",integrityPartial:"Partially signed audit trail",integrityPartialDesc:"{{count}} of {{total}} entries have HMAC signatures",integrityNone:"Unsigned audit entries",integrityNoneDesc:"Configure a vault master key to enable automatic HMAC-SHA256 signing on all future audit entries.",signed:"Signed",allSigned:"All signed"},DCt={title:"Agendamentos",subtitle:"Gerenciar gatilhos programados de agents — Cron e Heartbeats",create:"Criar agendamento",createTitle:"Criar agendamento",createSuccess:"Agendamento criado com sucesso",createError:"Falha ao criar agendamento",creating:"Criando...",name:"Nome",namePlaceholder:"ex. Verificação diária",triggerType:"Tipo de gatilho",cronExpression:"Expressão Cron",interval:"Intervalo (segundos)",agentId:"Agent ID",agentIdPlaceholder:"Insira Agent ID...",environment:"Ambiente",message:"Mensagem",messagePlaceholder:"Mensagem a enviar ao agent",conversationStrategy:"Estratégia de conversa",total:"Total de agendamentos",active:"Ativos",failedCount:"Falhas / Dead-Lettered",nextFireLabel:"Próxima execução",tableTitle:"Todos os agendamentos",empty:"Nenhum agendamento ainda",emptyHint:"Crie um agendamento para automatizar gatilhos de agents.",colName:"Nome",colType:"Tipo",colSchedule:"Agendamento",colAgent:"Agente",colStatus:"Status",colNextFire:"Próxima exec.",colLastFired:"Última exec.",colActions:"Ações",enable:"Ativar",disable:"Desativar",enabled:"Agendamento ativado",disabled:"Agendamento desativado",toggleError:"Falha ao alternar o agendamento",fireNow:"Executar agora",fired:"Agendamento executado com sucesso",fireError:"Falha na execução",retry:"Tentar novamente",retrySuccess:"Agendamento reenfileirado",retryError:"Falha ao retentar",deleteSuccess:"Agendamento excluído",deleteError:"Falha ao excluir o agendamento",fireHistory:"Histórico de execução"},TCt={title:"Depurar",tabPipeline:"Pipeline",tabCosts:"Custos",tabMemory:"Memória",tabLogs:"Registos",tabPrompt:"Prompt",turn:"Turno",latest:"Último",noPipeline:"Envie uma mensagem para ver o rastreio do pipeline",processing:"Processando...",actions:"Ações",confidence:"Confiança",duration:"Duração"},ICt={thisTurn:"Este turno",conversationTotal:"Total da conversa",tokens:"Tokens",cost:"Custo",duration:"Duração",model:"Modelo",toolCalls:"Chamadas de ferramenta",toolUsage:"Uso de ferramentas",cacheStats:"Cache",hitRate:"Taxa de acerto",empty:"Envie uma mensagem para ver as métricas de custo",in:"entrada",out:"saída",total:"total",calls:"chamadas"},ACt={title:"Memória da Conversa",noConversation:"Inicie uma conversa para inspecionar a memória",empty:"Nenhum dado de memória disponível",properties:"Propriedades",step:"Passo",keys:"chaves",input:"Entrada"},RCt={noAgent:"Selecione um agente para ver os logs",search:"Buscar...",pause:"Pausar",resume:"Retomar",clear:"Limpar",waiting:"Aguardando logs...",connected:"Conectado",disconnected:"Desconectado",logOutput:"Saída do log"},MCt={noConversation:"Inicie uma conversa para inspecionar os prompts",noLlm:"Nenhuma interação de LLM encontrada ainda",turn:"Turno",latest:"Último",tokens:"Tokens",model:"Modelo",cost:"Custo",copy:"Copiar Prompt",copied:"Copiado!",replay:"Repetir Este Turno",toolCalls:"Chamadas de ferramenta",step:"Passo",roleSystem:"Prompt de Sistema",roleUser:"Usuário",roleAssistant:"Assistente",roleTool:"Resultado da Ferramenta"},PCt={preview:"Pré-visualização",edit:"Editar",switchToPreview:"Pré-visualizar prompt resolvido",switchToEdit:"Mudar para edição",refresh:"Atualizar",sampleData:"Dados de exemplo (sem conversa)",disclaimerReal:"A pré-visualização usa o motor Qute com dados reais da conversa.",disclaimerSample:"A pré-visualização usa o motor Qute com dados de exemplo. Selecione uma conversa para valores reais.",resolvedPrompt:"Prompt resolvido",copy:"Copiar",copied:"Copiado!",error:"Erro ao resolver o template",loading:"A resolver template…",availableVariables:"Variáveis disponíveis",copyVariable:"Clique para copiar a referência da variável",varProperties:"Propriedades",varMemory:"Memória",varContext:"Contexto",varSnippets:"Excertos",varUserInfo:"Informações do utilizador",varConversationInfo:"Informações da conversa",varInput:"Entrada",varConversationLog:"Registo da conversa"},OCt={title:"Agent Studio",subtitle:"Construa, teste e depure seus agentes em um único espaço",pipeline:"Pipeline",editor:"Editor",debug:"Debug e Chat",selectStage:"Clique em uma etapa do pipeline para abrir o editor",openInStudio:"Abrir no Studio",loading:"Carregando agente...",notFound:"Agente não encontrado",hideChat:"Ocultar chat",showChat:"Mostrar chat",openEditor:"Abrir no Editor",editorComingSoon:"Integração do editor no local em breve",noPipeline:"Nenhuma etapa no pipeline",type:{parser:"Analisador",rules:"Regras",property:"Setter de propriedade",apicalls:"Chamadas API",llm:"LLM",output:"Saída","output.template":"Modelo de Saída",mcpcalls:"Chamadas MCP",rag:"Base de conhecimento",dictionary:"Dicionário"},landingDescription:"Selecione um agente para abrir o editor visual de pipeline, depurador e chat em direto",noAgents:"Nenhum agente encontrado — crie um na página de Agentes",chat:"Chat",backToAgent:"Voltar ao agente",selectStageHint:"Selecione uma extensão no pipeline para ver e editar a sua configuração em linha",noConfig:"Esta etapa do pipeline não tem URI de configuração",unsupportedType:"Editor não disponível para este tipo de extensão"},jCt={general:"Geral",kbName:"Nome da Base de Conhecimento",kbNamePlaceholder:"ex: docs-produto, faq, wiki-interna",kbNameHint:"Usado para referenciar esta base a partir de tarefas de LLM",embeddingModel:"Modelo de Embedding",provider:"Fornecedor",embeddingParams:"Parâmetros do Provedor",embeddingParamsHint:"Chave de API (use ${vault:...} para segredos), URL, etc.",vectorStore:"Loja de Vetor",storeType:"Tipo de Armazenamento",storeParams:"Parâmetros de Conexão",chunking:"Fragmentação de Documentos",chunkStrategy:"Estratégia",chunkSize:"Tamanho",chunkOverlap:"Sobreposição",overlapHint:"A sobreposição ajuda a manter o contexto entre os fragmentos",chunkPreview:"Visualização do fragmento",chunkBlocks:"{{count}} partes de ~{{size}} char com {{overlap}} de sobreposição",retrievalDefaults:"Opções de Recuperação Padrão",retrievalHint:"Pode ser substituído em cada tarefa em configurações de LLM.",maxResults:"Resultados Máx (top-K)",minScore:"Pontuação Mín. de Similaridade",ingestion:"Ingestão de Documentos",dropFiles:"Arraste os documentos aqui para ingestão",dropHint:"Texto, Markdown ou qualquer arquivo de texto",browse:"Navegar",pasteText:"Ou cole o texto aqui",pastePlaceholder:"Cole o texto do documento aqui...",ingestText:"Ingerir Texto",ingestionHistory:"Status de Ingestão",saveFirstIngestion:"Salve a base de conhecimento primeiro para ativar a ingestão.",addParam:"Adicionar Parâmetro"},FCt=JSON.parse('{"welcome":{"title":"Bem-vindo ao EDDI","subtitle":"Seu Centro de Comando de Agentes IA","introText":"EDDI Manager é o seu controle para construir, testar e operar agentes de conversação inteligentes.","capabilitiesTitle":"O Que Você Pode Fazer","capabilitiesSubtitle":"Tudo que você precisa para criar agentes IA prontos para produção","buildAgents":"Criar Agentes","buildAgentsDesc":"Configure agentes IA usando o assistente ou do zero","designWorkflows":"Design de Workflows","designWorkflowsDesc":"Construtor visual de regras, fluxos LLM e ferramentas API","testRealtime":"Testar em Tempo Real","testRealtimeDesc":"Converse e execute rastreamento e debug de pipeline na hora","monitorOperate":"Monitorar e Operar","monitorOperateDesc":"Conversas, auditoria visual, controle de cotas e acesso a segredos num só painel","readyTitle":"Pronto para Começar?","readySubtitle":"Você pode rever e reiniciar este e outros tours sempre que precisar no menu Ajuda","startTour":"Iniciar o Tour","exploreOwn":"Vou explorar sozinho"},"tour":{"back":"Voltar","next":"Próximo","skip":"Pular Tour","finish":"Concluir","stepOf":"Passo {{current}} de {{total}}","dashboard":{"title":"Tour pelo Dashboard","step1Title":"Seu Centro de Comando","step1Desc":"Navegue pela plataforma através destas três áreas vitais: Gestão, Desenvolvimento e Operações.","step2Title":"Resumo da Plataforma","step2Desc":"Mostrador analítico global online de agentes habilitados, rotinas de processos e históricos de chat.","step3Title":"Ações Rápidas","step3Desc":"Use nosso acesso rápido para inicializar um workflow completo com pouquíssimos cliques velozmente.","step4Title":"Customização Visual","step4Desc":"Selecione perfis claros, embutidos do tipo noturno ou sistema padrão, de visual."},"agents":{"title":"Tour de Agentes","step1Title":"Assistente de agente","step1Desc":"Siga instruções dinâmicas configurando comportamento verbal artificial.","step2Title":"Construção Autônoma","step2Desc":"Trabalho manual ideal para profissionais em Json avançados sobre demanda local.","step3Title":"Busca Inteligente","step3Desc":"Procure referências velozes e localize imediatamente suas chaves.","step4Title":"Painel Visual","step4Desc":"Veja descritivos contendo versão global de seus lançados ativáveis e prontos para acionamentos."},"workflows":{"title":"Tour de Workflows","step1Title":"Estruturas Construtivas Lógicas Opcional Físicas Seguras Completas Vitais Inteiras Cloud","step1Desc":"Formas processáveis da engrenagem do cérebro virtual do núcleo cognitivo relacional textual analítico semântico.","step2Title":"Diagramas Acolhedores Simples Lógicos Virtuais Livres Complexos Livres Seguros Reais Completos Cloud","step2Desc":"Interligue ordens operacionais visuais numa progressiva cascata.","step3Title":"Organização do Quadro Textual Livre Local Direto Veloz Físico Lógico Amplo Completo Seguro Eficaz Cloud","step3Desc":"Administre listas para visual panorâmico sem confusões técnicas adicionais textuais ou estáticas."},"chat":{"title":"Tour de Chat","step1Title":"Fila Dinâmica e Contínua Aberta Flexível Direta Funcional Operacional Produtiva Cloud","step1Desc":"Selecione modelos já aplicados numa zona para interlocução real com a inteligência cognitiva em andamento local online livre direta estática texturizada vital fluída.","step2Title":"Respostas Lidas Transcorrendo Abertas Contínuas Lógicas Reais Funcionais Limpas Cloud","step2Desc":"Veja os componentes resultantes da linguagem artificial serem carregados sequencialmente a vista de todos no monitoramento fluído vital livre direto.","step3Title":"Recuperação Lógica Simples Livre Lida Real Física Dinâmica Constante Oportuna Forte Forte","step3Desc":"Use o histórico e reinsirá na mesma discussão anterior se as metas não foram completadas para testagem semântica.","step4Title":"Disparo Lógico Prático Simples Amplo Contínuo Direto Amigável Seguro Eficaz Vital","step4Desc":"Escreva pedidos complexos e confirme em tela a chamada a extensões externas feitas para buscar a precisão de serviço dinâmico real on-line lógico funcional cloud vital livre direto físico."},"channels":{"title":"Canais","subtitle":"Conectar agentes e grupos a plataformas como Slack"},"resources":{"title":"Tour de Recursos","step1Title":"Galeria Universal Simples Física Livre Direta Aplicável Segura Cloud Estática Lógica Visual Real Completa Forte","step1Desc":"Bandeja lógica central integrando tudo num local, configurando o esqueleto autônomo da máquina cognitiva e linguística.","step2Title":"Especificações Textuais LLM Abertas Seguras Fluidas Vivas Produtivas Aplicáveis Livres","step2Desc":"Estabeleça conexões vitais às redes OpenAI, Claude entre outros via parametrização simplificada visual amigável aplicável direta limpa contínua real lógica forte vital segura opcional fluida livre cloud física veloz funcional.","step3Title":"Leis Autônomas Ininterruptas Locais Diretivas Diretas Textuais Dinâmicas Lógicas Complexas","step3Desc":"Ative fluxos fixados determinísticos sem os custos excessivos ou imprevisibilidade típica de lógicas textuais artificiais livres e lógicas vitais cloud reais diretas fortes limpas autônomas aplicáveis completas dinâmicas virtuais amplas fluídas eficientes práticas livres opcionais físicas visuais diretas contínuas práticas locais seguras operacionais funcionais dinâmicas autônomas."},"conversations":{"title":"Tour de Conversas","step1Title":"Consulta Prática","step1Desc":"Retorne IDs passadas pesquisando metadados ativamente e achando rastros.","step2Title":"Catálogo Triativo","step2Desc":"Classifique as falas de IA sobre encerramentos com êxito ou problemas temporais pendentes.","step3Title":"Inspeção","step3Desc":"Rode o depurador interno de logs, memória, prompts e rastreios isolando incidentes conversacionais locais práticos textuais operacionais on-line aplicáveis efetivos."},"groups":{"title":"Tour de Grupos","step1Title":"Espaço Coletivo Colaborativo Lógico Semântico Vital Cloud Direto Livre Prático Contínuo Visual Seguro Completo Real","step1Desc":"Ative clusters agregadores centralizando debate cruzado artificial orgânico visual seguro contínuo aplicável lógico vital real prático veloz limpo direto cloud funcional fluído livre eficaz dinâmico amplo forte estático online flexível aberto autônomo contínuo contínuo texturizado.","step2Title":"Catalogação Visual Lógica Direta Rastreio","step2Desc":"Localize em tabela todos os espaços partilhados ativados e alocados para usos analíticos textuais diretos.","step3Title":"Decisões Flexíveis Autônomas Fluidas Oportunas Fortes Seguras Práticas Atuais Eficazes Vitais Visuais Diretas Lógicas Físicas Amplas Reais Cloud","step3Desc":"Remodele os debates virtuais ativos ou expurgue configurações passadas de espaços paralelos integrados lógicos online diretos locais livres práticos eficazes vivos ágeis textuais contínuos dinâmicos seguros fortes fluidos limpos aplicáveis cloud práticos ágeis físicos fluidos visuais vitais lógicos amplos reais simples."},"logs":{"title":"Tour de Logs","step1Title":"Registros em Aberto Live Físico Vital Local Constante Lógico Flexível Rápido Forte Eficaz Físico Direto Textual Prático Cloud","step1Desc":"Tenha observação contínua de respostas em tela para análises pontuais autônomas textuais operacionais vitais seguras textuais limpas fáceis reais práticas dinâmicas rápidas cloud fortes seguras visuais ativas flexíveis autônomas livres lógicas seguras amplas eficazes dinâmicas fluidas diretas seguras físicas rápidas atuais online práticas","step2Title":"Restrição Focada Dinâmica Direta Simples Fluída","step2Desc":"Classifique somente alertas pesados ignorando logs pacíficos em sistemas contínuos.","step3Title":"Exportar","step3Desc":"Tenha cópia física do evento via exportação TXT padronizada textualmente ampla livre limpa rápida."},"secrets":{"title":"Tour do Cofre","step1Title":"Entradas Cifradas Blindadas Lógicas Seguras Cloud","step1Desc":"Arquive autenticações longe das chaves publicáveis textuais e JSON baseadas visuais locais reais.","step2Title":"Defesa Modular Individualizada Local Segura Forte Prática Visual Atual Ativa Fluida Dinâmica Cloud","step2Desc":"Mantenha limites lógicos definidos restritos por subcontas Cloud diretas práticas textuais reais seguras amplas simples.","step3Title":"Acesso Dinâmico Livre","step3Desc":"Passe tokens indiretos para o uso de APIs externas de agentes lógicos fortes reais práticos flexíveis."},"audit":{"title":"Tour de Auditoria","step1Title":"Inspeção","step1Desc":"Use metadados do rastreador para procurar transações arquivadas na matriz temporal relacional.","step2Title":"Garantias Operacionais Verificáveis Textuais Lógicas Cloud Seguras Físicas Visuais Diretivas Práticas Simples Seguras Fortes Cloud Amplas Dinâmicas Reais Atuais Eficazes Fortes Visuais Fáceis Práticas Livres","step2Desc":"Ative consultas imutáveis seguras demonstrando exatidão corporativa legal vital lógica relacional.","step3Title":"Coleta Fria Seca Lógica Completa Plena Visual Autônoma Fluída Ampla Limpa Seguro Prático Cloud Livre Eficaz Dinâmica Direta Segura Fluída Ágil Físico Lógico Ampla Atual Flexível Real Autônomo Físico","step3Desc":"Guarde a extração dos metadados exportados perfeitamente auditáveis sem riscos jurídicos pontuais fortes reais contínuos ágeis locais físicos seguros vitais visuais fluidos práticos livres Cloud rápidos seguros. Seguros."},"schedules":{"title":"Tour de Agendamentos","step1Title":"Criar Tarefa Recorrente","step1Desc":"Configure cron jobs ou heartbeats para gatilhos do agente.","step2Title":"Estatísticas de Saúde","step2Desc":"Monitore tarefas ativas e resolvidas no tenant atual.","step3Title":"Gestão Própria","step3Desc":"Edite, reative ou teste a aplicação instantaneamente livre lógico seguro."},"quotas":{"title":"Tour de Cotas","step1Title":"Limite Tarifário","step1Desc":"Construção de faturamento sem abusos ou gastos exponenciais Cloud atreladas.","step2Title":"Dados de Monitor","step2Desc":"Saiba métricas diárias on line de atividades em progresso logadas.","step3Title":"Modificadores Fixos","step3Desc":"Implemente cortes vitais reais nas margens do banco restritivo de fluxos visuais seguros diretos locais dinâmicos lógicos fluidos autônomos práticos amplos."},"coordinator":{"title":"Tour do Coordenador","step1Title":"Sinais Operários Vivos","step1Desc":"Monitores atáveis dinâmicos lógicos fluidos livres ágeis aplicáveis de eventos back end vitais lógicos locais reais diretos visuais simples dinâmicos.","step2Title":"Ordens Correntes Dinâmicas","step2Desc":"Perceba os volumes processuais em progresso lidos on line lógicos locais visuais seguros textuais abertos.","step3Title":"Letras mortas","step3Desc":"Ataques de rotinas travadas prontas ao descarte rápido seguro de banco relacional livre local seguro autônomo limpo virtual lógico dinâmico veloz."},"orphans":{"title":"Tour de Órfãos","step1Title":"Caçador Virtual Aberto","step1Desc":"Mapeia esquemas isolados de ligações diretas a cadeias vitais seguras.","step2Title":"Bens Escondidos Históricos","step2Desc":"Inclua nas deleções temporárias antigos expurgos textuais livres lógicos visuais seguros atuais. Cloud","step3Title":"Coletoria Virtual Fechada Lógica Textual Direta Cloud Dinâmica Real Limpa Simples Prática Segura Físico","step3Desc":"Dê fim conclusivo visando alívios imobiliários de servidores locais textuais abertos lógicos reais aplicáveis físicos seguras fluidos livres lógicos práticos velozes limpos diretos amplos vitais locais autônomos. Eficazes Seguras Seguras."}},"help":{"title":"Ajuda e Tour","platformTour":"Tour da Plataforma","resetAll":"Redefinir Todos os Tours","resetConfirm":"Deseja redefinir todo o progresso dos tours?"},"offer":{"message":"Novo por aqui? Inicie o {{page}}","accept":"Mostrar","dontAsk":"Não perguntar novamente"}}'),BCt={status:"Estado da plataforma",online:"Online",offline:"Offline",checking:"Verificando conexão…",connected:"Conectado",disconnected:"Desconectado",instance:"Instância",latency:"Latência",lastChecked:"Última verificação",justNow:"agora",secondsAgo:"há {{count}}s"},HCt={live:"Ao vivo",reconnecting:"Reconectando…"},WCt={title:"Novo {{type}}",newAgent:"Novo Agente",newGroup:"Novo Grupo",quickCreate:"Criação Rápida",quickCreateTitle:"Criação Rápida de {{type}}",quickCreateDesc:"Defina nome e descrição. Configure os detalhes de pipeline mais tarde.",guidedSetup:"Configuração Guiada",guidedSetupDesc:"Assistente passo a passo integrado com modelo LLM e regras básicas."},VCt={empty:"Nenhum grupo ainda",emptyDescription:"Grupos permitem que múltiplos agentes colaborem em discussões estruturadas.",createGroup:"Criar grupo",unnamed:"Grupo sem nome",count_one:"{{count}} grupo",count_other:"{{count}} grupos",confirmDelete:"Excluir este grupo?",confirmDeleteDesc:"A configuração do grupo será excluída permanentemente.",duplicateSuccess:"Grupo duplicado",noDescription:"No description",members:"members",discussionStyle:"Discussion Style",maxRounds:"Max Rounds"},zCt={title:"Memória do utilizador",subtitle:"Explorar e gerir as memórias persistentes armazenadas pelos agentes",userIdPlaceholder:"Introduzir ID do utilizador…",searchPlaceholder:"Pesquisar memórias…",enterUserId:"Introduza um ID de utilizador para explorar as suas memórias",totalEntries:"Total de entradas",preferences:"Preferências",facts:"Factos",conflicts:"Conflitos",cat_all:"Tudo",cat_preference:"Preferências",cat_fact:"Factos",cat_context:"Contexto",deleteAll:"Eliminar tudo",deleteAllTitle:"Eliminar todas as memórias",deleteAllDesc:"Todas as memórias deste utilizador serão permanentemente eliminadas. Esta ação não pode ser revertida.",deleteAllConfirm:"Eliminar tudo",entryDeleted:"Entrada de memória eliminada",allDeleted:"Todas as memórias do utilizador eliminadas",noResults:"Nenhuma entrada de memória encontrada",value:"Valor",sourceAgent:"Agente de origem",accessCount:"Acessos",created:"Criado",updated:"Atualizado",sourceConversation:"Conversa de origem",conflicted:"Em conflito"},UCt={title:"Propriedades do utilizador",subtitle:"Explorar e gerir as propriedades longTerm armazenadas por utilizador",userIdPlaceholder:"Introduzir ID do utilizador…",searchPlaceholder:"Filtrar propriedades…",enterUserId:"Introduza um ID de utilizador para ver as suas propriedades",key:"Chave",type:"Tipo",value:"Valor",deleteAll:"Eliminar tudo",deleteAllTitle:"Eliminar todas as propriedades",deleteAllDesc:"Todas as propriedades deste utilizador serão permanentemente eliminadas.",deleted:"Propriedades eliminadas",noResults:"Nenhuma propriedade encontrada",showingCount:"{{count}} propriedades"},$Ct={title:"Gatilhos de agentes",subtitle:"Associar intents a implementações de agentes para encaminhamento automático",create:"Novo gatilho",createTitle:"Criar gatilho",editTitle:"Editar gatilho",intent:"Intent",deployments:"Implementações de agentes",addDeployment:"Adicionar agente",agents:"agentes",empty:"Nenhum gatilho configurado ainda",created:"Gatilho criado",updated:"Gatilho atualizado",deleted:"Gatilho eliminado",deleteTitle:"Eliminar gatilho",deleteDesc:"Eliminar permanentemente o gatilho para o intent «{{intent}}»?",searchPlaceholder:"Filtrar por intent ou ID do agente…"},qCt={title:"Descoberta de capacidades",subtitle:"Descobrir agentes pelas suas competências e capacidades declaradas",searchPlaceholder:"Pesquisar competências…",strategyHighest:"Maior confiança",strategyAll:"Todos os resultados",registeredSkills:"Competências registadas",noSkills:"Nenhuma competência encontrada",matchingAgents:"Agentes correspondentes",noMatches:"Nenhum agente encontrado para esta competência"},KCt={title:"Exportar agente",loading:"A carregar a árvore de recursos...",selectResources:"Selecionar recursos a exportar",required:"Obrigatório",snippets:"Excertos",allSelected:"Todos os recursos selecionados",countSelected:"{{count}} de {{total}} recursos selecionados",exportSelected:"Exportar selecionados"},GCt={title:"Importar Agente",dropZone:"Arraste um ficheiro .zip ou clique para procurar",dropZoneHint:"Ficheiro de agente (.zip)",strategyLabel:"Estratégia de importação",createNew:"Criar como novo agente",createNewDesc:"Cria cópia com novos IDs. Melhor para a primeira importação.",mergeSync:"Fundir / Sincronizar",mergeSyncDesc:"Atualiza recursos se previamente importados. Cria novos caso não existam.",upgradeExisting:"Atualizar agente existente",upgradeDesc:"Mapeia os recursos com um agente alvo. Ideal para promoção de ambiente.",syncRemote:"Sincronizar instância remota",syncDesc:"Ligar a outra instância EDDI para sincronização ao vivo.",importNow:"Importar Agora",previewChanges:"Pré-visualizar alterações",selectTargetAgent:"Selecionar agente alvo",upgradeTargetHint:"Recursos mapeados estruturalmente com o agente alvo.",chooseAgent:"— Escolha um agente —",sourceAgent:"Agente de origem (remoto)",targetAgent:"Agente alvo (local)",createNewTarget:"Criar novo agente",resource:"Recurso",type:"Tipo",match:"Correspondência",action:"Ação",new:"novo",updated:"atualizado",unchanged:"inalterado",selected:"selecionados",mergeNow:"Importar selecionados",syncNow:"Sincronizar agora",upgradeNow:"Atualizar agora",importing:"A importar agente...",contentIdentical:"Conteúdo idêntico",targetContent:"Alvo",sourceContent:"Origem"},YCt={title:"Sincronização",subtitle:"Sincronizar agentes entre instâncias",connection:"Instância de origem",sourceUrl:"URL da Instância de Origem",authToken:"Token de Autorização",authHint:"Opcional. Enviado como cabeçalho X-Source-Authorization.",connect:"Ligar",connected:"Ligado",agentsFound:"agentes",connectionFailed:"Conexão falhou",agentMapping:"Mapeamento de Agente",previewAll:"Ver todas",syncSelected:"Sincronizar selecionados",remote:"Remoto",createNew:"Criar novo",changes:"alterações",agentsSelected:"agentes selecionados",totalResources:"recursos",syncSuccess:"Sincronizado com sucesso",syncError:"Sincronização falhou",empty:"Ligar à instância para começar.",autoMatched:"correspondência automática",previewFirst:"Pré-visualizar alterações antes de sincronizar"},QCt={actionCreate:"Novo",actionUpdate:"Atualizar",actionSkip:"Atualizado",actionConflict:"Conflito"},XCt={title:"Conversas do usuário",subtitle:"Gerenciar vínculos de intenção → usuário → conversa",lookup:"Pesquisar",intent:"Intenção",userId:"ID do usuário",agentId:"ID do agente",environment:"Ambiente",conversationId:"ID da conversa",binding:"Vínculo ativo",enterBoth:"Digite a intenção e o ID do usuário",notFound:"Nenhum vínculo encontrado",create:"Criar vínculo",createTitle:"Criar vínculo",created:"Vínculo criado",deleteTitle:"Excluir vínculo",deleteDesc:'Remover o vínculo para intenção "{{intent}}" e usuário "{{userId}}"?',deleted:"Vínculo excluído"},ZCt={placeholder:"Pesquisar páginas, agentes, ações…",noResults:"Nenhum resultado encontrado.",recent:"Recentes",navigate:"Navegar",agents:"Agentes",actions:"Ações rápidas",createAgent:"Criar novo agente",openChat:"Abrir chat",kbdNavigate:"navegar",kbdSelect:"selecionar",kbdClose:"fechar"},JCt={title:"Group Setup Wizard",subtitle:"Assemble a team of AI advisors to discuss your questions",backToGroups:"Back to Groups",templateTitle:"Start from a template",templateDesc:"Choose a preset group configuration or start from scratch.",startBlank:"Start from Scratch",blankDesc:"Configure everything manually",configTitle:"Group Configuration",configDesc:"Name your group and choose how the agents will discuss",namePlaceholder:"e.g. Advisory Board",descPlaceholder:"What is this group for?",membersTitle:"Assemble Your Team",membersDesc:"For each seat, choose an existing agent or create a new one on the fly.",addMember:"Add Member",refreshAgents:"Refresh agent list",existingAgents:"existing agents",displayName:"Agent Name",displayNamePlaceholder:"Give this agent a name…",rolePlaceholder:"Role (e.g. Marketing, Engineering)",useExisting:"Use Existing",createNew:"Create New",selectAgent:"Select agent…",systemPrompt:"System Prompt",provider:"LLM Provider",model:"Model",apiKey:"API Key",apiKeyPlaceholder:"sk-…",createThisAgent:"Create Agent",creatingAgent:"Creating agent…",agentReady:"Agent created & deployed",agentCreated:'Agent "{{name}}" created',agentCreateFailed:"Failed to create agent: {{error}}",moderator:"Moderator",moderatorHint:"Synthesizes the discussion",addModerator:"Add Moderator",removeModerator:"Remove moderator",createModerator:"Create Moderator Agent",moderatorReady:"Moderator agent ready",moderatorCreated:"Moderator agent created",creatingModerator:"Creating moderator…",creatingSlot:"Creating {{name}}…",creatingGroup:"Creating group…",needMembers:"Add at least 2 members to proceed",reviewTitle:"Review & Create",reviewDesc:"Review your group configuration before creating.",reviewMembers:"Members",autoCreateNotice:"{{count}} agents will be auto-created when you click Create Group",autoCreateHint:"Each agent will be created and deployed automatically before the group is assembled.",unassignedWarning:"{{count}} members set to 'Use Existing' but no agent selected",unassignedHint:"These members will be skipped during discussions. Go back to assign agents.",flowPreview:"Discussion Flow",createGroup:"Create Group",created:"Group Created!",viewGroup:"Open Group",createAnother:"Create Another",success:"Group created successfully!"},eSt={advisoryBoard:"Advisory Board",advisoryBoardDesc:"A panel of expert advisors consulting on strategic decisions.",codeReview:"Code Review Panel",codeReviewDesc:"Structured code review with independent opinions, peer critique, and revision.",riskAssessment:"Risk Assessment",riskAssessmentDesc:"A panel with a devil's advocate who challenges assumptions.",forecasting:"Forecasting Panel",forecastingDesc:"Delphi-style anonymous deliberation for unbiased estimates.",proCon:"Pro/Con Debate",proConDesc:"Formal debate with pro and con teams arguing their positions.",roles:{marketingExpert:"Marketing Expert",techLead:"Tech Lead",financeDirector:"Finance Director",legalCounsel:"Legal Counsel",strategyConsultant:"Strategy Consultant",seniorEngineer:"Senior Engineer",architect:"Architect",securityReviewer:"Security Reviewer",riskAnalyst:"Risk Analyst",domainExpert:"Domain Expert",devilsAdvocate:"Devil's Advocate",analystA:"Analyst A",analystB:"Analyst B",analystC:"Analyst C",analystD:"Analyst D",proAdvocate1:"Pro Advocate 1",proAdvocate2:"Pro Advocate 2",conAdvocate1:"Con Advocate 1",conAdvocate2:"Con Advocate 2"}},tSt={agentIdPlaceholder:"ID do agente para processar mensagens",botToken:"Token do bot",botTokenHint:"Token OAuth do bot. Use uma referência de cofre para maior segurança.",botTokenPlaceholder:"xoxb-… ou ${vault:slack-bot-token}",channel:"canal",channelId:"ID do canal Slack",channelIdCol:"ID do canal",channelIdHint:"Clique com o botão direito em um canal Slack → Ver detalhes do canal → copiar o ID do canal",channelsPlural:"canais",channelType:"Tipo de canal",confirmDelete:"Excluir canal?",confirmDeleteDesc:"Esta integração de canal será removida permanentemente.",create:"Criar canal",createTitle:"Criar integração de canal",defaultAgentId:"ID do agente padrão",defaultTargetHint:"O destino padrão processa todas as mensagens que não correspondem a uma palavra-chave de ativação. Você pode adicionar mais destinos após a criação.",empty:"Nenhum canal ainda",emptyDesc:"Crie uma integração de canal para conectar agentes ao Slack.",name:"Nome",namePlaceholder:"ex. Engineering AI Hub",openSlackApps:"Abrir painel do Slack App",searchPlaceholder:"Pesquisar canais…",signingSecret:"Segredo de assinatura",signingSecretHint:"Da página de Informações básicas do seu aplicativo Slack.",signingSecretPlaceholder:"String hex ou ${vault:slack-signing-secret}",slackSetupGuide:"Guia de configuração do Slack",slackSetupSummary:"Crie um aplicativo Slack, configure os escopos do token do bot (app_mentions:read, chat:write, im:history, channels:history, groups:history) e cole as credenciais aqui.",target:"destino",targets:"destinos",targetsCol:"Destinos",type:"Tipo",unnamed:"Canal sem nome",version:"Versão"},nSt={addTarget:"Adicionar destino",addTrigger:"Adicionar gatilho…",agentId:"ID do agente",botToken:"Token do bot",channelId:"ID do canal Slack",cooldown:"Intervalo (s)",general:"Geral",groupId:"ID do grupo",isDefault:"padrão",maxCost:"Máx. $/dia",maxDaily:"Máx./dia",name:"Nome",observe:"Observar",observeDesc:"Monitorar passivamente e responder seletivamente",observeKeywords:"Palavras-chave de ativação",observeMimeTypes:"Tipos MIME de ativação",observeMode:"Modo de observação",observeSettings:"Configurações do modo de observação",platformConfig:"Configuração da plataforma",rawConfig:"Configuração bruta",removeTarget:"Remover",requiredEvents:"Assinaturas de eventos necessárias:",requiredScopes:"Escopos de token do bot necessários:",setDefault:"Definir como padrão",signingSecret:"Segredo de assinatura",targetName:"Nome",targets:"Destinos de roteamento de mensagens",targetType:"Tipo",triggerHint:'Os usuários digitam "palavra-chave: mensagem" para encaminhar a este destino',triggerKeywords:"Palavras-chave de ativação",triggers:"gatilhos",type:"Tipo de canal",webhookHint:"Cole esta URL no campo Request URL em Event Subscriptions do seu aplicativo Slack.",webhookUrl:"URL do webhook"},iSt={app:Jwt,auth:eCt,nav:tCt,theme:nCt,language:iCt,pages:sCt,common:rCt,agents:oCt,agentDetail:aCt,wizard:lCt,setupWizard:cCt,packages:dCt,packageDetail:uCt,packageEditor:hCt,conversations:gCt,conversationDetail:fCt,chat:pCt,resources:mCt,editor:bCt,rulesEditor:xCt,apiCallsEditor:vCt,llmEditor:_Ct,outputEditor:yCt,propertySetterEditor:wCt,dictionaryEditor:CCt,coordinator:SCt,contentEditor:kCt,logs:NCt,secrets:ECt,audit:LCt,schedules:DCt,debugDrawer:TCt,costDashboard:ICt,memoryInspector:ACt,logViewer:RCt,promptViewer:MCt,promptPreview:PCt,studio:OCt,ragEditor:jCt,onboarding:FCt,platform:BCt,stream:HCt,createOrWizard:WCt,groups:VCt,memories:zCt,properties:UCt,triggers:$Ct,capabilities:qCt,exportDialog:KCt,importDialog:GCt,syncPage:YCt,sync:QCt,userConversations:XCt,commandPalette:ZCt,groupWizard:JCt,groupTemplates:eSt,channels:tSt,channelDetail:nSt},sSt={title:"EDDI Manager",description:"EDDI संवादात्मक AI प्लेटफ़ॉर्म प्रशासन डैशबोर्ड"},rSt={login:"लॉगिन",logout:"लॉगआउट",loading:"प्रमाणीकरण हो रहा है…",sessionExpired:"सत्र समाप्त हो गया। कृपया पुनः लॉगिन करें।",profile:"प्रोफ़ाइल",guest:"अतिथि",userMenu:"उपयोगकर्ता मेनू"},oSt={dashboard:"डैशबोर्ड",agents:"एजेंट",packages:"वर्कफ़्लो",conversations:"बातचीत",coordinator:"कोऑर्डिनेटर",schedules:"शेड्यूल",logs:"लॉग",orphans:"अनाथ आइटम",secrets:"सीक्रेट्स",audit:"ऑडिट लॉग",quotas:"कोटा",groups:"समूह",chat:"चैट",resources:"संसाधन",sectionManagement:"प्रबंधन",sectionDevelopment:"विकास",sectionOperations:"संचालन",mainNavigation:"मुख्य नेविगेशन",openMenu:"नेविगेशन मेनू खोलें",sectionCore:"मुख्य",sectionBuild:"बनाएं और परखें",sectionMonitor:"निगरानी",sectionAdmin:"प्रशासन",studio:"स्टूडियो",gdpr:"गोपनीयता",memories:"उपयोगकर्ता स्मृति",properties:"गुण",triggers:"ट्रिगर",capabilities:"क्षमताएं",sync:"सिंक",channels:"चैनल",userConversations:"उपयोगकर्ता वार्तालाप",userData:"उपयोगकर्ता डेटा",variables:"चर"},aSt={light:"लाइट",dark:"डार्क",system:"सिस्टम"},lSt={label:"भाषा",en:"English",de:"Deutsch",fr:"Français",es:"Español",ar:"العربية",zh:"中文",th:"ไทย",ja:"日本語",ko:"한국어",pt:"Português",hi:"हिन्दी"},cSt={dashboard:{title:"डैशबोर्ड",subtitle:"EDDI Agents और वार्तालापों का अवलोकन",activeAgents:"सक्रिय Agents",totalWorkflows:"वर्कफ़्लो",totalResources:"संसाधन",totalConversations:"बातचीत",quickActions:"त्वरित कार्य",recentAgents:"हाल के Agents",noRecentAgents:"अभी तक कोई Agent नहीं है। अपना पहला Agent बनाएं!"},agents:{title:"एजेंट",subtitle:"अपने संवादात्मक AI Agents प्रबंधित करें"},packages:{title:"वर्कफ़्लो",subtitle:"Workflows और एक्सटेंशन कॉन्फ़िगर करें"},conversations:{title:"बातचीत",subtitle:"Agent वार्तालाप देखें और प्रबंधित करें"},resources:{title:"संसाधन",subtitle:"व्यवहार नियम, शब्दकोश, आउटपुट सेट और अधिक प्रबंधित करें"},chat:{title:"चैट",subtitle:"Deploy किए गए Agents से बात करें"},channels:{title:"चैनल",subtitle:"एजेंट और समूहों को Slack जैसे मैसेजिंग प्लेटफ़ॉर्म से जोड़ें"},groups:{title:"समूह",subtitle:"संरचित चर्चा और सहयोग के लिए बहु-Agent चर्चा समूह"}},dSt={loading:"लोड हो रहा है...",error:"कुछ गलत हो गया",retry:"पुनः प्रयास करें",save:"सहेजें",cancel:"रद्द करें",delete:"हटाएं",create:"बनाएं",edit:"संपादित करें",search:"खोजें...",noResults:"कोई परिणाम नहीं मिला",duplicate:"प्रतिलिपि",close:"बंद करें",skipToMain:"मुख्य सामग्री पर जाएं",opensNewTab:"नए टैब में खुलता है",moreActions:"अधिक कार्य",sortByName:"नाम से क्रमबद्ध करें",sortByVersion:"संस्करण से क्रमबद्ध करें",sortByModified:"संशोधन तिथि से क्रमबद्ध करें",apply:"लागू करें",copied:"कॉपी हो गया",copy:"कॉपी",saving:"सहेज रहे हैं…",showMore:"Show More",showLess:"Show Less",copyFailed:"क्लिपबोर्ड पर कॉपी करने में विफल"},uSt={deploy:"तैनात करें",undeploy:"अनडिप्लॉय",createAgent:"Agent बनाएं",createTitle:"नया Agent बनाएं",name:"नाम",namePlaceholder:"मेरा Agent",description:"विवरण",descriptionPlaceholder:"यह Agent क्या करता है, वर्णन करें...",empty:"अभी तक कोई Agent नहीं है। अपना पहला Agent बनाएं!",confirmDelete:"क्या आप वाकई इस Agent को हटाना चाहते हैं?",count_one:"{{count}} एजेंट",count_other:"{{count}} एजेंट",export:"निर्यात",exporting:"निर्यात हो रहा है...",exportSuccess:"Agent सफलतापूर्वक निर्यात हुआ",import:"Agent आयात करें",importing:"आयात हो रहा है...",importSuccess:"Agent सफलतापूर्वक आयात हुआ",importError:"Agent आयात विफल",emptyDescription:"कुछ ही मिनटों में पूरी तरह से कॉन्फ़िगर किया गया Agent बनाने के लिए विज़ार्ड का उपयोग करें।",chat:"चैट",deployAndChat:"डिप्लॉय करें और चैट करें",openExternalChat:"नए टैब में खोलें"},hSt={title:"Agent विवरण",backToAgents:"Agents पर वापस जाएं",packages:"वर्कफ़्लो",noWorkflows:"अभी तक कोई Workflows नहीं जोड़ा गया",addWorkflow:"Workflow जोड़ें",selectWorkflow:"जोड़ने के लिए Workflow चुनें",rawConfig:"कच्चा कॉन्फ़िगरेशन",editName:"नाम संपादित करें",editDescription:"विवरण संपादित करें",clickToEdit:"संपादित करने के लिए क्लिक करें",noDescription:"कोई विवरण नहीं",duplicate:"प्रतिलिपि",duplicating:"प्रतिलिपि बनाई जा रही है...",duplicateSuccess:"Agent सफलतापूर्वक प्रतिलिपि बनाया गया",environments:"परिवेश",envProduction:"उत्पादन",envTest:"परीक्षण",savingAgent:"Agent सहेजा जा रहा है...",savedAgent:"Agent सफलतापूर्वक सहेजा गया",saveError:"Agent सहेजने में विफल",deployToEnv:"{{env}} में Deploy करें",undeployFromEnv:"{{env}} से हटाएं",openStudio:"स्टूडियो में खोलें",maxKeyLength:"अधिकतम कुंजी लंबाई",maxValueLength:"अधिकतम मान लंबाई",maxWritesPerTurn:"प्रति बारी अधिकतम लेखन",dreamSchedule:"शेड्यूल (cron)",dreamLlmProvider:"LLM प्रदाता",dreamLlmModel:"LLM मॉडल",dreamMaxCost:"प्रति रन अधिकतम लागत ($)",dreamPruneDays:"सफ़ाई के बाद (दिन)",dreamBatchSize:"बैच आकार",detectContradictions:"विरोधाभास पहचानें",summarizeInteractions:"बातचीत सारांश करें",confidenceLow:"कम",confidenceMedium:"मध्यम",confidenceHigh:"उच्च",visibilitySelf:"स्वयं",visibilityGlobal:"वैश्विक",onCapEvict:"सबसे पुराना हटाएं",onCapReject:"अस्वीकार करें",recallMostRecent:"सबसे हालिया",recallMostRelevant:"सबसे प्रासंगिक",channels:"चैनल कनेक्टर",channelsDesc:"इस एजेंट को Slack चैनलों से कनेक्ट करें। प्रत्येक चैनल कनेक्टर स्वतंत्र रूप से अपने क्रेडेंशियल्स के साथ कॉन्फ़िगर किया जाता है, मल्टी-वर्कस्पेस सेटअप का समर्थन करता है।",noChannels:"कोई चैनल कॉन्फ़िगर नहीं",noChannelsDesc:"उपयोगकर्ताओं को Slack से इस एजेंट के साथ इंटरैक्ट करने के लिए एक Slack चैनल जोड़ें।",addSlackChannel:"Slack चैनल जोड़ें",slackChannel:"Slack चैनल",removeChannel:"चैनल हटाएं",removeChannelConfirm:"इस Slack चैनल कनेक्टर को हटाएं?",removeChannelDesc:"This action will permanently disconnect this channel.",channelId:"चैनल आईडी",channelIdHint:"चैनल आईडी C से शुरू होती है जिसके बाद अपरकेस अल्फ़ान्यूमेरिक वर्ण आते हैं",botToken:"बॉट टोकन",botTokenPlaceholder:"xoxb-… या ${vault:slack-bot-token}",botTokenHint:"Slack बॉट यूज़र OAuth टोकन। सुरक्षा के लिए वॉल्ट संदर्भ का उपयोग करें।",signingSecret:"साइनिंग सीक्रेट",signingSecretPlaceholder:"हेक्स स्ट्रिंग या ${vault:slack-signing-secret}",signingSecretHint:"आपके Slack ऐप के बेसिक इन्फ़ॉर्मेशन पेज से। सुरक्षा के लिए वॉल्ट संदर्भ का उपयोग करें।",groupIdOptional:"ग्रुप आईडी (वैकल्पिक)",groupIdPlaceholder:"मल्टी-एजेंट ग्रुप कॉन्फ़िग आईडी",groupIdHint:'इस Slack चैनल से "group: प्रश्न" मल्टी-एजेंट चर्चा सक्षम करें।',slackSetupGuide:"Slack सेटअप गाइड",slackWebhookUrl:"Webhook URL",slackWebhookCopied:"Webhook URL कॉपी किया गया",slackStep1:"api.slack.com/apps पर एक Slack ऐप बनाएं और इसे अपने वर्कस्पेस में इंस्टॉल करें।",slackStep2:"बॉट टोकन (xoxb-…) और साइनिंग सीक्रेट को EDDI वॉल्ट में कॉपी करें और नीचे चैनल कॉन्फ़िगर करें।",slackStep3:"फिर अपने Slack ऐप में Event Subscriptions सक्षम करें, ऊपर Webhook URL पेस्ट करें और सब्सक्राइब करें:",slackSetupNote:"महत्वपूर्ण: Event Subscriptions सक्षम करने से पहले नीचे चैनल कॉन्फ़िगर करें — Slack एक URL सत्यापन चुनौती भेजता है जिसके लिए EDDI में साइनिंग सीक्रेट कॉन्फ़िगर होना आवश्यक है।",slackRequiredScopes:"आवश्यक बॉट टोकन स्कोप"},gSt={title:"Agent विज़ार्ड"},fSt={title:"Agent निर्माण विज़ार्ड",subtitle:"कुछ ही मिनटों में पूरी तरह कॉन्फ़िगर किया गया Agent बनाएं",backToAgents:"Agents पर वापस जाएं",next:"अगला",back:"पीछे",createOnly:"केवल बनाएं",createAndDeploy:"बनाएं और Deploy करें",typeTitle:"किस प्रकार का Agent?",typeDesc:"बनाने के लिए Agent का प्रकार चुनें",standardAgent:"मानक एजेंट",apiAgent:"एपीआई एजेंट",standardDesc:"LLM-संचालित संवादात्मक AI जिसमें टूल, Quick Replies और भावना विश्लेषण शामिल है",apiDesc:"API Agent स्वचालित रूप से बनाने के लिए OpenAPI/Swagger विनिर्देश आयात करें",infoTitle:"Agent पहचान",infoDesc:"अपने Agent को एक नाम और व्यक्तित्व दें",agentName:"Agent का नाम",namePlaceholder:"उदा: ग्राहक सहायता बॉट",systemPrompt:"सिस्टम प्रॉम्प्ट",promptPlaceholder:"आप एक सहायक AI असिस्टेंट हैं जो...",promptHint:"यह निर्देश निर्धारित करता है कि आपका Agent कैसे व्यवहार और प्रतिक्रिया करता है।",llmTitle:"LLM कॉन्फ़िगरेशन",llmDesc:"Agent को चलाने वाला AI मॉडल चुनें",provider:"प्रदाता",model:"मॉडल",apiKey:"API कुंजी",baseUrl:"बेस URL",baseUrlPlaceholder:"कस्टम endpoint URL",optional:"वैकल्पिक",apiSpecTitle:"OpenAPI विनिर्देश",apiSpecDesc:"अपने API का OpenAPI/Swagger विनिर्देश प्रदान करें",specByUrl:"यूआरएल लिंक",specByFile:"फ़ाइल",specByPaste:"चिपकाएं",fetch:"प्राप्त करें",specFetched:"विनिर्देश लोड हो गया!",specFetchError:"विनिर्देश प्राप्त करने में विफल",dropFile:"OpenAPI फ़ाइल यहां ड्रॉप करें",dropHint:"JSON या YAML प्रारूप",browse:"फ़ाइलें ब्राउज़ करें",pasteSpec:"OpenAPI/Swagger JSON या YAML यहां चिपकाएं...",specLoaded:"फ़ाइल लोड हुई: {{name}}",specReady:"विनिर्देश लोड हुआ ({{chars}} अक्षर)",apiBaseUrlLabel:"API बेस URL",apiAuthLabel:"API प्रमाणीकरण हेडर",endpointFilter:"Endpoint फ़िल्टर",endpointFilterPlaceholder:"कॉमा से अलग: GET /users, POST /orders",featuresTitle:"सुविधाएं और विकल्प",featuresDesc:"Agent की क्षमताओं को अनुकूलित करें",introMessage:"स्वागत संदेश",introMessageDesc:"वार्तालाप शुरू होने पर दिखाया जाने वाला अभिवादन",quickReplies:"त्वरित उत्तर",quickRepliesDesc:"LLM क्लिक करने योग्य उत्तर सुझाव उत्पन्न करता है",sentiment:"भावना विश्लेषण",sentimentDesc:"उपयोगकर्ता की भावना, इरादे और तात्कालिकता को रियलटाइम में ट्रैक करें",structuredOutput:"संरचित आउटपुट",structuredOutputDesc:"LLM सादे टेक्स्ट की बजाय JSON ऑब्जेक्ट से उत्तर देता है",structuredOutputInfo:"सक्षम करने पर, LLM संरचित फ़ील्ड वाले JSON ऑब्जेक्ट से उत्तर देगा। आपके सिस्टम प्रॉम्प्ट में एक JSON स्कीमा जोड़ा जाएगा और मॉडल JSON प्रतिक्रिया मोड में सेट होगा।",builtInTools:"अंतर्निहित टूल",builtInToolsDesc:"EDDI की अंतर्निहित टूल लाइब्रेरी सक्षम करें (कैलकुलेटर, दिनांक/समय, आदि)",toolsWhitelist:"श्वेतसूची (खाली = सभी)",mcpServers:"MCP सर्वर",mcpServersDesc:"बाहरी टूल के लिए Model Context Protocol सर्वर",autoDeploy:"स्वचालित परिनियोजन",autoDeployDesc:"बनाने के बाद तुरंत Agent Deploy करें",environment:"परिवेश",envProduction:"उत्पादन",envTest:"परीक्षण",reviewTitle:"समीक्षा करें और बनाएं",reviewDesc:"बनाने से पहले कॉन्फ़िगरेशन की समीक्षा करें",reviewType:"प्रकार",reviewName:"नाम",reviewPrompt:"सिस्टम प्रॉम्प्ट",reviewProvider:"प्रदाता",reviewModel:"मॉडल",reviewSpec:"OpenAPI स्पेक",reviewIntro:"स्वागत संदेश",reviewDeploy:"डिप्लॉय",success:"Agent सफलतापूर्वक बनाया गया!",agentCreated:"Agent बनाया गया!",deployed:"Deploy हो गया",endpointsParsed:"{{count}} API endpoints का विश्लेषण किया गया",viewAgent:"Agent देखें",createAnother:"एक और बनाएं",allTools:"सभी उपकरण",selectSpecific:"विशिष्ट चुनें",allToolsInfo:"सभी {{count}} अंतर्निहित उपकरण आपके एजेंट के लिए उपलब्ध होंगे। कौन से उपकरण सक्षम करने हैं, यह सीमित करने के लिए「विशिष्ट चुनें」चुनें।",availableTools:"उपलब्ध उपकरण",toolCount:"{{total}} में से {{selected}} चयनित"},pSt={createWorkflow:"Workflow बनाएं",createTitle:"नया Workflow बनाएं",name:"नाम",namePlaceholder:"मेरा Workflow",description:"विवरण",descriptionPlaceholder:"यह Workflow क्या करता है, वर्णन करें...",noDescription:"कोई विवरण नहीं",empty:"अभी तक कोई Workflow नहीं है। अपना पहला Workflow बनाएं!",confirmDelete:"क्या आप वाकई इस Workflow को हटाना चाहते हैं?",count_one:"{{count}} वर्कफ़्लो",count_other:"{{count}} वर्कफ़्लो",emptyDescription:"Workflow आपके Agents के लिए प्रोसेसिंग पाइपलाइन को परिभाषित करते हैं।"},mSt={title:"Workflow विवरण",backToWorkflows:"Workflows पर वापस जाएं",extensions:"एक्सटेंशन",noExtensions:"इस Workflow में कोई एक्सटेंशन नहीं है",rawConfig:"कच्चा कॉन्फ़िगरेशन"},bSt={title:"Workflow संपादक",pipeline:"एक्सटेंशन Pipeline",addHint:"प्रोसेसिंग Pipeline बनाने के लिए एक्सटेंशन जोड़ें",addHintDialog:"Pipeline में जोड़ने के लिए एक्सटेंशन प्रकार चुनें",reorder:"एक्सटेंशन पुनः क्रमित करें",saved:"Workflow सफलतापूर्वक सहेजा गया",saveError:"Workflow सहेजने में विफल",noTasks:"[EN] No tasks in this workflow",addTask:"[EN] Add Task"},xSt={searchPlaceholder:"वार्तालाप ID से खोजें...",id:"बातचीत",agent:"एजेंट",state:"स्थिति",lastActivity:"अंतिम गतिविधि",actions:"क्रियाएँ",empty:"अभी तक कोई वार्तालाप नहीं। Agent Deploy करें और चैट शुरू करें!",confirmDelete:"क्या आप वाकई इस वार्तालाप को हटाना चाहते हैं?",count_one:"{{count}} बातचीत",count_other:"{{count}} बातचीत",emptyDescription:"एक Agent Deploy करें और Chat पेज से Conversation शुरू करें।"},vSt={continueChat:"चैट में जारी रखें",searchTranscript:"बातचीत में खोजें…",exportMd:"Markdown में निर्यात करें",toolSummary:"उपकरण उपयोग सारांश",totalCost:"कुल लागत",cacheHitRate:"कैश हिट दर"},_St={selectAgent:"Agent चुनें...",noAgents:"कोई Deploy किया हुआ Agent उपलब्ध नहीं है। पहले Agent Deploy करें।",placeholder:"संदेश लिखें...",send:"भेजें",newConversation:"नया वार्तालाप",endConversation:"वार्तालाप समाप्त करें",streaming:"स्ट्रीमिंग",thinking:"सोच रहा है...",connectionError:"कनेक्शन त्रुटि। कृपया पुनः प्रयास करें।",empty:"Agent चुनें और चैट शुरू करें!",history:"इतिहास",undo:"अंतिम संदेश पूर्ववत करें",redo:"संदेश पुनः करें",continueConversation:"जारी रखें",noHistory:"अभी तक कोई वार्तालाप इतिहास नहीं।",attach:"फ़ाइल संलग्न करें",attachUploading:"अपलोड हो रहा है...",attachSuccess:"फ़ाइल संलग्न",attachError:"फ़ाइल अपलोड विफल",retry:"अंतिम चरण पुनः प्रयास करें",retrySuccess:"चरण पुनः निष्पादित",retryError:"पुनः प्रयास विफल",showActivity:"गतिविधि दिखाएं",hideActivity:"गतिविधि छुपाएं",scrollToBottom:"नीचे स्क्रॉल करें",copyMessage:"संदेश कॉपी करें",copied:"कॉपी हो गया!",activity:{processing:"प्रक्रिया हो रही है…",steps:"चरण",toolCalls:"उपकरण कॉल",toolCall:"उपकरण कॉल",toolResult:"परिणाम"},channels:{title:"चैनल",subtitle:"एजेंट और समूहों को Slack जैसे मैसेजिंग प्लेटफ़ॉर्म से जोड़ें"},context:{conversationId:"बातचीत ID",agentVersion:"एजेंट संस्करण",startTime:"शुरू हुआ",stepCount:"चरण",show:"बातचीत जानकारी दिखाएं",hide:"बातचीत जानकारी छुपाएं"},agentTyping:"एजेंट टाइप कर रहा है"},ySt={unnamed:"अनामित संसाधन",noDescription:"कोई विवरण नहीं",backToResources:"संसाधनों पर वापस जाएं",backToList:"{{type}} पर वापस जाएं",unknownType:"अज्ञात संसाधन प्रकार",rawConfig:"कच्चा कॉन्फ़िगरेशन",rawConfigHint:"इस संसाधन का JSON कॉन्फ़िगरेशन",create:"{{type}} बनाएं",createTitle:"{{type}} बनाएं",createDescription:"खाली {{type}} कॉन्फ़िगरेशन बनाएं। बनाने के बाद संपादित कर सकते हैं।",confirmDelete:"क्या आप वाकई इस {{type}} को हटाना चाहते हैं?",empty:"अभी तक कोई {{type}} संसाधन नहीं।",itemCount_one:"{{count}} आइटम",itemCount_other:"{{count}} आइटम",count_one:"{{count}} संसाधन",count_other:"{{count}} संसाधन",types:{rules:{name:"व्यवहार नियम",description:"वार्तालाप प्रवाह नियम और निर्णय तर्क परिभाषित करें"},apicalls:{name:"HTTP कॉल",description:"बाहरी API एकीकरण और Webhook कॉन्फ़िगर करें"},output:{name:"आउटपुट सेट",description:"प्रतिक्रिया टेम्पलेट और आउटपुट भिन्नताएं प्रबंधित करें"},dictionary:{name:"शब्दकोश",description:"शब्द और वाक्यांश पहचान पैटर्न परिभाषित करें"},llm:{name:"LLM",description:"AI मॉडल, Prompt और टूल बाइंडिंग कॉन्फ़िगर करें"},propertysetter:{name:"गुण सेटर",description:"वार्तालाप गुण सेट करें और स्लॉट भरने का प्रबंधन करें"},mcpcalls:{name:"MCP कॉल",description:"MCP सर्वर कनेक्शन और निर्धारित टूल कॉल कॉन्फ़िगर करें"},rag:{name:"ज्ञान आधार",description:"दस्तावेज़ पुनर्प्राप्ति के लिए RAG ज्ञान आधार कॉन्फ़िगर करें"},snippets:{name:"स्निपेट प्रॉम्प्ट",description:"Reusable system prompt building blocks"}},emptyDescription:"Workflow में उपयोग करने के लिए अपना पहला {{type}} बनाएं।"},wSt={formTab:"फ़ॉर्म",jsonTab:"JSON",save:"सहेजें",discard:"त्यागें",saving:"सहेजा जा रहा है...",saved:"सफलतापूर्वक सहेजा गया",saveError:"सहेजने में विफल",dirty:"असहेजे परिवर्तन",version:"संस्करण",versionPicker:"संस्करण चुनें",readOnly:"केवल पढ़ने के लिए",formPlaceholder:"विज़ुअल संपादक जल्द आ रहा है। संपादन के लिए JSON टैब का उपयोग करें।",jsonSchema:"Schema सत्यापन सक्रिय",cascadeMode:"परिवर्तन मूल Workflow और Agent तक प्रसारित होंगे",usedInAgents:"{{count}} Agent(s) में उपयोग किया गया",updateUsageHint:"चयनित Workflows और Agents को नए संस्करण में अपडेट करें?",updateUsage:"चयनित अपडेट करें",skipUpdate:"छोड़ें",cascading:"अपडेट हो रहा है...",cascadeSuccess:"कैस्केड अपडेट पूर्ण",invalidJson:"अमान्य JSON — ठीक करने के लिए JSON टैब पर जाएं।"},CSt={appendActions:"कार्य जोड़ें",expressionsAsActions:"अभिव्यक्तियां कार्य के रूप में",groups:"व्यवहार समूह",addGroup:"समूह जोड़ें",groupName:"समूह का नाम",executionStrategy:"निष्पादन रणनीति",rules:"नियम",addRule:"नियम जोड़ें",ruleName:"नियम का नाम",actions:"क्रियाएँ",noActions:"कोई कार्य नहीं",addAction:"जोड़ें",actionPlaceholder:"उदा: greet, get_weather",conditions:"शर्तें",addCondition:"शर्त जोड़ें",conditionType:"शर्त प्रकार",nestedConditions:"नेस्टेड शर्तें",configKey:"कुंजी",configValue:"मान",addConfig:"कॉन्फ़िगरेशन जोड़ें",removeRule:"नियम हटाएं",removeGroup:"समूह हटाएं",removeCondition:"शर्त हटाएं",noGroups:"कोई व्यवहार समूह परिभाषित नहीं",noRules:"इस समूह में कोई नियम नहीं",noConditions:"कोई शर्तें नहीं"},SSt={targetServerUrl:"लक्ष्य सर्वर URL",targetServerUrlPlaceholder:"https://api.example.com",calls:"HTTP कॉल",addCall:"HTTP कॉल जोड़ें",callName:"कॉल का नाम",callDescription:"विवरण",descriptionPlaceholder:"LLM Agent के लिए प्राकृतिक भाषा विवरण",request:"अनुरोध",method:"विधि",path:"पथ",pathPlaceholder:"/api/endpoint",headers:"हेडर",addHeader:"Header जोड़ें",queryParams:"क्वेरी पैरामीटर",addQueryParam:"पैरामीटर जोड़ें",contentType:"सामग्री प्रकार",body:"अनुरोध बॉडी",bodyPlaceholder:"JSON बॉडी टेम्पलेट...",parameters:"पैरामीटर (LLM Agent के लिए)",paramName:"पैरामीटर का नाम",paramDescription:"विवरण",addParam:"पैरामीटर जोड़ें",options:"विकल्प",saveResponse:"प्रतिक्रिया सहेजें",responseObjectName:"प्रतिक्रिया ऑब्जेक्ट का नाम",responseHeaderObjectName:"प्रतिक्रिया Header ऑब्जेक्ट का नाम",fireAndForget:"भेजें और भूल जाएं",batchCalls:"बैच कॉल",iterationObjectName:"इटरेशन ऑब्जेक्ट का नाम",prePostInstructions:"पूर्व/पश्च निर्देश",preRequest:"अनुरोध से पहले",postResponse:"प्रतिक्रिया के बाद",removeCall:"कॉल हटाएं",noCalls:"कोई HTTP कॉल कॉन्फ़िगर नहीं",actions:"ट्रिगर कार्य",noActions:"कोई कार्य नहीं",actionPlaceholder:"उदा: get_weather"},kSt={tasks:"एलएलएम कार्य",addTask:"कार्य जोड़ें",noTasks:"कोई LangChain कार्य कॉन्फ़िगर नहीं",removeTask:"कार्य हटाएं",taskId:"कार्य आईडी",description:"विवरण",descriptionPlaceholder:"यह कार्य क्या करता है",triggerActions:"ट्रिगर कार्य",noActions:"कोई कार्य नहीं",actionPlaceholder:"उदा: help, chat",systemPrompt:"सिस्टम प्रॉम्प्ट",systemPromptPlaceholder:"आप एक सहायक असिस्टेंट हैं...",modelParams:"मॉडल पैरामीटर",addParam:"पैरामीटर जोड़ें",agentMode:"एजेंट मोड",enableBuiltInTools:"अंतर्निहित टूल सक्षम करें",toolWhitelist:"टूल श्वेतसूची (खाली = सभी)",enableHttpCallTools:"HTTP Call टूल स्वतः खोज",enableHttpCallToolsDesc:"Workflow से सभी httpcall एक्सटेंशन को LLM टूल के रूप में स्वचालित रूप से उजागर करें",httpCallTools:"HTTP कॉल टूल यूआरआई",httpCallToolsHint:"स्पष्ट httpcall URIs (स्वतः खोज के अतिरिक्त)",addTool:"टूल URI जोड़ें",mcpServers:"एमसीपी सर्वर",mcpServersDesc:"बाहरी MCP सर्वर जिनके टूल LLM को उपलब्ध होते हैं",addMcpServer:"MCP सर्वर जोड़ें",mcpUrlPlaceholder:"http://localhost:7070/mcp",mcpName:"नाम",mcpApiKey:"API Key / Vault संदर्भ",historyLimit:"इतिहास सीमा",historyLimitHint:"(-1 = असीमित)",budgetPerf:"बजट और प्रदर्शन",maxBudget:"अधिकतम बजट ($)",costTracking:"लागत ट्रैकिंग",toolCaching:"उपकरण कैश",rateLimiting:"अवरोधक दर",defaultRate:"डिफ़ॉल्ट दर (अनुरोध/मिनट)",prePostInstructions:"पूर्व/पश्च निर्देश",preRequest:"अनुरोध से पहले",postResponse:"प्रतिक्रिया के बाद",enableMcpCallTools:"MCP उपकरण स्वतः खोजें",enableMcpCallToolsDesc:"वर्कफ़्लो के सभी mcpcalls एक्सटेंशन को स्वतः LLM उपकरण के रूप में उपलब्ध कराएं",a2aAgents:"A2A एजेंट",a2aAgentsDesc:"दूरस्थ A2A-संगत एजेंट जिनके कौशल LLM उपकरण बन जाते हैं",addA2aAgent:"A2A एजेंट जोड़ें",a2aUrlPlaceholder:"https://remote.example.com/a2a/agents/...",a2aName:"प्रदर्शन नाम",a2aApiKey:"${vault:my-a2a-key}",a2aTimeout:"टाइमआउट (मि.से.)",a2aSkillsFilter:"कौशल फ़िल्टर (खाली = सभी)",cascade:"मॉडल कैस्केड",cascadeDesc:"Try a cheap/fast model first. If confidence is too low, automatically escalate to a more powerful (and expensive) model.",cascadeEnable:"मॉडल कैस्केड सक्षम करें",cascadeStrategy:"रणनीति",strategyCascade:"क्रमिक एस्केलेशन",strategyParallel:"समानांतर (भविष्य)",cascadeStrategyHint:"पहले सस्ते मॉडल से शुरू करें, कम विश्वास पर एस्केलेट करें",cascadeEvalStrategy:"विश्वास मूल्यांकन",cascadeEvalHint:"उत्तर पर्याप्त है या नहीं, कैसे निर्धारित करें",evalStructured:"संरचित आउटपुट (JSON)",evalHeuristic:"अनुमानी (अनिश्चितता पहचान)",evalJudge:"न्यायाधीश मॉडल (सहायक LLM)",evalNone:"कोई नहीं (हमेशा स्वीकार)",cascadeInAgent:"एजेंट मोड (उपकरण सहित) में भी कैस्केड उपयोग करें",cascadeSteps:"Cascade Steps",cascadeStepsDesc:"Order matters: first step tried first. Last step is always accepted.",cascadeModelName:"जैसे claude-sonnet-4-6",cascadeConfidence:"Min. Confidence (0-1)",cascadeConfidencePlaceholder:"खाली = हमेशा स्वीकार",cascadeTimeout:"टाइमआउट (मि.से.)",addCascadeStep:"कैस्केड चरण जोड़ें",parallelExecution:"समानांतर उपकरण निष्पादन",parallelExecutionDesc:"Run independent tool calls concurrently",parallelTimeout:"टाइमआउट (मि.से.)",maxToolIterations:"अधिकतम उपकरण पुनरावृत्ति",maxToolIterationsHint:"(डिफ़ॉल्ट 10)",toolRateLimits:"प्रति-उपकरण दर सीमा",toolRateLimitsDesc:"Override default rate for specific tools",toolName:"उपकरण नाम",addToolRate:"दर सीमा जोड़ें",retryConfig:"पुनः प्रयास कॉन्फ़िगरेशन",retryDesc:"Configure automatic retries with exponential backoff.",retryMaxAttempts:"अधिकतम प्रयास",retryDelay:"प्रारंभिक विलंब (मि.से.)",retryMultiplier:"बैकऑफ़ गुणक",retryMaxDelay:"अधिकतम विलंब (मि.से.)",ragConfig:"RAG (ज्ञान पुनर्प्राप्ति)",ragDesc:"Augment LLM responses with retrieved documents.",ragHttpCall:"HTTP कॉल URI",ragEmbeddingModel:"एम्बेडिंग मॉडल",ragEmbeddingModelPlaceholder:"जैसे text-embedding-3-small",ragEmbeddingStore:"एम्बेडिंग स्टोर",ragEmbeddingStorePlaceholder:"जैसे pgvector, qdrant",ragMaxResults:"अधिकतम परिणाम",ragMinScore:"Min Similarity Score (0-1)",moveDown:"नीचे ले जाएं",moveUp:"ऊपर ले जाएं",execution:"निष्पादन",budgetCosts:"बजट और लागत",preRequestDesc:"LLM निष्पादन से पहले प्रॉपर्टीज सेट या ट्रांसफॉर्म करें।",postResponseDesc:"LLM आउटपुट को प्रोसेस करें: प्रॉपर्टीज सेट करें, आउटपुट मैसेज बनाएं और क्विक रिप्लाई जनरेट करें।",postPropertyInstructions:"प्रॉपर्टी निर्देश",postOutputInstructions:"आउटपुट निर्देश",postQrInstructions:"क्विक रिप्लाई निर्देश",allSkills:"सभी कौशल",skillPlaceholder:"जैसे order-tracking",modeAgent:"एजेंट",modeChat:"चैट",perMinute:"/मिनट",allTools:"सभी उपकरण",selectSpecific:"विशिष्ट चुनें",allToolsInfo:"सभी {{count}} अंतर्निहित उपकरण LLM के लिए उपलब्ध हैं।「विशिष्ट चुनें」से उपलब्ध उपकरण सीमित करें।",availableTools:"उपलब्ध उपकरण",toolCount:"{{total}} में से {{selected}} चयनित",toolSources:"वर्कफ़्लो उपकरण स्रोत",toolSourcesInfo:"दोनों स्रोत डिफ़ॉल्ट रूप से सक्षम हैं — सभी वर्कफ़्लो HTTP कॉल और MCP कॉल स्वतः LLM उपकरण के रूप में उपलब्ध कराए जाते हैं। बहिष्कृत करने के लिए स्रोत अक्षम करें।",included:"शामिल"},NSt={language:"भाषा",langPlaceholder:"उदा: en, hi",outputSets:"आउटपुट सेट",addOutputSet:"आउटपुट सेट जोड़ें",noOutputSets:"कोई आउटपुट सेट कॉन्फ़िगर नहीं",actionName:"कार्य का नाम",timesOccurred:"×",removeOutput:"हटाएं",outputs:"आउटपुट",alternativeGroup:"वैकल्पिक समूह",addAlternative:"वैकल्पिक जोड़ें",addOutputGroup:"आउटपुट समूह जोड़ें",textPlaceholder:"आउटपुट पाठ...",urlPlaceholder:"URL…",delayMs:"विलंब (मिलीसेकंड)",quickReplies:"त्वरित उत्तर",noQuickReplies:"कोई Quick Replies नहीं",addQuickReply:"Quick Reply जोड़ें",qrValue:"बटन पाठ",qrExpressions:"अभिव्यक्ति",default:"डिफ़ॉल्ट"},ESt={setters:"संपत्ति सेटिंग",addSetter:"Setter जोड़ें",noSetters:"कोई Property Setter कॉन्फ़िगर नहीं",removeSetter:"हटाएं",triggerActions:"ट्रिगर कार्य",noActions:"कोई कार्य नहीं",actionPlaceholder:"उदा: greet, fallback",properties:"गुण",noProperties:"कोई गुण नहीं",addProperty:"गुण जोड़ें",propName:"गुण का नाम",propValue:"मान / अभिव्यक्ति",fromPath:"स्रोत पथ",fromObjectPath:"fromObjectPath",override:"ओवरराइड",propsCount:"गुण",untitled:"(कोई कार्य नहीं)"},LSt={language:"भाषा",langPlaceholder:"उदा: en, hi",words:"शब्द",addWord:"शब्द जोड़ें",wordPlaceholder:"उदा: नमस्ते",phrases:"वाक्यांश",addPhrase:"वाक्यांश जोड़ें",phrasePlaceholder:"उदा: सुप्रभात",regExs:"रेगुलर एक्सप्रेशन",addRegEx:"RegEx जोड़ें",regexPlaceholder:"रेगुलर एक्सप्रेशन",expressionPlaceholder:"उदा: greeting(hello)",frequency:"आवृत्ति",none:"कुछ परिभाषित नहीं"},DSt={title:"कोऑर्डिनेटर डैशबोर्ड",subtitle:"वार्तालाप प्रसंस्करण की निगरानी करें और Dead-Letter प्रविष्टियां प्रबंधित करें",type:"Coordinator प्रकार",connection:"कनेक्शन",processed:"संसाधित कार्य",deadLettered:"डेड-लेटर",activeQueues:"सक्रिय कतारें",queued:"कतार में",deadLetterTitle:"डेड-लेटर कतार",noDeadLetters:"कोई Dead-Letter प्रविष्टियां नहीं",colId:"ID",colConversation:"बातचीत",colError:"त्रुटि",colTime:"समय",colActions:"कार्रवाई",replay:"पुनः चलाएं",discard:"त्यागें",purgeAll:"सभी हटाएं",confirmPurge:"सभी हटाएं?",yes:"हां",cancel:"रद्द करें",replaySuccess:"Dead-Letter पुनः चलाया गया",replayError:"पुनः चलाने में विफल",discardSuccess:"Dead-Letter त्याग दिया गया",discardError:"त्यागने में विफल",purgeSuccess:"सभी Dead-Letter प्रविष्टियां हटाई गईं",purgeError:"हटाने में विफल",empty:"कोई Coordinator डेटा उपलब्ध नहीं",emptyHint:"Coordinator सेवा अभी शुरू हो रही हो सकती है। डेटा स्वचालित रूप से दिखाई देगा।"},TSt={expand:"विस्तारित करें",expandHint:"फ़ुलस्क्रीन (Ctrl+Shift+F)",close:"हो गया",lines:"पंक्तियां",chars:"अक्षर",fullscreenTitle:"सामग्री संपादक",fullscreenDescription:"फ़ुलस्क्रीन संपादक। बंद करने के लिए Escape दबाएं।"},ISt={title:"लॉग",description:"रियलटाइम लॉग स्ट्रीम की निगरानी करें या ऐतिहासिक लॉग खोजें।",tabLive:"लाइव",tabHistory:"इतिहास",connected:"जुड़ा हुआ",disconnected:"डिस्कनेक्ट",filterAgent:"एजेंट ID…",filterConversation:"वार्तालाप ID...",filterInstance:"इंस्टेंस ID...",allLevels:"सभी स्तर",pause:"विराम",resume:"जारी रखें",clear:"साफ़ करें",search:"खोजें",waitingForLogs:"लॉग की प्रतीक्षा...",connectingStream:"स्ट्रीम से जुड़ रहा है...",noHistoryLogs:"कोई ऐतिहासिक लॉग नहीं मिला।",entryCount:"{{count}} प्रविष्टियां",showStacktrace:"Stacktrace दिखाएं ({{count}} फ्रेम)",hideStacktrace:"Stacktrace छिपाएं",allAgents:"सभी एजेंट",allConversations:"सभी बातचीत",waitingHint:"Backend से Stream होने पर Log यहाँ दिखाई देंगे।",noHistoryHint:"फ़िल्टर समायोजित करें या किसी अन्य Agent या Conversation को खोजें।",searchConversations:"ID, एजेंट, उपयोगकर्ता द्वारा खोजें…",stepsCount:"{{count}} चरण",noConversationsFound:"कोई वार्तालाप नहीं मिला",useConversationId:"ID का उपयोग करें: {{id}}",searchLogs:"लॉग खोजें…",errors:"त्रुटियाँ",warnings:"चेतावनी",infos:"जानकारी",debugs:"डीबग",filteredCount:"{{shown}} / {{total}} प्रविष्टियाँ",copyEntry:"लॉग प्रविष्टि कॉपी करें",export:"निर्यात करें",stateReady:"तैयार",stateActive:"सक्रिय",stateError:"त्रुटि",stateEnded:"समाप्त"},ASt={title:"सीक्रेट वॉल्ट",description:"Vault में एन्क्रिप्टेड Secrets प्रबंधित करें। मान कभी उजागर नहीं होते।",tenantId:"टेनेंट ID",refresh:"Secrets लोड करें",create:"Secret जोड़ें",createTitle:"Secret जोड़ें",keyName:"कुंजी का नाम",keyNameLabel:"कुंजी का नाम",keyNamePlaceholder:"उदा: apiKey, dbPassword",valueLabel:"Secret मान",valuePlaceholder:"Secret मान दर्ज करें…",storeWarning:"मान एन्क्रिप्ट किया जाएगा। संग्रहण के बाद पुनः प्राप्त नहीं किया जा सकता।",store:"Secret संग्रहित करें",storeSuccess:'Secret "{{key}}" संग्रहित किया गया',deleteSuccess:'Secret "{{key}}" हटाया गया',created:"बनाया गया",lastAccessed:"अंतिम पहुंच",checksum:"जांच योग",actions:"कार्रवाई",confirmDeleteTitle:"Secret हटाएं",confirmDeleteMessage:'क्या आप वाकई "{{key}}" को स्थायी रूप से हटाना चाहते हैं? यह पूर्ववत नहीं किया जा सकता।',empty:"कोई Secrets नहीं मिला",emptyHint:"Secret बनाएं या ऊपर Namespace फ़िल्टर बदलें।",vaultUp:"Vault ऑनलाइन",vaultDown:"Vault ऑफ़लाइन",descriptionLabel:"विवरण (वैकल्पिक)",descriptionPlaceholder:"उदाहरण: उत्पादन के लिए OpenAI API",descriptionCol:"विवरण",reference:"संदर्भ",willUseRef:"संदर्भ:",copyRef:"वॉल्ट का संदर्भ कॉपी करें",refCopied:"कॉपी किया गया: {{ref}}",lastRotated:"अंतिम बार घूमा",scopeExplanation:"सीक्रेट्स हर किरायेदारों के लिए है। इस्तेमाल करें: ${vault:keyName}।",creatingFor:'टेनेंट "{{tenant}}" में सहेज रहा है — सभी एजेंटों के लिए',vaultNotConfigured:"सीक्रेट्स विन्यास नहीं हो सका",viewDocs:"दस्तावेज़ देखें",selectAgentFirst:"पहले एक एजेंट चुनें",tableTitle:'{{count}} सीक्रेट टेनेंट "{{tenant}}" में'},RSt={title:"ऑडिट लॉग",description:"अनुपालन और डीबगिंग के लिए अपरिवर्तनीय ऑडिट लेजर ब्राउज़ करें।",byConversation:"वार्तालाप द्वारा",byAgent:"Agent द्वारा",conversationIdPlaceholder:"वार्तालाप ID दर्ज करें...",agentIdPlaceholder:"Agent ID दर्ज करें...",versionPlaceholder:"संस्करण (वैकल्पिक)",search:"खोजें",entries:"प्रविष्टियां",totalDuration:"कुल",totalCost:"कुल लागत",step:"चरण",tasks:"कार्य",input:"इनपुट",output:"आउटपुट",llmDetail:"LLM विवरण",toolCalls:"टूल कॉल",hmacIntegrity:"HMAC अखंडता सत्यापित",empty:"ऑडिट प्रविष्टियां खोजें",emptyHint:"Audit Trail ब्राउज़ करने के लिए ऊपर वार्तालाप या Agent ID दर्ज करें।",noResults:"कोई ऑडिट प्रविष्टियां नहीं मिलीं",noResultsHint:"भिन्न ID आज़माएं या जांचें कि वार्तालाप संसाधित हो चुका है।",loadMore:"और लोड करें",selectAgent:"Select an agent…",conversations:"conversations",emptyAgent:"Select an agent to view its audit trail",emptyAgentHint:"Choose a deployed agent from the dropdown above to see all its audit records.",export:"Export",autoRefreshToggle:"Toggle auto-refresh (every 10s)",autoRefreshOn:"Auto",autoRefreshOff:"Auto",integrityVerified:"All entries cryptographically signed",integrityVerifiedDesc:"{{count}} of {{total}} entries have HMAC-SHA256 signatures",integrityPass:"SIGNED",integrityPartial:"Partially signed audit trail",integrityPartialDesc:"{{count}} of {{total}} entries have HMAC signatures",integrityNone:"Unsigned audit entries",integrityNoneDesc:"Configure a vault master key to enable automatic HMAC-SHA256 signing on all future audit entries.",signed:"Signed",allSigned:"All signed"},MSt={title:"शेड्यूल",subtitle:"Agent शेड्यूल ट्रिगर प्रबंधित करें — Cron और Heartbeats",create:"शेड्यूल बनाएं",createTitle:"शेड्यूल बनाएं",createSuccess:"शेड्यूल सफलतापूर्वक बनाया गया",createError:"शेड्यूल बनाने में विफल",creating:"बनाया जा रहा है...",name:"नाम",namePlaceholder:"उदा: दैनिक स्वास्थ्य जांच",triggerType:"ट्रिगर प्रकार",cronExpression:"Cron अभिव्यक्ति",interval:"अंतराल (सेकंड)",agentId:"Agent ID",agentIdPlaceholder:"Agent ID दर्ज करें...",environment:"परिवेश",message:"संदेश",messagePlaceholder:"Agent को भेजने का संदेश",conversationStrategy:"वार्तालाप रणनीति",total:"कुल शेड्यूल",active:"सक्रिय",failedCount:"विफल / Dead-Lettered",nextFireLabel:"अगला निष्पादन",tableTitle:"सभी शेड्यूल",empty:"अभी तक कोई शेड्यूल नहीं",emptyHint:"Agent ट्रिगर स्वचालित करने के लिए शेड्यूल बनाएं।",colName:"नाम",colType:"प्रकार",colSchedule:"शेड्यूल",colAgent:"एजेंट",colStatus:"स्थिति",colNextFire:"अगला",colLastFired:"पिछला",colActions:"कार्रवाई",enable:"सक्षम करें",disable:"अक्षम करें",enabled:"शेड्यूल सक्षम किया गया",disabled:"शेड्यूल अक्षम किया गया",toggleError:"शेड्यूल टॉगल करने में विफल",fireNow:"अभी निष्पादित करें",fired:"शेड्यूल सफलतापूर्वक निष्पादित",fireError:"निष्पादन विफल",retry:"पुनः प्रयास",retrySuccess:"शेड्यूल पुनः कतारबद्ध",retryError:"पुनः प्रयास विफल",deleteSuccess:"शेड्यूल हटाया गया",deleteError:"शेड्यूल हटाने में विफल",fireHistory:"निष्पादन इतिहास"},PSt={title:"डीबग",tabPipeline:"पाइपलाइन",tabCosts:"लागत",tabMemory:"मेमोरी",tabLogs:"लॉग्स",tabPrompt:"प्रॉम्प्ट",turn:"टर्न",latest:"नवीनतम",noPipeline:"पाइपलाइन ट्रेस देखने के लिए एक संदेश भेजें",processing:"प्रोसेस हो रहा है...",actions:"कार्रवाई",confidence:"विश्वास",duration:"अवधि"},OSt={thisTurn:"यह टर्न",conversationTotal:"कुल चर्चा",tokens:"Tokens",cost:"लागत",duration:"अवधि",model:"मॉडल",toolCalls:"टूल कॉल्स",toolUsage:"टूल उपयोग",cacheStats:"कैश",hitRate:"हिट रेट",empty:"लागत मेट्रिक्स देखने के लिए संदेश भेजें",in:"इन",out:"आउट",total:"कुल",calls:"कॉल्स"},jSt={title:"वार्तालाप मेमोरी",noConversation:"मेमोरी का निरीक्षण करने के लिए एक वार्तालाप प्रारंभ करें",empty:"कोई मेमोरी डेटा उपलब्ध नहीं है",properties:"गुण",step:"चरण",keys:"कुंजियाँ",input:"इनपुट"},FSt={noAgent:"लॉग देखने के लिए एक Agent चुनें",search:"खोजें...",pause:"विराम",resume:"जारी रखें",clear:"साफ़ करें",waiting:"लॉग की प्रतीक्षा की जा रही है...",connected:"जुड़ा हुआ",disconnected:"डिसकनेक्ट",logOutput:"लॉग आउटपुट"},BSt={noConversation:"प्रॉम्प्ट का निरीक्षण करने के लिए वार्तालाप प्रारंभ करें",noLlm:"अभी तक कोई LLM इंटरैक्शन नहीं मिला",turn:"टर्न",latest:"नवीनतम",tokens:"Tokens",model:"मॉडल",cost:"लागत",copy:"प्रॉम्प्ट कॉपी करें",copied:"कॉपी किया गया!",replay:"इस टर्न को फिर से चलाएं",toolCalls:"टूल कॉल्स",step:"चरण",roleSystem:"सिस्टम प्रॉम्प्ट",roleUser:"उपयोगकर्ता",roleAssistant:"सहायक",roleTool:"टूल परिणाम"},HSt={preview:"पूर्वावलोकन",edit:"संपादन",switchToPreview:"हल किए गए प्रॉम्प्ट का पूर्वावलोकन",switchToEdit:"संपादन पर जाएं",refresh:"रिफ़्रेश",sampleData:"नमूना डेटा (बातचीत के बिना)",disclaimerReal:"पूर्वावलोकन वास्तविक बातचीत डेटा के साथ Qute इंजन का उपयोग करता है।",disclaimerSample:"पूर्वावलोकन नमूना डेटा के साथ Qute इंजन का उपयोग करता है। वास्तविक मानों के लिए कोई बातचीत चुनें।",resolvedPrompt:"हल किया गया प्रॉम्प्ट",copy:"कॉपी",copied:"कॉपी हो गया!",error:"टेम्पलेट हल करने में त्रुटि",loading:"टेम्पलेट हल हो रहा है…",availableVariables:"उपलब्ध चर",copyVariable:"चर संदर्भ कॉपी करने के लिए क्लिक करें",varProperties:"गुण",varMemory:"स्मृति",varContext:"संदर्भ",varSnippets:"स्निपेट",varUserInfo:"उपयोगकर्ता जानकारी",varConversationInfo:"बातचीत जानकारी",varInput:"इनपुट",varConversationLog:"बातचीत लॉग"},WSt={title:"एजेंट स्टूडियो",subtitle:"एक ही कार्यस्थान में अपने Agents का निर्माण, परीक्षण और डीबग करें",pipeline:"पाइपलाइन",editor:"संपादक",debug:"डीबग और चैट",selectStage:"संपादक खोलने के लिए किसी भी पाइपलाइन चरण पर क्लिक करें",openInStudio:"स्टूडियो में खोलें",loading:"Agent लोड हो रहा है...",notFound:"Agent नहीं मिला",hideChat:"चैट छिपाएं",showChat:"चैट दिखाएं",openEditor:"संपादक में खोलें",editorComingSoon:"इन-प्लेस संपादक एकीकरण जल्द आ रहा है",noPipeline:"कोई पाइपलाइन चरण नहीं",type:{parser:"पार्सर",rules:"नियम",property:"प्रॉपर्टी सेटर",apicalls:"API कॉल्स",llm:"LLM",output:"आउटपुट","output.template":"आउटपुट टेम्प्लेट",mcpcalls:"MCP कॉल्स",rag:"नॉलेज बेस",dictionary:"शब्दकोश"},landingDescription:"विज़ुअल पाइपलाइन एडिटर, डीबगर और लाइव चैट खोलने के लिए एक एजेंट चुनें",noAgents:"कोई एजेंट नहीं मिला — एजेंट पेज से एक बनाएं",chat:"चैट",backToAgent:"एजेंट पर वापस जाएं",selectStageHint:"कॉन्फ़िगरेशन इनलाइन देखने और संपादित करने के लिए पाइपलाइन में कोई एक्सटेंशन चुनें",noConfig:"इस पाइपलाइन चरण का कोई कॉन्फ़िगरेशन URI नहीं है",unsupportedType:"इस एक्सटेंशन प्रकार के लिए एडिटर उपलब्ध नहीं है"},VSt={general:"सामान्य",kbName:"नॉलेज बेस का नाम",kbNamePlaceholder:"उदा: product-docs, faq, internal-wiki",kbNameHint:"LLM कार्यों से इस KB को संदर्भित करने के लिए उपयोग किया जाता है",embeddingModel:"एम्बेडिंग मॉडल",provider:"प्रदाता",embeddingParams:"प्रदाता पैरामीटर",embeddingParamsHint:"मॉडल का नाम, API कुंजी (गुप्त जानकारी के लिए ${vault:...} उपयोग करें), बेस URL आदि।",vectorStore:"वेक्टर प्रणाली",storeType:"स्टोर के प्रकार",storeParams:"कनेक्शन पैरामीटर",chunking:"दस्तावेज़ चंकिंग",chunkStrategy:"रणनीति",chunkSize:"चंक आकार",chunkOverlap:"चंक ओवरलैप",overlapHint:"ओवरलैप चंक्स के बीच संदर्भ बनाए रखने में मदद करता है",chunkPreview:"पूर्वावलोकन (दस्तावेज़ कैसे विभाजित होगा)",chunkBlocks:"{{overlap}} वर्णों के ओवरलैप के साथ लगभग {{size}} वर्णों के {{count}} चंक्स",retrievalDefaults:"दस्तावेज पुनर्प्राप्ति डिफ़ॉल्ट",retrievalHint:"इन डिफ़ॉल्ट्स को LLM कॉन्फ़िगरेशन में प्रति-कार्य के आधार पर ओवरराइड किया जा सकता है।",maxResults:"अधिकतम परिणाम (top-K)",minScore:"न्यूनतम समानता स्कोर",ingestion:"दस्तावेज़ अंतर्ग्रहण",dropFiles:"फ़ाइलों को यहाँ पर ड्रैग एंड ड्रॉप करें",dropHint:"टेक्स्ट, मार्कडाउन या अन्य कोई टेक्स्ट पर आधारित फ़ाइल",browse:"ब्राउज़ करें",pasteText:"या केवल टेक्स्ट पेस्ट करें",pastePlaceholder:"दस्तावेज़ का टेक्स्ट यहाँ पेस्ट करें...",ingestText:"टेक्स्ट सुरक्षित करें",ingestionHistory:"अंतर्ग्रहण स्थिति",saveFirstIngestion:"दस्तावेज़ को प्रोसेस करने से पहले इस नॉलेज बेस को सहेजें।",addParam:"पैरामीटर जोड़ें"},zSt={welcome:{title:"EDDI में आपका स्वागत है",subtitle:"आपका AI Agent कमांड सेंटर",introText:"EDDI ऍप्लिकेशन संवादात्मक AI एजेंटों के निर्माण, परीक्षण और संचालन के लिए आपका कमांड सेंटर है।",capabilitiesTitle:"आप क्या कर सकते हैं",capabilitiesSubtitle:"उत्पादन-तैयार (Production) AI एजेंट बनाने के लिए आवश्यक सब कुछ",buildAgents:"एजेंट (Agents) बनाएं",buildAgentsDesc:"विज़ार्ड के साथ या शुरू से AI एजेंट बनाएं और कॉन्फ़िगर करें",designWorkflows:"वर्कफ़्लो डिज़ाइन करें",designWorkflowsDesc:"LLM चयन प्रक्रिया, नियमों और उपकरण युक्त ड्रैग-एंड-ड्रॉप बिल्डर",testRealtime:"रीयल-टाइम में परीक्षण करें",testRealtimeDesc:"स्ट्रीमिंग प्रतिक्रियाओं और अंतर्निहित डीबगिंग सुविधाओं के साथ अपने एजेंट्स से बातचीत करें",monitorOperate:"समीक्षा और संचालन",monitorOperateDesc:"वार्तालाप, ऑडिट ट्रेल्स, गुप्त कुंज़ियाँ (Secrets) और सीमाएं (Quotas) — सब एक ही स्थान पर",readyTitle:"शुरू करने के लिए तैयार हैं?",readySubtitle:"आप साइडबार में स्थित सहायता मेनू से किसी भी परिचय-यात्रा को कभी भी पुनरारंभ कर सकते हैं",startTour:"टूर प्रारंभ करें",exploreOwn:"मैं स्वयं से निरीक्षण करूँगा"},tour:{back:"वापस",next:"अगला",skip:"टूर छोड़ें",finish:"समाप्त करें",stepOf:"चरण {{current}} / {{total}}",dashboard:{title:"डैशबोर्ड टूर",step1Title:"आपका कमांड सेंटर",step1Desc:"साइडबार सब कुछ तीन क्षेत्रों में व्यवस्थित करता है: प्रबंधन, विकास और संचालन। आप हमेशा जानेंगे कि चीजें कहां ढूंढनी हैं।",step2Title:"प्लैटफॉर्म अवलोकन",step2Desc:"आपके एजेंटों, वर्कफ़्लो और वार्तालापों की लाइव गणना। सीधे उस अनुभाग पर जाने के लिए किसी भी कार्ड पर क्लिक करें।",step3Title:"त्वरित क्रियाएं",step3Desc:"सामान्य कार्यों पर सीधे जाएं। एजेंट विज़ार्ड आपका पहला एजेंट बनाने का सबसे तेज़ तरीका है — इसमें 2 मिनट से भी कम समय लगता है।",step4Title:"इसे अपना बनाएं",step4Desc:"लाइट, डार्क और सिस्टम थीम के बीच स्विच करें। EDDI प्रशासक 11 भाषाएं बोलता है — भाषा चयनकर्ता से अपनी भाषा चुनें।"},agents:{title:"एजेंट्स टूर",step1Title:"विज़ार्ड",step1Desc:"विज़ार्ड एक पूरी तरह से कॉन्फ़िगर किए गए एजेंट को बनाने में आपका मार्गदर्शन करता है — एक मॉडल चुनें, व्यक्तित्व सेट करें, उपकरण सक्षम करें और परिनियोजित (deploy) करें।",step2Title:"मैनुअल निर्माण",step2Desc:"उन्नत उपयोगकर्ताओं के लिए: एक रिक्त एजेंट बनाएं और इसे पूर्ण JSON नियंत्रण के साथ कॉन्फ़िगर करें।",step3Title:"खोजें और फ़िल्टर करें",step3Desc:"नाम से तुरंत एजेंटों को खोजें। दाईं ओर टॉगल के साथ कार्ड और सूची दृश्यों के बीच स्विच करें।",step4Title:"एजेंट सूची",step4Desc:"प्रत्येक कार्ड एजेंट का नाम, संस्करण और अंतिम संशोधित समय दिखाता है। परिनियोजन, चैट और वर्कफ़्लो नियंत्रणों के साथ विस्तृत पृष्ठ के लिए किसी भी एजेंट पर क्लिक करें।"},workflows:{title:"वर्कफ़्लो टूर",step1Title:"वर्कफ़्लो बनाएं",step1Desc:"वर्कफ़्लो पाइपलाइन - LLM कॉल, व्यवहार नियम और HTTP कॉल जैसे कार्य की एक कतार को परिभाषित करते हैं।",step2Title:"आपके वर्कफ़्लो",step2Desc:"विभिन्न वर्कफ़्लो को एक या अधिक विशिष्ट एजेंट्स से जोड़ा जा सकता है। ड्रैग-एंड-ड्रॉप संपादक खोलने के लिए क्लिक करें।",step3Title:"नज़ारे व्यवस्थित करें",step3Desc:"नाम से खोजें और कार्ड ग्रिड और क्रमबद्ध योग्य सूची दृश्यों के बीच टॉगल करें।"},chat:{title:"चैट टूर",step1Title:"एक एजेंट चुनें",step1Desc:"वार्तालाप प्रारंभ करने के लिए एक परिनियोजित (deployed) एजेंट का चयन करें। केवल वही एजेंट यहां दिखाई देते हैं जिन्हें परिनियोजित किया गया है।",step2Title:"स्ट्रीमिंग मोड",step2Desc:"रियल टाइम टोकन स्ट्रीमिंग टॉगल करें। जब सक्षम होता है, तो प्रतिक्रिया शब्द-दर-शब्द प्रकट होती है - जो विलंबता को डीबग करने के लिए उत्तम है।",step3Title:"वार्तालाप इतिहास",step3Desc:"पिछले वार्तालापों को ब्राउज़ करने और फिर से शुरू करने के लिए साइडबार खोलें।",step4Title:"चैट प्रारंभ करें",step4Desc:"एक संदेश टाइप करें और एंटर दबाएं। एजेंट आपके द्वारा कॉन्फ़िगर किए गए LLM, टूल और वर्कफ़्लो का उपयोग करके प्रतिक्रिया देगा।"},channels:{title:"चैनल",subtitle:"एजेंट और समूहों को Slack जैसे मैसेजिंग प्लेटफ़ॉर्म से जोड़ें"},resources:{title:"संसाधन (Resources) टूर",step1Title:"एक्सटेंशन लाइब्रेरी",step1Desc:"संसाधन वर्कफ़्लो के बिल्डिंग ब्लॉक हैं। प्रत्येक प्रकार एजेंट के व्यवहार के एक अलग हिस्से को नियंत्रित करता है।",step2Title:"LLM कॉन्फ़िगरेशन",step2Desc:"परिभाषित करें कि कौन सा AI मॉडल आपके एजेंट की सिस्टम प्रांप्ट (Prompt), उपकरण, MCP सर्वर और कैस्केड सेटिंग्स को चलाता है। यह एजेंट का मस्तिष्क है।",step3Title:"नियम और API कॉल्स",step3Desc:"व्यवहार नियम बातचीत के प्रवाह को नियंत्रित करते हैं। HTTP कॉल्स बाहरी API से जुड़ते हैं। दोनों को LLM टूल के रूप में इस्तेमाल किया जा सकता है।"},conversations:{title:"वार्तालाप टूर",step1Title:"खोज",step1Desc:"ID, एजेंट, या हाल के उपयोगकर्ता संदेशों द्वारा त्वरित रूप से वार्तालाप खोजें।",step2Title:"स्थिति फ़िल्टर",step2Desc:"अवस्था के अनुसार बातचीत फ़िल्टर करें: सक्रिय, प्रगति पर, समाप्त, या त्रुटि।",step3Title:"वार्तालाप सूची",step3Desc:"सभी सत्र ब्राउज़ करें। समयरेखा खोलने और डीबग करने के लिए किसी भी वार्तालाप कार्ड पर क्लिक करें।"},groups:{title:"समूह (Groups) टूर",step1Title:"समूह बनाएं",step1Desc:"एकाधिक एजेंटों को सहयोग और बहस करने देने के लिए एक ऑर्केस्ट्रेशन समूह बनाएं।",step2Title:"समूह खोजें",step2Desc:"अपने मौजूदा बहु-एजेंट क्लस्टर के माध्यम से खोजें।",step3Title:"समूह ग्रिड",step3Desc:"अपने सहयोगी वातावरण प्रबंधित करें, उनकी नीतियां संपादित करें, या पुराने समूहों को हटा दें।"},logs:{title:"सिस्टम लॉग्ज़ टूर",step1Title:"लाइव बनाम इतिहास",step1Desc:"सिस्टम लॉग की वास्तविक समय की धारा और ऐतिहासिक लॉग खोज के बीच स्विच करें।",step2Title:"स्ट्रीम फ़िल्टर",step2Desc:"आने वाले लाइव स्ट्रीम को एजेंट या महत्वपूर्ण लॉग स्तर द्वारा फ़िल्टर करें।",step3Title:"तैयार",step3Desc:"बाहरी विश्लेषण के लिए वर्तमान फ़िल्टर किए गए लॉग को एक टेक्स्ट फ़ाइल के रूप में डाउनलोड करें।"},secrets:{title:"गुप्त खजाना (Vault) टूर",step1Title:"गुप्त (Secret) बनाएं",step1Desc:"सुरक्षित रूप से एक नई API कुंजी, टोकन, या पासवर्ड स्टोर करें जिसका संदर्भ आपके एजेंट दे सकते हैं।",step2Title:"टेनेंट (Tenant) अलगाव",step2Desc:"विशिष्ट किरायेदार ID तक सीमित गुप्त (Secrets) दिखाने के लिए वॉल्ट (Vault) दृश्य को फ़िल्टर करें।",step3Title:"संदर्भ सिंटैक्स",step3Desc:"जानें कि बिना हार्डकोडिंग के अपने LLM कॉन्फ़िगरेशन में डायनामिक रूप से रहस्यों को कैसे इंजेक्ट किया जाए।"},audit:{title:"ऑडिट लेजर टूर",step1Title:"खोज मोड",step1Desc:"एक विशिष्ट वार्तालाप ID या एजेंट संस्करण द्वारा अपरिवर्तनीय ऑडिट लेज़र खोजें।",step2Title:"खोज निष्पादित करें",step2Desc:"सत्यापन योग्य निष्पादन इतिहास खींचने के लिए अपनी ID दर्ज करें और खोज पर क्लिक करें।",step3Title:"लेजर निर्यात (Export) करें",step3Desc:"अनुपालन और रिपोर्टिंग के लिए प्राप्त ऑडिट रिकॉर्ड को JSON में निर्यात करें।"},schedules:{title:"शेड्यूल टूर",step1Title:"शेड्यूल बनाएं",step1Desc:"एजेंट वर्कफ़्लो को स्वचालित रूप से ट्रिगर करने के लिए एक नई क्रॉन (cron) जॉब या निरंतर हार्टबीट (heartbeat) सेट अप करें।",step2Title:"स्वास्थ्य आँकड़े",step2Desc:"अपने प्लेटफॉर्म पर कुल, सक्रिय और विफल अनुसूचियों की निगरानी करें।",step3Title:"शेड्यूल प्रबंधन",step3Desc:"अपने स्वचालित ट्रिगर को मूल रूप से प्रबंधित करें: उन्हें रोकें, फिर से शुरू करें, संपादित करें, या टेस्ट-फ़ायर करें।"},quotas:{title:"कोटा (Quotas) टूर",step1Title:"कॉन्फ़िगरेशन बाधाएं",step1Desc:"इस खाते (tenant) के लिए कुल एजेंटों, दैनिक बातचीत, और टोकन लागत पर कठिन सीमाएं परिभाषित करें।",step2Title:"उपयोग संबंधी विश्लेषण",step2Desc:"मॉनिटर करें कि खाते (tenant) ने आवंटित कोटे का कितना हिस्सा वास्तविक समय में खपत किया है।",step3Title:"परिवर्तन लागू करें",step3Desc:"अपनी समायोजित सीमाओं को सहेजें। प्लेटफॉर्म ट्रैफ़िक को ब्लॉक कर देगा जो इन सीमाओं का उल्लंघन करता है।"},coordinator:{title:"कॉर्डिनेटर टूर",step1Title:"लाइव कनेक्शन",step1Desc:"बैकएंड समन्वयक सिस्टम से जुड़े हार्टबीट और ईवेंट स्रोत देखें।",step2Title:"कतार (Queue) प्रसंस्करण",step2Desc:"अपने क्लस्टर पर रीयल-टाइम कार्य कतारों (queues) और सक्रिय जॉब निष्पादन की निगरानी करें।",step3Title:"मृत पत्र",step3Desc:"सिस्टम स्थिरता बनाए रखने के लिए विफल कार्यों का निरीक्षण करें और व्यवस्थित रूप से उन्हें त्यागें या पुनः प्रयास करें।"},orphans:{title:"अनाथ संसाधन टूर",step1Title:"स्कैन शुरू करें",step1Desc:"किसी भी एजेंट से कटे हुए ढीले कॉन्फ़िगरेशन का पता लगाने के लिए एक प्लेटफ़ॉर्म स्कैन प्राम्भ करें।",step2Title:"सॉफ्ट-डिलीटेड (Soft-Deleted) शामिल करें",step2Desc:"वैकल्पिक रूप से शुद्ध (purge) में ऐतिहासिक रूप से हटाए गए रिकॉर्ड को शामिल करने के लिए टॉगल करें।",step3Title:"समीक्षा और पुर्ज (Purge)",step3Desc:"स्कैनर की रिपोर्ट की समीक्षा करें, पुरानी वस्तुओं का चयन करें, और डेटाबेस स्थान को पुनः प्राप्त करने के लिए स्थायी रूप से साफ़ करें।"}},help:{title:"सहायता और टूर",platformTour:"प्लेटफ़ॉर्म टूर",resetAll:"सभी टूर रीसेट करें",resetConfirm:"क्या आप सभी टुर प्रगति को रीसेट करना चाहते हैं?"},offer:{message:"क्या आप नए हैं? {{page}} लें",accept:"मुझे दिखाएं",dontAsk:"फिर कभी न पूछें"}},USt={status:"प्लेटफ़ॉर्म स्थिति",online:"ऑनलाइन",offline:"ऑफ़लाइन",checking:"कनेक्शन जाँच…",connected:"कनेक्टेड",disconnected:"डिस्कनेक्टेड",instance:"दृष्टांत",latency:"विलंब",lastChecked:"अंतिम जाँच",justNow:"अभी",secondsAgo:"{{count}} सेकंड पहले"},$St={live:"लाइव",reconnecting:"पुनः कनेक्ट हो रहा है…"},qSt={title:"नया {{type}}",newAgent:"नया एजेंट",newGroup:"नया समूह",quickCreate:"त्वरित निर्माण",quickCreateTitle:"त्वरित {{type}} बनाएं",quickCreateDesc:"एक नाम और विवरण सेट करें, विवरण बाद में कॉन्फ़िगर करें।",guidedSetup:"निर्देशित सेटअप",guidedSetupDesc:"LLM प्रदाता, प्रॉम्प्ट (Prompts) और डिप्लॉयमेंट (Deployment) के साथ चरण-दर-चरण विज़ार्ड।"},KSt={empty:"अभी तक कोई Group नहीं",emptyDescription:"Group कई Agent को संरचित चर्चाओं में सहयोग करने देते हैं।",createGroup:"Group बनाएं",unnamed:"बिना नाम का Group",count_one:"{{count}} समूह",count_other:"{{count}} समूह",confirmDelete:"इस Group को हटाएं?",confirmDeleteDesc:"Group कॉन्फ़िगरेशन स्थायी रूप से हटा दी जाएगी।",duplicateSuccess:"Group डुप्लिकेट किया गया",noDescription:"No description",members:"members",discussionStyle:"Discussion Style",maxRounds:"Max Rounds"},GSt={title:"उपयोगकर्ता स्मृति",subtitle:"एजेंट द्वारा संग्रहित स्थायी उपयोगकर्ता स्मृतियां ब्राउज़ करें और प्रबंधित करें",userIdPlaceholder:"उपयोगकर्ता ID दर्ज करें…",searchPlaceholder:"स्मृतियां खोजें…",enterUserId:"उनकी स्मृतियां ब्राउज़ करने के लिए उपयोगकर्ता ID दर्ज करें",totalEntries:"कुल प्रविष्टियां",preferences:"प्राथमिकताएं",facts:"तथ्य",conflicts:"विवाद",cat_all:"सभी",cat_preference:"प्राथमिकताएं",cat_fact:"तथ्य",cat_context:"संदर्भ",deleteAll:"सभी हटाएं",deleteAllTitle:"सभी स्मृतियां हटाएं",deleteAllDesc:"इस उपयोगकर्ता की सभी स्मृतियां स्थायी रूप से हटा दी जाएंगी। यह क्रिया पूर्ववत नहीं की जा सकती।",deleteAllConfirm:"सभी हटाएं",entryDeleted:"स्मृति प्रविष्टि हटाई गई",allDeleted:"उपयोगकर्ता की सभी स्मृतियां हटाई गईं",noResults:"कोई स्मृति प्रविष्टियां नहीं मिलीं",value:"मान",sourceAgent:"स्रोत एजेंट",accessCount:"पहुंच गणना",created:"बनाया गया",updated:"अपडेट हुआ",sourceConversation:"स्रोत बातचीत",conflicted:"विवादित"},YSt={title:"उपयोगकर्ता गुण",subtitle:"प्रति उपयोगकर्ता संग्रहित longTerm गुण ब्राउज़ करें और प्रबंधित करें",userIdPlaceholder:"उपयोगकर्ता ID दर्ज करें…",searchPlaceholder:"गुण फ़िल्टर करें…",enterUserId:"उनके गुण देखने के लिए उपयोगकर्ता ID दर्ज करें",key:"कुंजी",type:"प्रकार",value:"मान",deleteAll:"सभी हटाएं",deleteAllTitle:"सभी गुण हटाएं",deleteAllDesc:"इस उपयोगकर्ता के सभी गुण स्थायी रूप से हटा दिए जाएंगे।",deleted:"गुण हटाए गए",noResults:"कोई गुण नहीं मिले",showingCount:"{{count}} गुण"},QSt={title:"एजेंट ट्रिगर",subtitle:"स्वचालित रूटिंग के लिए इंटेंट को एजेंट डिप्लॉयमेंट से मैप करें",create:"नया ट्रिगर",createTitle:"ट्रिगर बनाएं",editTitle:"ट्रिगर संपादित करें",intent:"इंटेंट",deployments:"एजेंट डिप्लॉयमेंट",addDeployment:"एजेंट जोड़ें",agents:"एजेंट",empty:"अभी तक कोई ट्रिगर कॉन्फ़िगर नहीं किए गए",created:"ट्रिगर बनाया गया",updated:"ट्रिगर अपडेट किया गया",deleted:"ट्रिगर हटाया गया",deleteTitle:"ट्रिगर हटाएं",deleteDesc:"इंटेंट 「{{intent}}」का ट्रिगर स्थायी रूप से हटाना है?",searchPlaceholder:"इंटेंट या एजेंट ID से फ़िल्टर करें…"},XSt={title:"क्षमता खोज",subtitle:"घोषित कौशल और क्षमताओं के आधार पर एजेंट खोजें",searchPlaceholder:"कौशल खोजें…",strategyHighest:"सर्वोच्च विश्वास",strategyAll:"सभी मिलान",registeredSkills:"पंजीकृत कौशल",noSkills:"कोई कौशल नहीं मिले",matchingAgents:"मेल खाने वाले एजेंट",noMatches:"इस कौशल के लिए कोई एजेंट नहीं मिला"},ZSt={title:"एजेंट निर्यात करें",loading:"संसाधन ट्री लोड हो रहा है...",selectResources:"निर्यात करने के लिए संसाधन चुनें",required:"आवश्यक",snippets:"स्निपेट",allSelected:"सभी संसाधन चयनित हैं",countSelected:"{{total}} में से {{count}} संसाधन चयनित",exportSelected:"चयनित निर्यात करें"},JSt={title:"एजेंट आयात करें",dropZone:"यहां .zip फ़ाइल खींचें या ब्राउज़ करने के लिए क्लिक करें",dropZoneHint:"निर्यातित एजेंट संग्रह (.zip)",strategyLabel:"आयात रणनीति",createNew:"नए एजेंट के रूप में बनाएँ",createNewDesc:"नई आईडी के साथ नई प्रतिलिपि बनाता है। पहले आयात के लिए सर्वोत्तम।",mergeSync:"मौजूदा के साथ मर्ज / सिंक करें",mergeSyncDesc:"यदि पहले आयात किया गया है तो मौजूदा संसाधनों को अपडेट करता है। नहीं मिलने पर नया बनाता है।",upgradeExisting:"मौजूदा एजेंट को अपग्रेड करें",upgradeDesc:"लक्ष्य एजेंट के खिलाफ संसाधनों का संरचनात्मक रूप से मिलान करें।",syncRemote:"रिमोट इंस्टेंस से सिंक करें",syncDesc:"किसी अन्य EDDI इंस्टेंस से कनेक्ट करें और किसी विशिष्ट एजेंट को लाइव सिंक करें।",importNow:"अभी आयात करें",previewChanges:"परिवर्तन पूर्वावलोकन",selectTargetAgent:"लक्ष्य एजेंट का चयन करें",upgradeTargetHint:"आयातित संसाधनों को इस एजेंट के साथ ढांचागत रूप से मिलाया जाएगा।",chooseAgent:"— एजेंट चुनें —",sourceAgent:"स्रोत एजेंट (रिमोट)",targetAgent:"लक्ष्य एजेंट (स्थानीय)",createNewTarget:"नया एजेंट बनाएँ",resource:"संसाधन",type:"प्रकार",match:"मिलान",action:"कार्रवाई",new:"नया",updated:"अद्यतन",unchanged:"अपरिवर्तित",selected:"चयनित",mergeNow:"चयनित आयात करें",syncNow:"अभी सिंक करें",upgradeNow:"अभी अपग्रेड करें",importing:"एजेंट आयात हो रहा है...",contentIdentical:"सामग्री समान है",targetContent:"लक्ष्य",sourceContent:"स्रोत"},ekt={title:"सिंक",subtitle:"सिंक करें।",connection:"शुरुआती इंस्टेंस",sourceUrl:"शुरुआती ईडीआईआई URL",authToken:"टोकन प्रमाणीकरण",authHint:"वैकल्पिक (X-Source-Authorization)।",connect:"संपर्क जोड़ें",connected:"संपर्क हो गया",agentsFound:"मिले",connectionFailed:"कनेक्शन विफल",agentMapping:"मॅपिंग एजेंट",previewAll:"सभी पूर्वावलोकन",syncSelected:"चुना हुआ सिंक",remote:"रिमोट",createNew:"नया बनाएँ",changes:"बदलाव",agentsSelected:"चयनित एजेंट",totalResources:"संसाधन",syncSuccess:"सफलता",syncError:"सिंक त्रुटि",empty:"एक शुरुआत करें",autoMatched:"स्वतः मिलान",previewFirst:"सिंक से पहले बदलावों का पूर्वावलोकन करें"},tkt={actionCreate:"नया",actionUpdate:"अपडेट",actionSkip:"अद्यतित",actionConflict:"विवाद"},nkt={title:"उपयोगकर्ता वार्तालाप",subtitle:"इंटेंट → उपयोगकर्ता → वार्तालाप बाइंडिंग प्रबंधित करें",lookup:"खोज",intent:"इरादा",userId:"उपयोगकर्ता ID",agentId:"एजेंट ID",environment:"वातावरण",conversationId:"वार्तालाप ID",binding:"सक्रिय बाइंडिंग",enterBoth:"इंटेंट और उपयोगकर्ता ID दर्ज करें",notFound:"कोई बाइंडिंग नहीं मिली",create:"बाइंडिंग बनाएं",createTitle:"बाइंडिंग बनाएं",created:"बाइंडिंग बनाई गई",deleteTitle:"बाइंडिंग हटाएं",deleteDesc:'इंटेंट "{{intent}}" और उपयोगकर्ता "{{userId}}" के लिए बाइंडिंग हटाएं?',deleted:"बाइंडिंग हटा दी गई"},ikt={placeholder:"पेज, एजेंट, कार्यवाही खोजें…",noResults:"कोई परिणाम नहीं मिला।",recent:"हाल के",navigate:"नेविगेट करें",agents:"एजेंट",actions:"त्वरित कार्यवाही",createAgent:"नया एजेंट बनाएं",openChat:"चैट खोलें",kbdNavigate:"नेविगेट",kbdSelect:"चुनें",kbdClose:"बंद करें"},skt={title:"Group Setup Wizard",subtitle:"Assemble a team of AI advisors to discuss your questions",backToGroups:"Back to Groups",templateTitle:"Start from a template",templateDesc:"Choose a preset group configuration or start from scratch.",startBlank:"Start from Scratch",blankDesc:"Configure everything manually",configTitle:"Group Configuration",configDesc:"Name your group and choose how the agents will discuss",namePlaceholder:"e.g. Advisory Board",descPlaceholder:"What is this group for?",membersTitle:"Assemble Your Team",membersDesc:"For each seat, choose an existing agent or create a new one on the fly.",addMember:"Add Member",refreshAgents:"Refresh agent list",existingAgents:"existing agents",displayName:"Agent Name",displayNamePlaceholder:"Give this agent a name…",rolePlaceholder:"Role (e.g. Marketing, Engineering)",useExisting:"Use Existing",createNew:"Create New",selectAgent:"Select agent…",systemPrompt:"System Prompt",provider:"LLM Provider",model:"Model",apiKey:"API Key",apiKeyPlaceholder:"sk-…",createThisAgent:"Create Agent",creatingAgent:"Creating agent…",agentReady:"Agent created & deployed",agentCreated:'Agent "{{name}}" created',agentCreateFailed:"Failed to create agent: {{error}}",moderator:"Moderator",moderatorHint:"Synthesizes the discussion",addModerator:"Add Moderator",removeModerator:"Remove moderator",createModerator:"Create Moderator Agent",moderatorReady:"Moderator agent ready",moderatorCreated:"Moderator agent created",creatingModerator:"Creating moderator…",creatingSlot:"Creating {{name}}…",creatingGroup:"Creating group…",needMembers:"Add at least 2 members to proceed",reviewTitle:"Review & Create",reviewDesc:"Review your group configuration before creating.",reviewMembers:"Members",autoCreateNotice:"{{count}} agents will be auto-created when you click Create Group",autoCreateHint:"Each agent will be created and deployed automatically before the group is assembled.",unassignedWarning:"{{count}} members set to 'Use Existing' but no agent selected",unassignedHint:"These members will be skipped during discussions. Go back to assign agents.",flowPreview:"Discussion Flow",createGroup:"Create Group",created:"Group Created!",viewGroup:"Open Group",createAnother:"Create Another",success:"Group created successfully!"},rkt={advisoryBoard:"Advisory Board",advisoryBoardDesc:"A panel of expert advisors consulting on strategic decisions.",codeReview:"Code Review Panel",codeReviewDesc:"Structured code review with independent opinions, peer critique, and revision.",riskAssessment:"Risk Assessment",riskAssessmentDesc:"A panel with a devil's advocate who challenges assumptions.",forecasting:"Forecasting Panel",forecastingDesc:"Delphi-style anonymous deliberation for unbiased estimates.",proCon:"Pro/Con Debate",proConDesc:"Formal debate with pro and con teams arguing their positions.",roles:{marketingExpert:"Marketing Expert",techLead:"Tech Lead",financeDirector:"Finance Director",legalCounsel:"Legal Counsel",strategyConsultant:"Strategy Consultant",seniorEngineer:"Senior Engineer",architect:"Architect",securityReviewer:"Security Reviewer",riskAnalyst:"Risk Analyst",domainExpert:"Domain Expert",devilsAdvocate:"Devil's Advocate",analystA:"Analyst A",analystB:"Analyst B",analystC:"Analyst C",analystD:"Analyst D",proAdvocate1:"Pro Advocate 1",proAdvocate2:"Pro Advocate 2",conAdvocate1:"Con Advocate 1",conAdvocate2:"Con Advocate 2"}},okt={agentIdPlaceholder:"संदेश संभालने के लिए एजेंट ID",botToken:"बॉट टोकन",botTokenHint:"बॉट उपयोगकर्ता OAuth टोकन। सुरक्षा के लिए वॉल्ट संदर्भ का उपयोग करें।",botTokenPlaceholder:"xoxb-… या ${vault:slack-bot-token}",channel:"चैनल",channelId:"Slack चैनल ID",channelIdCol:"चैनल ID",channelIdHint:"Slack चैनल पर राइट-क्लिक करें → चैनल विवरण देखें → चैनल ID कॉपी करें",channelsPlural:"चैनल",channelType:"चैनल प्रकार",confirmDelete:"चैनल हटाएं?",confirmDeleteDesc:"यह चैनल एकीकरण स्थायी रूप से हटा दिया जाएगा।",create:"चैनल बनाएं",createTitle:"चैनल एकीकरण बनाएं",defaultAgentId:"डिफ़ॉल्ट एजेंट ID",defaultTargetHint:"डिफ़ॉल्ट लक्ष्य उन सभी संदेशों को संभालता है जो किसी ट्रिगर कीवर्ड से मेल नहीं खाते। निर्माण के बाद और लक्ष्य जोड़ सकते हैं।",empty:"अभी कोई चैनल नहीं",emptyDesc:"एजेंट को Slack से जोड़ने के लिए चैनल एकीकरण बनाएं।",name:"नाम",namePlaceholder:"उदा. Engineering AI Hub",openSlackApps:"Slack ऐप डैशबोर्ड खोलें",searchPlaceholder:"चैनल खोजें…",signingSecret:"साइनिंग सीक्रेट",signingSecretHint:"आपके Slack ऐप के मूलभूत जानकारी पृष्ठ से।",signingSecretPlaceholder:"हेक्स स्ट्रिंग या ${vault:slack-signing-secret}",slackSetupGuide:"Slack सेटअप गाइड",slackSetupSummary:"एक Slack ऐप बनाएं, बॉट टोकन स्कोप कॉन्फ़िगर करें (app_mentions:read, chat:write, im:history, channels:history, groups:history), फिर क्रेडेंशियल यहाँ पेस्ट करें।",target:"लक्ष्य",targets:"लक्ष्य",targetsCol:"लक्ष्य",type:"प्रकार",unnamed:"अनाम चैनल",version:"संस्करण"},akt={addTarget:"लक्ष्य जोड़ें",addTrigger:"ट्रिगर जोड़ें…",agentId:"एजेंट ID",botToken:"बॉट टोकन",channelId:"Slack चैनल ID",cooldown:"कूलडाउन (सेकंड)",general:"सामान्य",groupId:"समूह ID",isDefault:"डिफ़ॉल्ट",maxCost:"अधिकतम $/दिन",maxDaily:"अधिकतम/दिन",name:"नाम",observe:"निरीक्षण",observeDesc:"निष्क्रिय रूप से निगरानी करें और चुनिंदा जवाब दें",observeKeywords:"ट्रिगर कीवर्ड",observeMimeTypes:"ट्रिगर MIME प्रकार",observeMode:"निरीक्षण मोड",observeSettings:"निरीक्षण मोड सेटिंग्स",platformConfig:"प्लेटफ़ॉर्म कॉन्फ़िगरेशन",rawConfig:"कच्चा कॉन्फ़िगरेशन",removeTarget:"हटाएं",requiredEvents:"आवश्यक इवेंट सब्सक्रिप्शन:",requiredScopes:"आवश्यक बॉट टोकन स्कोप:",setDefault:"डिफ़ॉल्ट के रूप में सेट करें",signingSecret:"साइनिंग सीक्रेट",targetName:"नाम",targets:"संदेश रूटिंग लक्ष्य",targetType:"प्रकार",triggerHint:'उपयोगकर्ता "कीवर्ड: संदेश" टाइप करके इस लक्ष्य पर रूट करते हैं',triggerKeywords:"ट्रिगर कीवर्ड",triggers:"ट्रिगर",type:"चैनल प्रकार",webhookHint:"इस URL को अपने Slack ऐप के Event Subscriptions → Request URL फ़ील्ड में पेस्ट करें।",webhookUrl:"वेबहुक URL"},lkt={app:sSt,auth:rSt,nav:oSt,theme:aSt,language:lSt,pages:cSt,common:dSt,agents:uSt,agentDetail:hSt,wizard:gSt,setupWizard:fSt,packages:pSt,packageDetail:mSt,packageEditor:bSt,conversations:xSt,conversationDetail:vSt,chat:_St,resources:ySt,editor:wSt,rulesEditor:CSt,apiCallsEditor:SSt,llmEditor:kSt,outputEditor:NSt,propertySetterEditor:ESt,dictionaryEditor:LSt,coordinator:DSt,contentEditor:TSt,logs:ISt,secrets:ASt,audit:RSt,schedules:MSt,debugDrawer:PSt,costDashboard:OSt,memoryInspector:jSt,logViewer:FSt,promptViewer:BSt,promptPreview:HSt,studio:WSt,ragEditor:VSt,onboarding:zSt,platform:USt,stream:$St,createOrWizard:qSt,groups:KSt,memories:GSt,properties:YSt,triggers:QSt,capabilities:XSt,exportDialog:ZSt,importDialog:JSt,syncPage:ekt,sync:tkt,userConversations:nkt,commandPalette:ikt,groupWizard:skt,groupTemplates:rkt,channels:okt,channelDetail:akt},ckt=["ar","he","fa","ur"];function dkt(i){return ckt.includes(i.split("-")[0])}function cTe(i){const e=dkt(i)?"rtl":"ltr";document.documentElement.setAttribute("dir",e),document.documentElement.setAttribute("lang",i)}rl.use(lTe).use(F9e).init({resources:{en:{translation:hmt},de:{translation:bbt},fr:{translation:wxt},es:{translation:Evt},ar:{translation:A_t},zh:{translation:j0t},th:{translation:Vyt},ja:{translation:K1t},ko:{translation:Zwt},pt:{translation:iSt},hi:{translation:lkt}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"]}});cTe(rl.language);rl.on("languageChanged",cTe);const ukt="modulepreload",hkt=function(i){return"/"+i},_be={},Et=function(e,t,n){let s=Promise.resolve();if(t&&t.length>0){let o=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=o(t.map(c=>{if(c=hkt(c),c in _be)return;_be[c]=!0;const u=c.endsWith(".css"),h=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${h}`))return;const g=document.createElement("link");if(g.rel=u?"stylesheet":ukt,u||(g.as="script"),g.crossOrigin="",g.href=c,l&&g.setAttribute("nonce",l),document.head.appendChild(g),u)return new Promise((f,m)=>{g.addEventListener("load",f),g.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};function dTe(){return globalThis._VSCODE_NLS_MESSAGES}function cre(){return globalThis._VSCODE_NLS_LANGUAGE}const gkt=cre()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function Gj(i,e){let t;return e.length===0?t=i:t=i.replace(/\{(\d+)\}/g,(n,s)=>{const r=s[0],o=e[r];let a=n;return typeof o=="string"?a=o:(typeof o=="number"||typeof o=="boolean"||o===void 0||o===null)&&(a=String(o)),a}),gkt&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function S(i,e,...t){return Gj(typeof i=="number"?uTe(i,e):e,t)}function uTe(i,e){var n;const t=(n=dTe())==null?void 0:n[i];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${i} !!!`)}return t}function pe(i,e,...t){let n;typeof i=="number"?n=uTe(i,e):n=e;const s=Gj(n,t);return{value:s,original:e===n?s:Gj(e,t)}}function fkt(i,e){const t=i;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const hi=window,m9=class m9{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}getWindowId(e){return e.vscodeWindowId}};m9.INSTANCE=new m9;let tY=m9;function hTe(i,e,t){typeof e=="string"&&(e=i.matchMedia(e)),e.addEventListener("change",t)}function nY(i){return tY.INSTANCE.getZoomFactor(i)}const QL=navigator.userAgent,ic=QL.indexOf("Firefox")>=0,Y7=QL.indexOf("AppleWebKit")>=0,aP=QL.indexOf("Chrome")>=0,Pw=!aP&&QL.indexOf("Safari")>=0,gTe=!aP&&!Pw&&Y7;QL.indexOf("Electron/")>=0;const ybe=QL.indexOf("Android")>=0;let e$=!1;if(typeof hi.matchMedia=="function"){const i=hi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=hi.matchMedia("(display-mode: fullscreen)");e$=i.matches,hTe(hi,i,({matches:t})=>{e$&&e.matches||(e$=t)})}function dre(){return globalThis.MonacoEnvironment}class pkt{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?UE.isErrorNoTelemetry(e)?new UE(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 ure=new pkt;function Yj(i){ure.onUnexpectedError(i)}function Wt(i){Bd(i)||ure.onUnexpectedError(i)}function Lr(i){Bd(i)||ure.onUnexpectedExternalError(i)}function iY(i){if(i instanceof Error){const{name:e,message:t,cause:n}=i,s=i.stacktrace||i.stack;return{$isError:!0,name:e,message:t,stack:s,noTelemetry:UE.isErrorNoTelemetry(i),cause:n?iY(n):void 0,code:i.code}}return i}const Qj="Canceled";function Bd(i){return i instanceof ku?!0:i instanceof Error&&i.name===Qj&&i.message===Qj}class ku extends Error{constructor(){super(Qj),this.name=this.message}}function mkt(){const i=new Error(Qj);return i.name=i.message,i}function _u(i){return i?new Error(`Illegal argument: ${i}`):new Error("Illegal argument")}function Xj(i){return i?new Error(`Illegal state: ${i}`):new Error("Illegal state")}class bkt extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class UE extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof UE)return e;const t=new UE;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class St extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,St.prototype)}}function t$(i,e){if(!i)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function lP(i,e="Unreachable"){throw new Error(e)}function AA(i,e="unexpected state"){if(!i)throw typeof e=="string"?new St(`Assertion Failed: ${e}`):e}function wbe(i,e="Soft Assertion Failed"){i||Wt(new St(e))}function L_(i){if(!i()){debugger;i(),Wt(new St("Assertion Failed"))}}function cP(i,e){let t=0;for(;t"u"}function No(i){return!du(i)}function du(i){return Da(i)||i===null}function jn(i,e){if(!i)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function Cv(i){return AA(i!=null,"Argument is `undefined` or `null`."),i}function Ow(i){return typeof i=="function"}function _kt(i,e){const t=Math.min(i.length,e.length);for(let n=0;n=0,MA=Vh.indexOf("Macintosh")>=0,gre=(Vh.indexOf("Macintosh")>=0||Vh.indexOf("iPad")>=0||Vh.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Z2=Vh.indexOf("Linux")>=0,pTe=(Vh==null?void 0:Vh.indexOf("Mobi"))>=0,hre=!0,E4=cre()||jy,V5=navigator.language.toLowerCase(),Cbe=V5):console.error("Unable to resolve platform.");let L4=0;MA?L4=1:RA?L4=3:Z2&&(L4=2);const Vo=RA,fn=MA,sc=Z2,kg=fTe,yp=hre,kkt=hre&&typeof lb.importScripts=="function",Nkt=kkt?lb.origin:void 0,Nu=gre,mTe=pTe,n$=L4,ip=Vh,Ekt=E4,Lkt=typeof lb.postMessage=="function"&&!lb.importScripts,dP=(()=>{if(Lkt){const i=[];lb.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,s=i.length;n{const n=++e;i.push({id:n,callback:t}),lb.postMessage({vscodeScheduleAsyncWork:n},"*")}}return i=>setTimeout(i)})(),Dc=MA||gre?2:RA?1:3;let Sbe=!0,kbe=!1;function bTe(){if(!kbe){kbe=!0;const i=new Uint8Array(2);i[0]=1,i[1]=2,Sbe=new Uint16Array(i.buffer)[0]===513}return Sbe}const fre=!!(ip&&ip.indexOf("Chrome")>=0),Dkt=!!(ip&&ip.indexOf("Firefox")>=0),Tkt=!!(!fre&&ip&&ip.indexOf("Safari")>=0),xTe=!!(ip&&ip.indexOf("Edg/")>=0),Ikt=!!(ip&&ip.indexOf("Android")>=0),uP={clipboard:{writeText:kg||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:kg||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},pointerEvents:hi.PointerEvent&&("ontouchstart"in hi||navigator.maxTouchPoints>0)};class pre{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const D4=new pre,oY=new pre,aY=new pre,vTe=new Array(230),Akt=Object.create(null),Rkt=Object.create(null),mre=[];for(let i=0;i<=193;i++)mre[i]=-1;(function(){const e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN","",""],[1,1,"Hyper",0,"",0,"","",""],[1,2,"Super",0,"",0,"","",""],[1,3,"Fn",0,"",0,"","",""],[1,4,"FnLock",0,"",0,"","",""],[1,5,"Suspend",0,"",0,"","",""],[1,6,"Resume",0,"",0,"","",""],[1,7,"Turbo",0,"",0,"","",""],[1,8,"Sleep",0,"",0,"VK_SLEEP","",""],[1,9,"WakeUp",0,"",0,"","",""],[0,10,"KeyA",31,"A",65,"VK_A","",""],[0,11,"KeyB",32,"B",66,"VK_B","",""],[0,12,"KeyC",33,"C",67,"VK_C","",""],[0,13,"KeyD",34,"D",68,"VK_D","",""],[0,14,"KeyE",35,"E",69,"VK_E","",""],[0,15,"KeyF",36,"F",70,"VK_F","",""],[0,16,"KeyG",37,"G",71,"VK_G","",""],[0,17,"KeyH",38,"H",72,"VK_H","",""],[0,18,"KeyI",39,"I",73,"VK_I","",""],[0,19,"KeyJ",40,"J",74,"VK_J","",""],[0,20,"KeyK",41,"K",75,"VK_K","",""],[0,21,"KeyL",42,"L",76,"VK_L","",""],[0,22,"KeyM",43,"M",77,"VK_M","",""],[0,23,"KeyN",44,"N",78,"VK_N","",""],[0,24,"KeyO",45,"O",79,"VK_O","",""],[0,25,"KeyP",46,"P",80,"VK_P","",""],[0,26,"KeyQ",47,"Q",81,"VK_Q","",""],[0,27,"KeyR",48,"R",82,"VK_R","",""],[0,28,"KeyS",49,"S",83,"VK_S","",""],[0,29,"KeyT",50,"T",84,"VK_T","",""],[0,30,"KeyU",51,"U",85,"VK_U","",""],[0,31,"KeyV",52,"V",86,"VK_V","",""],[0,32,"KeyW",53,"W",87,"VK_W","",""],[0,33,"KeyX",54,"X",88,"VK_X","",""],[0,34,"KeyY",55,"Y",89,"VK_Y","",""],[0,35,"KeyZ",56,"Z",90,"VK_Z","",""],[0,36,"Digit1",22,"1",49,"VK_1","",""],[0,37,"Digit2",23,"2",50,"VK_2","",""],[0,38,"Digit3",24,"3",51,"VK_3","",""],[0,39,"Digit4",25,"4",52,"VK_4","",""],[0,40,"Digit5",26,"5",53,"VK_5","",""],[0,41,"Digit6",27,"6",54,"VK_6","",""],[0,42,"Digit7",28,"7",55,"VK_7","",""],[0,43,"Digit8",29,"8",56,"VK_8","",""],[0,44,"Digit9",30,"9",57,"VK_9","",""],[0,45,"Digit0",21,"0",48,"VK_0","",""],[1,46,"Enter",3,"Enter",13,"VK_RETURN","",""],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE","",""],[1,48,"Backspace",1,"Backspace",8,"VK_BACK","",""],[1,49,"Tab",2,"Tab",9,"VK_TAB","",""],[1,50,"Space",10,"Space",32,"VK_SPACE","",""],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,"",0,"","",""],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL","",""],[1,64,"F1",59,"F1",112,"VK_F1","",""],[1,65,"F2",60,"F2",113,"VK_F2","",""],[1,66,"F3",61,"F3",114,"VK_F3","",""],[1,67,"F4",62,"F4",115,"VK_F4","",""],[1,68,"F5",63,"F5",116,"VK_F5","",""],[1,69,"F6",64,"F6",117,"VK_F6","",""],[1,70,"F7",65,"F7",118,"VK_F7","",""],[1,71,"F8",66,"F8",119,"VK_F8","",""],[1,72,"F9",67,"F9",120,"VK_F9","",""],[1,73,"F10",68,"F10",121,"VK_F10","",""],[1,74,"F11",69,"F11",122,"VK_F11","",""],[1,75,"F12",70,"F12",123,"VK_F12","",""],[1,76,"PrintScreen",0,"",0,"","",""],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL","",""],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE","",""],[1,79,"Insert",19,"Insert",45,"VK_INSERT","",""],[1,80,"Home",14,"Home",36,"VK_HOME","",""],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR","",""],[1,82,"Delete",20,"Delete",46,"VK_DELETE","",""],[1,83,"End",13,"End",35,"VK_END","",""],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT","",""],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",""],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",""],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",""],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",""],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK","",""],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE","",""],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY","",""],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT","",""],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD","",""],[1,94,"NumpadEnter",3,"",0,"","",""],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1","",""],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2","",""],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3","",""],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4","",""],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5","",""],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6","",""],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7","",""],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8","",""],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9","",""],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0","",""],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL","",""],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102","",""],[1,107,"ContextMenu",58,"ContextMenu",93,"","",""],[1,108,"Power",0,"",0,"","",""],[1,109,"NumpadEqual",0,"",0,"","",""],[1,110,"F13",71,"F13",124,"VK_F13","",""],[1,111,"F14",72,"F14",125,"VK_F14","",""],[1,112,"F15",73,"F15",126,"VK_F15","",""],[1,113,"F16",74,"F16",127,"VK_F16","",""],[1,114,"F17",75,"F17",128,"VK_F17","",""],[1,115,"F18",76,"F18",129,"VK_F18","",""],[1,116,"F19",77,"F19",130,"VK_F19","",""],[1,117,"F20",78,"F20",131,"VK_F20","",""],[1,118,"F21",79,"F21",132,"VK_F21","",""],[1,119,"F22",80,"F22",133,"VK_F22","",""],[1,120,"F23",81,"F23",134,"VK_F23","",""],[1,121,"F24",82,"F24",135,"VK_F24","",""],[1,122,"Open",0,"",0,"","",""],[1,123,"Help",0,"",0,"","",""],[1,124,"Select",0,"",0,"","",""],[1,125,"Again",0,"",0,"","",""],[1,126,"Undo",0,"",0,"","",""],[1,127,"Cut",0,"",0,"","",""],[1,128,"Copy",0,"",0,"","",""],[1,129,"Paste",0,"",0,"","",""],[1,130,"Find",0,"",0,"","",""],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE","",""],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP","",""],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN","",""],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR","",""],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1","",""],[1,136,"KanaMode",0,"",0,"","",""],[0,137,"IntlYen",0,"",0,"","",""],[1,138,"Convert",0,"",0,"","",""],[1,139,"NonConvert",0,"",0,"","",""],[1,140,"Lang1",0,"",0,"","",""],[1,141,"Lang2",0,"",0,"","",""],[1,142,"Lang3",0,"",0,"","",""],[1,143,"Lang4",0,"",0,"","",""],[1,144,"Lang5",0,"",0,"","",""],[1,145,"Abort",0,"",0,"","",""],[1,146,"Props",0,"",0,"","",""],[1,147,"NumpadParenLeft",0,"",0,"","",""],[1,148,"NumpadParenRight",0,"",0,"","",""],[1,149,"NumpadBackspace",0,"",0,"","",""],[1,150,"NumpadMemoryStore",0,"",0,"","",""],[1,151,"NumpadMemoryRecall",0,"",0,"","",""],[1,152,"NumpadMemoryClear",0,"",0,"","",""],[1,153,"NumpadMemoryAdd",0,"",0,"","",""],[1,154,"NumpadMemorySubtract",0,"",0,"","",""],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR","",""],[1,156,"NumpadClearEntry",0,"",0,"","",""],[1,0,"",5,"Ctrl",17,"VK_CONTROL","",""],[1,0,"",4,"Shift",16,"VK_SHIFT","",""],[1,0,"",6,"Alt",18,"VK_MENU","",""],[1,0,"",57,"Meta",91,"VK_COMMAND","",""],[1,157,"ControlLeft",5,"",0,"VK_LCONTROL","",""],[1,158,"ShiftLeft",4,"",0,"VK_LSHIFT","",""],[1,159,"AltLeft",6,"",0,"VK_LMENU","",""],[1,160,"MetaLeft",57,"",0,"VK_LWIN","",""],[1,161,"ControlRight",5,"",0,"VK_RCONTROL","",""],[1,162,"ShiftRight",4,"",0,"VK_RSHIFT","",""],[1,163,"AltRight",6,"",0,"VK_RMENU","",""],[1,164,"MetaRight",57,"",0,"VK_RWIN","",""],[1,165,"BrightnessUp",0,"",0,"","",""],[1,166,"BrightnessDown",0,"",0,"","",""],[1,167,"MediaPlay",0,"",0,"","",""],[1,168,"MediaRecord",0,"",0,"","",""],[1,169,"MediaFastForward",0,"",0,"","",""],[1,170,"MediaRewind",0,"",0,"","",""],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK","",""],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK","",""],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP","",""],[1,174,"Eject",0,"",0,"","",""],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE","",""],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT","",""],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL","",""],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2","",""],[1,179,"LaunchApp1",0,"",0,"VK_MEDIA_LAUNCH_APP1","",""],[1,180,"SelectTask",0,"",0,"","",""],[1,181,"LaunchScreenSaver",0,"",0,"","",""],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH","",""],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME","",""],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK","",""],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD","",""],[1,186,"BrowserStop",0,"",0,"VK_BROWSER_STOP","",""],[1,187,"BrowserRefresh",0,"",0,"VK_BROWSER_REFRESH","",""],[1,188,"BrowserFavorites",0,"",0,"VK_BROWSER_FAVORITES","",""],[1,189,"ZoomToggle",0,"",0,"","",""],[1,190,"MailReply",0,"",0,"","",""],[1,191,"MailForward",0,"",0,"","",""],[1,192,"MailSend",0,"",0,"","",""],[1,0,"",114,"KeyInComposition",229,"","",""],[1,0,"",116,"ABNT_C2",194,"VK_ABNT_C2","",""],[1,0,"",96,"OEM_8",223,"VK_OEM_8","",""],[1,0,"",0,"",0,"VK_KANA","",""],[1,0,"",0,"",0,"VK_HANGUL","",""],[1,0,"",0,"",0,"VK_JUNJA","",""],[1,0,"",0,"",0,"VK_FINAL","",""],[1,0,"",0,"",0,"VK_HANJA","",""],[1,0,"",0,"",0,"VK_KANJI","",""],[1,0,"",0,"",0,"VK_CONVERT","",""],[1,0,"",0,"",0,"VK_NONCONVERT","",""],[1,0,"",0,"",0,"VK_ACCEPT","",""],[1,0,"",0,"",0,"VK_MODECHANGE","",""],[1,0,"",0,"",0,"VK_SELECT","",""],[1,0,"",0,"",0,"VK_PRINT","",""],[1,0,"",0,"",0,"VK_EXECUTE","",""],[1,0,"",0,"",0,"VK_SNAPSHOT","",""],[1,0,"",0,"",0,"VK_HELP","",""],[1,0,"",0,"",0,"VK_APPS","",""],[1,0,"",0,"",0,"VK_PROCESSKEY","",""],[1,0,"",0,"",0,"VK_PACKET","",""],[1,0,"",0,"",0,"VK_DBE_SBCSCHAR","",""],[1,0,"",0,"",0,"VK_DBE_DBCSCHAR","",""],[1,0,"",0,"",0,"VK_ATTN","",""],[1,0,"",0,"",0,"VK_CRSEL","",""],[1,0,"",0,"",0,"VK_EXSEL","",""],[1,0,"",0,"",0,"VK_EREOF","",""],[1,0,"",0,"",0,"VK_PLAY","",""],[1,0,"",0,"",0,"VK_ZOOM","",""],[1,0,"",0,"",0,"VK_NONAME","",""],[1,0,"",0,"",0,"VK_PA1","",""],[1,0,"",0,"",0,"VK_OEM_CLEAR","",""]],t=[],n=[];for(const s of e){const[r,o,a,l,c,u,h,g,f]=s;if(n[o]||(n[o]=!0,Akt[a]=o,Rkt[a.toLowerCase()]=o,r&&(mre[o]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);D4.define(l,c),oY.define(l,g||c),aY.define(l,f||g||c)}u&&(vTe[u]=l)}})();var Fm;(function(i){function e(a){return D4.keyCodeToStr(a)}i.toString=e;function t(a){return D4.strToKeyCode(a)}i.fromString=t;function n(a){return oY.keyCodeToStr(a)}i.toUserSettingsUS=n;function s(a){return aY.keyCodeToStr(a)}i.toUserSettingsGeneral=s;function r(a){return oY.strToKeyCode(a)||aY.strToKeyCode(a)}i.fromUserSettings=r;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return D4.keyCodeToStr(a)}i.toElectronAccelerator=o})(Fm||(Fm={}));function Dr(i,e){const t=(e&65535)<<16>>>0;return(i|t)>>>0}function lY(i,e){if(typeof i=="number"){if(i===0)return null;const t=(i&65535)>>>0,n=(i&4294901760)>>>16;return n!==0?new i$([z5(t,e),z5(n,e)]):new i$([z5(t,e)])}else{const t=[];for(let n=0;n=0;I--)yield T[I]}i.reverse=a;function l(T){return!T||T[Symbol.iterator]().next().done===!0}i.isEmpty=l;function c(T){return T[Symbol.iterator]().next().value}i.first=c;function u(T,I){let R=0;for(const P of T)if(I(P,R++))return!0;return!1}i.some=u;function h(T,I){let R=0;for(const P of T)if(!I(P,R++))return!1;return!0}i.every=h;function g(T,I){for(const R of T)if(I(R))return R}i.find=g;function*f(T,I){for(const R of T)I(R)&&(yield R)}i.filter=f;function*m(T,I){let R=0;for(const P of T)yield I(P,R++)}i.map=m;function*x(T,I){let R=0;for(const P of T)yield*I(P,R++)}i.flatMap=x;function*v(...T){for(const I of T)sY(I)?yield*I:yield I}i.concat=v;function _(T,I,R){let P=R;for(const j of T)P=I(P,j);return P}i.reduce=_;function w(T){let I=0;for(const R of T)I++;return I}i.length=w;function*k(T,I,R=T.length){for(I<-T.length&&(I=0),I<0&&(I+=T.length),R<0?R+=T.length:R>T.length&&(R=T.length);I1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function vh(...i){return ut(()=>ti(i))}class zkt{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 ut(i){return new zkt(i)}var L1;let ve=(L1=class{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{ti(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===re.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?L1.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()}}},L1.DISABLE_DISPOSED_WARNING=!1,L1);var pE;let re=(pE=class{constructor(){this._store=new ve,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)}},pE.None=Object.freeze({dispose(){}}),pE);class Qn{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 Ukt{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class $kt{constructor(e){this.object=e}dispose(){}}class Q7{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{ti(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,n=!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),n||(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 Jm;let so=(Jm=class{constructor(e){this.element=e,this.next=Jm.Undefined,this.prev=Jm.Undefined}},Jm.Undefined=new Jm(void 0),Jm);class Za{constructor(){this._first=so.Undefined,this._last=so.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===so.Undefined}clear(){let e=this._first;for(;e!==so.Undefined;){const t=e.next;e.prev=so.Undefined,e.next=so.Undefined,e=t}this._first=so.Undefined,this._last=so.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const n=new so(e);if(this._first===so.Undefined)this._first=n,this._last=n;else if(t){const r=this._last;this._last=n,n.prev=r,r.next=n}else{const r=this._first;this._first=n,n.next=r,r.prev=n}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(n))}}shift(){if(this._first!==so.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==so.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==so.Undefined&&e.next!==so.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===so.Undefined&&e.next===so.Undefined?(this._first=so.Undefined,this._last=so.Undefined):e.next===so.Undefined?(this._last=this._last.prev,this._last.next=so.Undefined):e.prev===so.Undefined&&(this._first=this._first.next,this._first.prev=so.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==so.Undefined;)yield e.element,e=e.next}}const qkt=globalThis.performance.now.bind(globalThis.performance);class po{static create(e){return new po(e)}constructor(e){this._now=e===!1?Date.now:qkt,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 je;(function(i){i.None=()=>re.None;function e(B,U){return g(B,()=>{},0,void 0,!0,void 0,U)}i.defer=e;function t(B){return(U,$=null,K)=>{let z=!1,G;return G=B(ne=>{if(!z)return G?G.dispose():z=!0,U.call($,ne)},null,K),z&&G.dispose(),G}}i.once=t;function n(B,U){return i.once(i.filter(B,U))}i.onceIf=n;function s(B,U,$){return u((K,z=null,G)=>B(ne=>K.call(z,U(ne)),null,G),$)}i.map=s;function r(B,U,$){return u((K,z=null,G)=>B(ne=>{U(ne),K.call(z,ne)},null,G),$)}i.forEach=r;function o(B,U,$){return u((K,z=null,G)=>B(ne=>U(ne)&&K.call(z,ne),null,G),$)}i.filter=o;function a(B){return B}i.signal=a;function l(...B){return(U,$=null,K)=>{const z=vh(...B.map(G=>G(ne=>U.call($,ne))));return h(z,K)}}i.any=l;function c(B,U,$,K){let z=$;return s(B,G=>(z=U(z,G),z),K)}i.reduce=c;function u(B,U){let $;const K={onWillAddFirstListener(){$=B(z.fire,z)},onDidRemoveLastListener(){$==null||$.dispose()}},z=new se(K);return U==null||U.add(z),z.event}function h(B,U){return U instanceof Array?U.push(B):U&&U.add(B),B}function g(B,U,$=100,K=!1,z=!1,G,ne){let te,H,Q,Y=0,V;const ue={leakWarningThreshold:G,onWillAddFirstListener(){te=B(Te=>{Y++,H=U(H,Te),K&&!Q&&(he.fire(H),H=void 0),V=()=>{const nt=H;H=void 0,Q=void 0,(!K||Y>1)&&he.fire(nt),Y=0},typeof $=="number"?(Q&&clearTimeout(Q),Q=setTimeout(V,$)):Q===void 0&&(Q=null,queueMicrotask(V))})},onWillRemoveListener(){z&&Y>0&&(V==null||V())},onDidRemoveLastListener(){V=void 0,te.dispose()}},he=new se(ue);return ne==null||ne.add(he),he.event}i.debounce=g;function f(B,U=0,$){return i.debounce(B,(K,z)=>K?(K.push(z),K):[z],U,void 0,!0,void 0,$)}i.accumulate=f;function m(B,U=(K,z)=>K===z,$){let K=!0,z;return o(B,G=>{const ne=K||!U(G,z);return K=!1,z=G,ne},$)}i.latch=m;function x(B,U,$){return[i.filter(B,U,$),i.filter(B,K=>!U(K),$)]}i.split=x;function v(B,U=!1,$=[],K){let z=$.slice(),G=B(H=>{z?z.push(H):te.fire(H)});K&&K.add(G);const ne=()=>{z==null||z.forEach(H=>te.fire(H)),z=null},te=new se({onWillAddFirstListener(){G||(G=B(H=>te.fire(H)),K&&K.add(G))},onDidAddFirstListener(){z&&(U?setTimeout(ne):ne())},onDidRemoveLastListener(){G&&G.dispose(),G=null}});return K&&K.add(te),te.event}i.buffer=v;function _(B,U){return(K,z,G)=>{const ne=U(new k);return B(function(te){const H=ne.evaluate(te);H!==w&&K.call(z,H)},void 0,G)}}i.chain=_;const w=Symbol("HaltChainable");class k{constructor(){this.steps=[]}map(U){return this.steps.push(U),this}forEach(U){return this.steps.push($=>(U($),$)),this}filter(U){return this.steps.push($=>U($)?$:w),this}reduce(U,$){let K=$;return this.steps.push(z=>(K=U(K,z),K)),this}latch(U=($,K)=>$===K){let $=!0,K;return this.steps.push(z=>{const G=$||!U(z,K);return $=!1,K=z,G?z:w}),this}evaluate(U){for(const $ of this.steps)if(U=$(U),U===w)break;return U}}function C(B,U,$=K=>K){const K=(...te)=>ne.fire($(...te)),z=()=>B.on(U,K),G=()=>B.removeListener(U,K),ne=new se({onWillAddFirstListener:z,onDidRemoveLastListener:G});return ne.event}i.fromNodeEventEmitter=C;function E(B,U,$=K=>K){const K=(...te)=>ne.fire($(...te)),z=()=>B.addEventListener(U,K),G=()=>B.removeEventListener(U,K),ne=new se({onWillAddFirstListener:z,onDidRemoveLastListener:G});return ne.event}i.fromDOMEventEmitter=E;function D(B,U){let $;const K=new Promise((z,G)=>{const ne=t(B)(z,null,U);$=()=>ne.dispose()});return K.cancel=$,K}i.toPromise=D;function T(B,U){return B($=>U.fire($))}i.forward=T;function I(B,U,$){return U($),B(K=>U(K))}i.runAndSubscribe=I;class R{constructor(U,$){this._observable=U,this._counter=0,this._hasChanged=!1;const K={onWillAddFirstListener:()=>{U.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{U.removeObserver(this)}};this.emitter=new se(K),$&&$.add(this.emitter)}beginUpdate(U){this._counter++}handlePossibleChange(U){}handleChange(U,$){this._hasChanged=!0}endUpdate(U){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(B,U){return new R(B,U).emitter.event}i.fromObservable=P;function j(B){return(U,$,K)=>{let z=0,G=!1;const ne={beginUpdate(){z++},endUpdate(){z--,z===0&&(B.reportChanges(),G&&(G=!1,U.call($)))},handlePossibleChange(){},handleChange(){G=!0}};B.addObserver(ne),B.reportChanges();const te={dispose(){B.removeObserver(ne)}};return K instanceof ve?K.add(te):Array.isArray(K)&&K.push(te),te}}i.fromObservableLight=j})(je||(je={}));const Zk=class Zk{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${Zk._idPool++}`,Zk.all.add(this)}start(e){this._stopWatch=new po,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}}};Zk.all=new Set,Zk._idPool=0;let cY=Zk,Kkt=-1;const b9=class b9{constructor(e,t,n=(b9._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=n,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,t){const n=this.threshold;if(n<=0||t{const r=this._stacks.get(e.value)||0;this._stacks.set(e.value,r-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[n,s]of this._stacks)(!e||t{var a,l,c,u,h,g,f;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);const x=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],v=new Ykt(`${m}. HINT: Stack shows most frequent listener (${x[1]}-times)`,x[0]);return(((a=this._options)==null?void 0:a.onListenerError)||Wt)(v),re.None}if(this._disposed)return re.None;t&&(e=e.bind(t));const s=new s$(e);let r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=bre.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof s$?(this._deliveryQueue??(this._deliveryQueue=new _Te),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=(u=this._options)==null?void 0:u.onDidAddFirstListener)==null||h.call(u,this)),(f=(g=this._options)==null?void 0:g.onDidAddListener)==null||f.call(g,this),this._size++;const o=ut(()=>{r==null||r(),this._removeListener(s)});return n instanceof ve?n.add(o):Array.isArray(n)&&n.push(o),o}),this._event}_removeListener(e){var r,o,a,l;if((o=(r=this._options)==null?void 0:r.onWillRemoveListener)==null||o.call(r,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,n=t.indexOf(e);if(n===-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[n]=void 0;const s=this._deliveryQueue.current===this;if(this._size*Qkt<=t.length){let c=0;for(let u=0;u0}};const Xkt=()=>new _Te;class _Te{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Bw extends se{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Za,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 yTe extends Bw{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 Zkt extends se{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 Jkt{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new se({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),ut(Fw(()=>{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 hP{constructor(){this.data=[]}wrapEvent(e,t,n){return(s,r,o)=>e(a=>{const l=this.data[this.data.length-1];if(!t){l?l.buffers.push(()=>s.call(r,a)):s.call(r,a);return}const c=l;if(!c){s.call(r,t(n,a));return}c.items??(c.items=[]),c.items.push(a),c.buffers.length===0&&l.buffers.push(()=>{c.reducedResult??(c.reducedResult=n?c.items.reduce(t,n):c.items.reduce(t)),s.call(r,c.reducedResult)})},void 0,o)}bufferEvents(e){const t={buffers:new Array};this.data.push(t);const n=e();return this.data.pop(),t.buffers.forEach(s=>s()),n}}class IT{constructor(){this.listening=!1,this.inputEvent=je.None,this.inputEventListener=re.None,this.emitter=new se({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 wTe=Object.freeze(function(i,e){const t=setTimeout(i.bind(e),0);return{dispose(){clearTimeout(t)}}});var gn;(function(i){function e(t){return t===i.None||t===i.Cancelled||t instanceof T4?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}i.isCancellationToken=e,i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:je.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:wTe})})(gn||(gn={}));class T4{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?wTe:(this._emitter||(this._emitter=new se),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let gs=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new T4),this._token}cancel(){this._token?this._token instanceof T4&&this._token.cancel():this._token=gn.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)==null||t.dispose(),this._token?this._token instanceof T4&&this._token.dispose():this._token=gn.None}};function uY(i){const e=new gs;return i.add({dispose(){e.cancel()}}),e.token}const CTe=Symbol("MicrotaskDelay");function hY(i){return!!i&&typeof i.then=="function"}function Jr(i){const e=new gs,t=i(e.token);let n=!1;const s=new Promise((r,o)=>{const a=e.token.onCancellationRequested(()=>{n=!0,a.dispose(),o(new ku)});Promise.resolve(t).then(l=>{a.dispose(),e.dispose(),n?NC(l)&&l.dispose():r(l)},l=>{a.dispose(),e.dispose(),o(l)})});return new class{cancel(){e.cancel(),e.dispose()}then(r,o){return s.then(r,o)}catch(r){return this.then(void 0,r)}finally(r){return s.finally(r)}}}function $E(i,e,t){return new Promise((n,s)=>{const r=e.onCancellationRequested(()=>{r.dispose(),n(t)});i.then(n,s).finally(()=>r.dispose())})}function eNt(i,e){return new Promise((t,n)=>{const s=e.onCancellationRequested(()=>{s.dispose(),n(new ku)});i.then(t,n).finally(()=>s.dispose())})}let tNt=class{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new gs}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;const n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n};this.queuedPromise=new Promise(n=>{this.activePromise.then(t,t).then(n)})}return new Promise((t,n)=>{this.queuedPromise.then(t,n)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((t,n)=>{this.activePromise.then(s=>{this.activePromise=null,t(s)},s=>{this.activePromise=null,n(s)})})}dispose(){this.cancellationTokenSource.cancel()}};const nNt=(i,e)=>{let t=!0;const n=setTimeout(()=>{t=!1,e()},i);return{isTriggered:()=>t,dispose:()=>{clearTimeout(n),t=!1}}},iNt=i=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,i())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class Eu{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((s,r)=>{this.doResolve=s,this.doReject=r}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const s=this.task;return this.task=null,s()}}));const n=()=>{var s;this.deferred=null,(s=this.doResolve)==null||s.call(this,null)};return this.deferred=t===CTe?iNt(n):nNt(t,n),this.completionPromise}isTriggered(){var e;return!!((e=this.deferred)!=null&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)==null||e.call(this,new ku),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)==null||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class STe{constructor(e){this.delayer=new Eu(e),this.throttler=new tNt}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function sp(i,e){return e?new Promise((t,n)=>{const s=setTimeout(()=>{r.dispose(),t()},i),r=e.onCancellationRequested(()=>{clearTimeout(s),r.dispose(),n(new ku)})}):Jr(t=>sp(i,t))}function Sb(i,e=0,t){const n=setTimeout(()=>{i(),t&&s.dispose()},e),s=ut(()=>{clearTimeout(n),t==null||t.delete(s)});return t==null||t.add(s),s}function xre(i,e=n=>!!n,t=null){let n=0;const s=i.length,r=()=>{if(n>=s)return Promise.resolve(t);const o=i[n++];return Promise.resolve(o()).then(l=>e(l)?Promise.resolve(l):r())};return r()}let sNt=class{constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){const t=new EC;return this._pendingTasks.push({task:e,deferred:t,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),t.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;const e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new St;this._runningTask=e.task;try{const t=await e.task();e.deferred.complete(t)}catch(t){e.deferred.error(t)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){const e=this._pendingTasks;this._pendingTasks=[];for(const t of e)t.setUndefinedWhenCleared?t.deferred.complete(void 0):t.deferred.error(new ku)}};class jc{constructor(e,t){this._isDisposed=!1,this._token=void 0,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,t){if(this._isDisposed)throw new St("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new St("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},t))}}class vre{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new St("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const s=n.setInterval(()=>{e()},t);this.disposable=ut(()=>{n.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}}class gi{constructor(e,t){this.timeoutToken=void 0,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)==null||e.call(this)}}let _re,J2;(function(){const i=globalThis;typeof i.requestIdleCallback!="function"||typeof i.cancelIdleCallback!="function"?J2=(e,t,n)=>{dP(()=>{if(s)return;const r=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,r-Date.now())}}))});let s=!1;return{dispose(){s||(s=!0)}}}:J2=(e,t,n)=>{const s=e.requestIdleCallback(t,typeof n=="number"?{timeout:n}:void 0);let r=!1;return{dispose(){r||(r=!0,e.cancelIdleCallback(s))}}},_re=(e,t)=>J2(globalThis,e,t)})();class kTe{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=J2(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class rNt extends kTe{constructor(e){super(globalThis,e)}}class EC{get isRejected(){var e;return((e=this.outcome)==null?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new ku)}}var PA;(function(i){async function e(n){let s;const r=await Promise.all(n.map(o=>o.then(a=>a,a=>{s||(s=a)})));if(typeof s<"u")throw s;return r}i.settled=e;function t(n){return new Promise(async(s,r)=>{try{await n(s,r)}catch(o){r(o)}})}i.withAsyncBody=t})(PA||(PA={}));function oNt(i){const e=new gs,t=i(e.token);return new lNt(e,async n=>{const s=e.token.onCancellationRequested(()=>{s.dispose(),e.dispose(),n.reject(new ku)});try{for await(const r of t){if(e.token.isCancellationRequested)return;n.emitOne(r)}s.dispose(),e.dispose()}catch(r){s.dispose(),e.dispose(),n.reject(r)}})}class aNt{constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){const t=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(t,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(const t of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(t,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new St("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,t){t.ok?e.complete(t.value):e.error(t.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){const e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{const e=new EC;return this._unsatisfiedConsumers.push(e),e.p}}}const ad=class ad{constructor(e,t){this._onReturn=t,this._producerConsumer=new aNt,this._iterator={next:()=>this._producerConsumer.consume(),return:()=>{var n;return(n=this._onReturn)==null||n.call(this),Promise.resolve({done:!0,value:void 0})},throw:async n=>(this._finishError(n),{done:!0,value:void 0})},queueMicrotask(async()=>{const n=e({emitOne:s=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:s}}),emitMany:s=>{for(const r of s)this._producerConsumer.produce({ok:!0,value:{done:!1,value:r}})},reject:s=>this._finishError(s)});if(!this._producerConsumer.hasFinalValue)try{await n,this._finishOk()}catch(s){this._finishError(s)}})}static fromArray(e){return new ad(t=>{t.emitMany(e)})}static fromPromise(e){return new ad(async t=>{t.emitMany(await e)})}static fromPromisesResolveOrder(e){return new ad(async t=>{await Promise.all(e.map(async n=>t.emitOne(await n)))})}static merge(e){return new ad(async t=>{await Promise.all(e.map(async n=>{for await(const s of n)t.emitOne(s)}))})}static map(e,t){return new ad(async n=>{for await(const s of e)n.emitOne(t(s))})}map(e){return ad.map(this,e)}static coalesce(e){return ad.filter(e,t=>!!t)}coalesce(){return ad.coalesce(this)}static filter(e,t){return new ad(async n=>{for await(const s of e)t(s)&&n.emitOne(s)})}filter(e){return ad.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};ad.EMPTY=ad.fromArray([]);let yu=ad;class lNt extends yu{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function NTe(i){return i}class cNt{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=NTe):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}}class gY{get cachedValues(){return this._map}constructor(e,t){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=NTe):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);if(this._map2.has(t))return this._map2.get(t);const n=this._fn(e);return this._map.set(e,n),this._map2.set(t,n),n}}var ay;(function(i){i[i.Uninitialized=0]="Uninitialized",i[i.Running=1]="Running",i[i.Completed=2]="Completed"})(ay||(ay={}));class la{constructor(e){this.executor=e,this._state=ay.Uninitialized}get value(){if(this._state===ay.Uninitialized){this._state=ay.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=ay.Completed}}else if(this._state===ay.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}function ETe(i){return!i||typeof i!="string"?!0:i.trim().length===0}const dNt=/{(\d+)}/g;function Hw(i,...e){return e.length===0?i:i.replace(dNt,function(t,n){const s=parseInt(n,10);return isNaN(s)||s<0||s>=e.length?t:e[s]})}function uNt(i){return i.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}function _h(i){return i.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function Fc(i){return i.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function hNt(i,e=" "){const t=gP(i,e);return LTe(t,e)}function gP(i,e){if(!i||!e)return i;const t=e.length;if(t===0||i.length===0)return i;let n=0;for(;i.indexOf(e,n)===n;)n=n+t;return i.substring(n)}function LTe(i,e){if(!i||!e)return i;const t=e.length,n=i.length;if(t===0||n===0)return i;let s=n,r=-1;for(;r=i.lastIndexOf(e,s-1),!(r===-1||r+t!==s);){if(r===0)return"";s=r}return i.substring(0,s)}function gNt(i){return i.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function DTe(i,e,t={}){if(!i)throw new Error("Cannot create regex from empty string");e||(i=Fc(i)),t.wholeWord&&(/\B/.test(i.charAt(0))||(i="\\b"+i),/\B/.test(i.charAt(i.length-1))||(i=i+"\\b"));let n="";return t.global&&(n+="g"),t.matchCase||(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),new RegExp(i,n)}function TTe(i){return i.source==="^"||i.source==="^$"||i.source==="$"||i.source==="^\\s*$"?!1:!!(i.exec("")&&i.lastIndex===0)}function Bc(i){return i.split(/\r\n|\r|\n/)}function el(i){for(let e=0,t=i.length;e=0;t--){const n=i.charCodeAt(t);if(n!==32&&n!==9)return t}return-1}function OA(i,e){return ie?1:0}function yre(i,e,t=0,n=i.length,s=0,r=e.length){for(;tc)return 1}const o=n-t,a=r-s;return oa?1:0}function fY(i,e){return XL(i,e,0,i.length,0,e.length)}function XL(i,e,t=0,n=i.length,s=0,r=e.length){for(;t=128||c>=128)return yre(i.toLowerCase(),e.toLowerCase(),t,n,s,r);Sv(l)&&(l-=32),Sv(c)&&(c-=32);const u=l-c;if(u!==0)return u}const o=n-t,a=r-s;return oa?1:0}function U5(i){return i>=48&&i<=57}function Sv(i){return i>=97&&i<=122}function Cf(i){return i>=65&&i<=90}function Fy(i,e){return i.length===e.length&&XL(i,e)===0}function wre(i,e){const t=e.length;return t<=i.length&&XL(i,e,0,t)===0}function fNt(i,e){const t=i.length,n=t-e.length;return n>=0&&XL(i,e,n,t)===0}function Nh(i,e){const t=Math.min(i.length,e.length);let n;for(n=0;n1){const n=i.charCodeAt(e-2);if(Yr(n))return Cre(n,t)}return t}class Sre{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=pNt(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=Zj(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class Jj{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new Sre(e,t)}nextGraphemeLength(){const e=eF.getInstance(),t=this._iterator,n=t.offset;let s=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const r=t.offset,o=e.getGraphemeBreakType(t.nextCodePoint());if(Ebe(s,o)){t.setOffset(r);break}s=o}return t.offset-n}prevGraphemeLength(){const e=eF.getInstance(),t=this._iterator,n=t.offset;let s=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const r=t.offset,o=e.getGraphemeBreakType(t.prevCodePoint());if(Ebe(o,s)){t.setOffset(r);break}s=o}return n-t.offset}eol(){return this._iterator.eol()}}function kre(i,e){return new Jj(i,e).nextGraphemeLength()}function ITe(i,e){return new Jj(i,e).prevGraphemeLength()}function mNt(i,e){e>0&&D_(i.charCodeAt(e))&&e--;const t=e+kre(i,e);return[t-ITe(i,t),t]}let r$;function bNt(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function qE(i){return r$||(r$=bNt()),r$.test(i)}const xNt=/^[\t\n\r\x20-\x7E]*$/;function fP(i){return xNt.test(i)}const ATe=/[\u2028\u2029]/;function RTe(i){return ATe.test(i)}function Nb(i){return i>=11904&&i<=55215||i>=63744&&i<=64255||i>=65281&&i<=65374}function Nre(i){return i>=127462&&i<=127487||i===8986||i===8987||i===9200||i===9203||i>=9728&&i<=10175||i===11088||i===11093||i>=127744&&i<=128591||i>=128640&&i<=128764||i>=128992&&i<=129008||i>=129280&&i<=129535||i>=129648&&i<=129782}const vNt="\uFEFF";function Ere(i){return!!(i&&i.length>0&&i.charCodeAt(0)===65279)}function _Nt(i,e=!1){return i?(e&&(i=i.replace(/\\./g,"")),i.toLowerCase()!==i):!1}function MTe(i){return i=i%52,i<26?String.fromCharCode(97+i):String.fromCharCode(65+i-26)}function Ebe(i,e){return i===0?e!==5&&e!==7:i===2&&e===3?!1:i===4||i===2||i===3||e===4||e===2||e===3?!0:!(i===8&&(e===8||e===9||e===11||e===12)||(i===11||i===9)&&(e===9||e===10)||(i===12||i===10)&&e===10||e===5||e===13||e===7||i===1||i===13&&e===14||i===6&&e===6)}const Sy=class Sy{static getInstance(){return Sy._INSTANCE||(Sy._INSTANCE=new Sy),Sy._INSTANCE}constructor(){this._data=yNt()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let s=1;for(;s<=n;)if(et[3*s+1])s=2*s+1;else return t[3*s+2];return 0}};Sy._INSTANCE=null;let eF=Sy;function yNt(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function wNt(i,e){if(i===0)return 0;const t=CNt(i,e);if(t!==void 0)return t;const n=new Sre(e,i);return n.prevCodePoint(),n.offset}function CNt(i,e){const t=new Sre(e,i);let n=t.prevCodePoint();for(;SNt(n)||n===65039||n===8419;){if(t.offset===0)return;n=t.prevCodePoint()}if(!Nre(n))return;let s=t.offset;return s>0&&t.prevCodePoint()===8205&&(s=t.offset),s}function SNt(i){return 127995<=i&&i<=127999}const PTe=" ",cf=class cf{static getInstance(e){return cf.cache.get(Array.from(e))}static getLocales(){return cf._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}};cf.ambiguousCharacterData=new la(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}')),cf.cache=new cNt({getCacheKey:JSON.stringify},e=>{function t(u){const h=new Map;for(let g=0;g!u.startsWith("_")&&Object.hasOwn(r,u));o.length===0&&(o=["_default"]);let a;for(const u of o){const h=t(r[u]);a=s(a,h)}const l=t(r._common),c=n(l,a);return new cf(c)}),cf._locales=new la(()=>Object.keys(cf.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")));let jA=cf;const Jk=class Jk{static getRawData(){return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}')}static getData(){return this._data||(this._data=new Set([...Object.values(Jk.getRawData())].flat())),this._data}static isInvisibleCharacter(e){return Jk.getData().has(e)}static get codePoints(){return Jk.getData()}};Jk._data=void 0;let u1=Jk;var Lbe={};let vN;const o$=globalThis.vscode;var LCe;if(typeof o$<"u"&&typeof o$.process<"u"){const i=o$.process;vN={get platform(){return i.platform},get arch(){return i.arch},get env(){return i.env},cwd(){return i.cwd()}}}else typeof process<"u"&&typeof((LCe=process==null?void 0:process.versions)==null?void 0:LCe.node)=="string"?vN={get platform(){return process.platform},get arch(){return process.arch},get env(){return Lbe},cwd(){return Lbe.VSCODE_CWD||process.cwd()}}:vN={get platform(){return Vo?"win32":fn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const tF=vN.cwd,nF=vN.env,kNt=vN.platform,NNt=65,ENt=97,LNt=90,DNt=122,h1=46,Wa=47,sd=92,Qp=58,TNt=63;class OTe extends Error{constructor(e,t,n){let s;typeof t=="string"&&t.indexOf("not ")===0?(s="must not be",t=t.replace(/^not /,"")):s="must be";const r=e.indexOf(".")!==-1?"property":"argument";let o=`The "${e}" ${r} ${s} of type ${t}`;o+=`. Received type ${typeof n}`,super(o),this.code="ERR_INVALID_ARG_TYPE"}}function INt(i,e){if(i===null||typeof i!="object")throw new OTe(e,"Object",i)}function So(i,e){if(typeof i!="string")throw new OTe(e,"string",i)}const i0=kNt==="win32";function di(i){return i===Wa||i===sd}function pY(i){return i===Wa}function Xp(i){return i>=NNt&&i<=LNt||i>=ENt&&i<=DNt}function iF(i,e,t,n){let s="",r=0,o=-1,a=0,l=0;for(let c=0;c<=i.length;++c){if(c2){const u=s.lastIndexOf(t);u===-1?(s="",r=0):(s=s.slice(0,u),r=s.length-1-s.lastIndexOf(t)),o=c,a=0;continue}else if(s.length!==0){s="",r=0,o=c,a=0;continue}}e&&(s+=s.length>0?`${t}..`:"..",r=2)}else s.length>0?s+=`${t}${i.slice(o+1,c)}`:s=i.slice(o+1,c),r=c-o-1;o=c,a=0}else l===h1&&a!==-1?++a:a=-1}return s}function ANt(i){return i?`${i[0]==="."?"":"."}${i}`:""}function jTe(i,e){INt(e,"pathObject");const t=e.dir||e.root,n=e.base||`${e.name||""}${ANt(e.ext)}`;return t?t===e.root?`${t}${n}`:`${t}${i}${n}`:n}const Tc={resolve(...i){let e="",t="",n=!1;for(let s=i.length-1;s>=-1;s--){let r;if(s>=0){if(r=i[s],So(r,`paths[${s}]`),r.length===0)continue}else e.length===0?r=tF():(r=nF[`=${e}`]||tF(),(r===void 0||r.slice(0,2).toLowerCase()!==e.toLowerCase()&&r.charCodeAt(2)===sd)&&(r=`${e}\\`));const o=r.length;let a=0,l="",c=!1;const u=r.charCodeAt(0);if(o===1)di(u)&&(a=1,c=!0);else if(di(u))if(c=!0,di(r.charCodeAt(1))){let h=2,g=h;for(;h2&&di(r.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(n){if(e.length>0)break}else if(t=`${r.slice(a)}\\${t}`,n=c,c&&e.length>0)break}return t=iF(t,!n,"\\",di),n?`${e}\\${t}`:`${e}${t}`||"."},normalize(i){So(i,"path");const e=i.length;if(e===0)return".";let t=0,n,s=!1;const r=i.charCodeAt(0);if(e===1)return pY(r)?"\\":i;if(di(r))if(s=!0,di(i.charCodeAt(1))){let a=2,l=a;for(;a2&&di(i.charCodeAt(2))&&(s=!0,t=3));let o=t0&&di(i.charCodeAt(e-1))&&(o+="\\"),!s&&n===void 0&&i.includes(":")){if(o.length>=2&&Xp(o.charCodeAt(0))&&o.charCodeAt(1)===Qp)return`.\\${o}`;let a=i.indexOf(":");do if(a===e-1||di(i.charCodeAt(a+1)))return`.\\${o}`;while((a=i.indexOf(":",a+1))!==-1)}return n===void 0?s?`\\${o}`:o:s?`${n}\\${o}`:`${n}${o}`},isAbsolute(i){So(i,"path");const e=i.length;if(e===0)return!1;const t=i.charCodeAt(0);return di(t)||e>2&&Xp(t)&&i.charCodeAt(1)===Qp&&di(i.charCodeAt(2))},join(...i){if(i.length===0)return".";let e,t;for(let r=0;r0&&(e===void 0?e=t=o:e+=`\\${o}`)}if(e===void 0)return".";let n=!0,s=0;if(typeof t=="string"&&di(t.charCodeAt(0))){++s;const r=t.length;r>1&&di(t.charCodeAt(1))&&(++s,r>2&&(di(t.charCodeAt(2))?++s:n=!1))}if(n){for(;s=2&&(e=`\\${e.slice(s)}`)}return Tc.normalize(e)},relative(i,e){if(So(i,"from"),So(e,"to"),i===e)return"";const t=Tc.resolve(i),n=Tc.resolve(e);if(t===n||(i=t.toLowerCase(),e=n.toLowerCase(),i===e))return"";if(t.length!==i.length||n.length!==e.length){const m=t.split("\\"),x=n.split("\\");m[m.length-1]===""&&m.pop(),x[x.length-1]===""&&x.pop();const v=m.length,_=x.length,w=v<_?v:_;let k;for(k=0;kw?x.slice(k).join("\\"):v>w?"..\\".repeat(v-1-k)+"..":"":"..\\".repeat(v-k)+x.slice(k).join("\\")}let s=0;for(;ss&&i.charCodeAt(r-1)===sd;)r--;const o=r-s;let a=0;for(;aa&&e.charCodeAt(l-1)===sd;)l--;const c=l-a,u=ou){if(e.charCodeAt(a+g)===sd)return n.slice(a+g+1);if(g===2)return n.slice(a+g)}o>u&&(i.charCodeAt(s+g)===sd?h=g:g===2&&(h=3)),h===-1&&(h=0)}let f="";for(g=s+h+1;g<=r;++g)(g===r||i.charCodeAt(g)===sd)&&(f+=f.length===0?"..":"\\..");return a+=h,f.length>0?`${f}${n.slice(a,l)}`:(n.charCodeAt(a)===sd&&++a,n.slice(a,l))},toNamespacedPath(i){if(typeof i!="string"||i.length===0)return i;const e=Tc.resolve(i);if(e.length<=2)return i;if(e.charCodeAt(0)===sd){if(e.charCodeAt(1)===sd){const t=e.charCodeAt(2);if(t!==TNt&&t!==h1)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Xp(e.charCodeAt(0))&&e.charCodeAt(1)===Qp&&e.charCodeAt(2)===sd)return`\\\\?\\${e}`;return e},dirname(i){So(i,"path");const e=i.length;if(e===0)return".";let t=-1,n=0;const s=i.charCodeAt(0);if(e===1)return di(s)?i:".";if(di(s)){if(t=n=1,di(i.charCodeAt(1))){let a=2,l=a;for(;a2&&di(i.charCodeAt(2))?3:2,n=t);let r=-1,o=!0;for(let a=e-1;a>=n;--a)if(di(i.charCodeAt(a))){if(!o){r=a;break}}else o=!1;if(r===-1){if(t===-1)return".";r=t}return i.slice(0,r)},basename(i,e){e!==void 0&&So(e,"suffix"),So(i,"path");let t=0,n=-1,s=!0,r;if(i.length>=2&&Xp(i.charCodeAt(0))&&i.charCodeAt(1)===Qp&&(t=2),e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let o=e.length-1,a=-1;for(r=i.length-1;r>=t;--r){const l=i.charCodeAt(r);if(di(l)){if(!s){t=r+1;break}}else a===-1&&(s=!1,a=r+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(n=r):(o=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(r=i.length-1;r>=t;--r)if(di(i.charCodeAt(r))){if(!s){t=r+1;break}}else n===-1&&(s=!1,n=r+1);return n===-1?"":i.slice(t,n)},extname(i){So(i,"path");let e=0,t=-1,n=0,s=-1,r=!0,o=0;i.length>=2&&i.charCodeAt(1)===Qp&&Xp(i.charCodeAt(0))&&(e=n=2);for(let a=i.length-1;a>=e;--a){const l=i.charCodeAt(a);if(di(l)){if(!r){n=a+1;break}continue}s===-1&&(r=!1,s=a+1),l===h1?t===-1?t=a:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||s===-1||o===0||o===1&&t===s-1&&t===n+1?"":i.slice(t,s)},format:jTe.bind(null,"\\"),parse(i){So(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.length;let n=0,s=i.charCodeAt(0);if(t===1)return di(s)?(e.root=e.dir=i,e):(e.base=e.name=i,e);if(di(s)){if(n=1,di(i.charCodeAt(1))){let h=2,g=h;for(;h0&&(e.root=i.slice(0,n));let r=-1,o=n,a=-1,l=!0,c=i.length-1,u=0;for(;c>=n;--c){if(s=i.charCodeAt(c),di(s)){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),s===h1?r===-1?r=c:u!==1&&(u=1):r!==-1&&(u=-1)}return a!==-1&&(r===-1||u===0||u===1&&r===a-1&&r===o+1?e.base=e.name=i.slice(o,a):(e.name=i.slice(o,r),e.base=i.slice(o,a),e.ext=i.slice(r,a))),o>0&&o!==n?e.dir=i.slice(0,o-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},RNt=(()=>{if(i0){const i=/\\/g;return()=>{const e=tF().replace(i,"/");return e.slice(e.indexOf("/"))}}return()=>tF()})(),Mr={resolve(...i){let e="",t=!1;for(let n=i.length-1;n>=0&&!t;n--){const s=i[n];So(s,`paths[${n}]`),s.length!==0&&(e=`${s}/${e}`,t=s.charCodeAt(0)===Wa)}if(!t){const n=RNt();e=`${n}/${e}`,t=n.charCodeAt(0)===Wa}return e=iF(e,!t,"/",pY),t?`/${e}`:e.length>0?e:"."},normalize(i){if(So(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===Wa,t=i.charCodeAt(i.length-1)===Wa;return i=iF(i,!e,"/",pY),i.length===0?e?"/":t?"./":".":(t&&(i+="/"),e?`/${i}`:i)},isAbsolute(i){return So(i,"path"),i.length>0&&i.charCodeAt(0)===Wa},join(...i){if(i.length===0)return".";const e=[];for(let t=0;t0&&e.push(n)}return e.length===0?".":Mr.normalize(e.join("/"))},relative(i,e){if(So(i,"from"),So(e,"to"),i===e||(i=Mr.resolve(i),e=Mr.resolve(e),i===e))return"";const t=1,n=i.length,s=n-t,r=1,o=e.length-r,a=sa){if(e.charCodeAt(r+c)===Wa)return e.slice(r+c+1);if(c===0)return e.slice(r+c)}else s>a&&(i.charCodeAt(t+c)===Wa?l=c:c===0&&(l=0));let u="";for(c=t+l+1;c<=n;++c)(c===n||i.charCodeAt(c)===Wa)&&(u+=u.length===0?"..":"/..");return`${u}${e.slice(r+l)}`},toNamespacedPath(i){return i},dirname(i){if(So(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===Wa;let t=-1,n=!0;for(let s=i.length-1;s>=1;--s)if(i.charCodeAt(s)===Wa){if(!n){t=s;break}}else n=!1;return t===-1?e?"/":".":e&&t===1?"//":i.slice(0,t)},basename(i,e){e!==void 0&&So(e,"suffix"),So(i,"path");let t=0,n=-1,s=!0,r;if(e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let o=e.length-1,a=-1;for(r=i.length-1;r>=0;--r){const l=i.charCodeAt(r);if(l===Wa){if(!s){t=r+1;break}}else a===-1&&(s=!1,a=r+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(n=r):(o=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(r=i.length-1;r>=0;--r)if(i.charCodeAt(r)===Wa){if(!s){t=r+1;break}}else n===-1&&(s=!1,n=r+1);return n===-1?"":i.slice(t,n)},extname(i){So(i,"path");let e=-1,t=0,n=-1,s=!0,r=0;for(let o=i.length-1;o>=0;--o){const a=i[o];if(a==="/"){if(!s){t=o+1;break}continue}n===-1&&(s=!1,n=o+1),a==="."?e===-1?e=o:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||n===-1||r===0||r===1&&e===n-1&&e===t+1?"":i.slice(e,n)},format:jTe.bind(null,"/"),parse(i){So(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.charCodeAt(0)===Wa;let n;t?(e.root="/",n=1):n=0;let s=-1,r=0,o=-1,a=!0,l=i.length-1,c=0;for(;l>=n;--l){const u=i.charCodeAt(l);if(u===Wa){if(!a){r=l+1;break}continue}o===-1&&(a=!1,o=l+1),u===h1?s===-1?s=l:c!==1&&(c=1):s!==-1&&(c=-1)}if(o!==-1){const u=r===0&&t?1:r;s===-1||c===0||c===1&&s===o-1&&s===r+1?e.base=e.name=i.slice(u,o):(e.name=i.slice(u,s),e.base=i.slice(u,o),e.ext=i.slice(s,o))}return r>0?e.dir=i.slice(0,r-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Mr.win32=Tc.win32=Tc;Mr.posix=Tc.posix=Mr;const FTe=i0?Tc.normalize:Mr.normalize,MNt=i0?Tc.resolve:Mr.resolve,PNt=i0?Tc.relative:Mr.relative,I4=i0?Tc.dirname:Mr.dirname,cb=i0?Tc.basename:Mr.basename,ONt=i0?Tc.extname:Mr.extname,bg=i0?Tc.sep:Mr.sep,jNt=/^\w[\w\d+.-]*$/,FNt=/^\//,BNt=/^\/\//;function HNt(i,e){if(!i.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${i.authority}", path: "${i.path}", query: "${i.query}", fragment: "${i.fragment}"}`);if(i.scheme&&!jNt.test(i.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(i.path){if(i.authority){if(!FNt.test(i.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(BNt.test(i.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function WNt(i,e){return!i&&!e?"file":i}function VNt(i,e){switch(i){case"https":case"http":case"file":e?e[0]!==ig&&(e=ig+e):e=ig;break}return e}const Cr="",ig="/",zNt=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class wt{static isUri(e){return e instanceof wt?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,t,n,s,r,o=!1){typeof e=="object"?(this.scheme=e.scheme||Cr,this.authority=e.authority||Cr,this.path=e.path||Cr,this.query=e.query||Cr,this.fragment=e.fragment||Cr):(this.scheme=WNt(e,o),this.authority=t||Cr,this.path=VNt(this.scheme,n||Cr),this.query=s||Cr,this.fragment=r||Cr,HNt(this,o))}get fsPath(){return sF(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:s,query:r,fragment:o}=e;return t===void 0?t=this.scheme:t===null&&(t=Cr),n===void 0?n=this.authority:n===null&&(n=Cr),s===void 0?s=this.path:s===null&&(s=Cr),r===void 0?r=this.query:r===null&&(r=Cr),o===void 0?o=this.fragment:o===null&&(o=Cr),t===this.scheme&&n===this.authority&&s===this.path&&r===this.query&&o===this.fragment?this:new zS(t,n,s,r,o)}static parse(e,t=!1){const n=zNt.exec(e);return n?new zS(n[2]||Cr,$5(n[4]||Cr),$5(n[5]||Cr),$5(n[7]||Cr),$5(n[9]||Cr),t):new zS(Cr,Cr,Cr,Cr,Cr)}static file(e){let t=Cr;if(Vo&&(e=e.replace(/\\/g,ig)),e[0]===ig&&e[1]===ig){const n=e.indexOf(ig,2);n===-1?(t=e.substring(2),e=ig):(t=e.substring(2,n),e=e.substring(n)||ig)}return new zS("file",t,e,Cr,Cr)}static from(e,t){return new zS(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let n;return Vo&&e.scheme==="file"?n=wt.file(Tc.join(sF(e,!0),...t)).path:n=Mr.join(e.path,...t),e.with({path:n})}toString(e=!1){return mY(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof wt)return e;{const t=new zS(e);return t._formatted=e.external??null,t._fsPath=e._sep===BTe?e.fsPath??null:null,t}}else return e}}const BTe=Vo?1:void 0;let zS=class extends wt{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=sF(this,!1)),this._fsPath}toString(e=!1){return e?mY(this,!0):(this._formatted||(this._formatted=mY(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=BTe),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const HTe={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function Dbe(i,e,t){let n,s=-1;for(let r=0;r=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||e&&o===47||t&&o===91||t&&o===93||t&&o===58)s!==-1&&(n+=encodeURIComponent(i.substring(s,r)),s=-1),n!==void 0&&(n+=i.charAt(r));else{n===void 0&&(n=i.substr(0,r));const a=HTe[o];a!==void 0?(s!==-1&&(n+=encodeURIComponent(i.substring(s,r)),s=-1),n+=a):s===-1&&(s=r)}}return s!==-1&&(n+=encodeURIComponent(i.substring(s))),n!==void 0?n:i}function UNt(i){let e;for(let t=0;t1&&i.scheme==="file"?t=`//${i.authority}${i.path}`:i.path.charCodeAt(0)===47&&(i.path.charCodeAt(1)>=65&&i.path.charCodeAt(1)<=90||i.path.charCodeAt(1)>=97&&i.path.charCodeAt(1)<=122)&&i.path.charCodeAt(2)===58?e?t=i.path.substr(1):t=i.path[1].toLowerCase()+i.path.substr(2):t=i.path,Vo&&(t=t.replace(/\//g,"\\")),t}function mY(i,e){const t=e?UNt:Dbe;let n="",{scheme:s,authority:r,path:o,query:a,fragment:l}=i;if(s&&(n+=s,n+=":"),(r||s==="file")&&(n+=ig,n+=ig),r){let c=r.indexOf("@");if(c!==-1){const u=r.substr(0,c);r=r.substr(c+1),c=u.lastIndexOf(":"),c===-1?n+=t(u,!1,!1):(n+=t(u.substr(0,c),!1,!1),n+=":",n+=t(u.substr(c+1),!1,!0)),n+="@"}r=r.toLowerCase(),c=r.lastIndexOf(":"),c===-1?n+=t(r,!1,!0):(n+=t(r.substr(0,c),!1,!0),n+=r.substr(c))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){const c=o.charCodeAt(1);c>=65&&c<=90&&(o=`/${String.fromCharCode(c+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===58){const c=o.charCodeAt(0);c>=65&&c<=90&&(o=`${String.fromCharCode(c+32)}:${o.substr(2)}`)}n+=t(o,!0,!1)}return a&&(n+="?",n+=t(a,!1,!1)),l&&(n+="#",n+=e?l:Dbe(l,!1,!1)),n}function WTe(i){try{return decodeURIComponent(i)}catch{return i.length>3?i.substr(0,3)+WTe(i.substr(3)):i}}const Tbe=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function $5(i){return i.match(Tbe)?i.replace(Tbe,e=>WTe(e)):i}var Rt;(function(i){i.inMemory="inmemory",i.vscode="vscode",i.internal="private",i.walkThrough="walkThrough",i.walkThroughSnippet="walkThroughSnippet",i.http="http",i.https="https",i.file="file",i.mailto="mailto",i.untitled="untitled",i.data="data",i.command="command",i.vscodeRemote="vscode-remote",i.vscodeRemoteResource="vscode-remote-resource",i.vscodeManagedRemoteResource="vscode-managed-remote-resource",i.vscodeUserData="vscode-userdata",i.vscodeCustomEditor="vscode-custom-editor",i.vscodeNotebookCell="vscode-notebook-cell",i.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",i.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",i.vscodeNotebookCellOutput="vscode-notebook-cell-output",i.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",i.vscodeNotebookMetadata="vscode-notebook-metadata",i.vscodeInteractiveInput="vscode-interactive-input",i.vscodeSettings="vscode-settings",i.vscodeWorkspaceTrust="vscode-workspace-trust",i.vscodeTerminal="vscode-terminal",i.vscodeChatCodeBlock="vscode-chat-code-block",i.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",i.vscodeChatEditor="vscode-chat-editor",i.vscodeChatInput="chatSessionInput",i.vscodeLocalChatSession="vscode-chat-session",i.webviewPanel="webview-panel",i.vscodeWebview="vscode-webview",i.extension="extension",i.vscodeFileResource="vscode-file",i.tmp="tmp",i.vsls="vsls",i.vscodeSourceControl="vscode-scm",i.commentsInput="comment",i.codeSetting="code-setting",i.outputChannel="output",i.accessibleView="accessible-view",i.chatEditingSnapshotScheme="chat-editing-snapshot-text-model",i.chatEditingModel="chat-editing-text-model",i.copilotPr="copilot-pr"})(Rt||(Rt={}));function X7(i,e){return wt.isUri(i)?Fy(i.scheme,e):wre(i,e+":")}function bY(i,...e){return e.some(t=>X7(i,t))}const $Nt="tkn";class qNt{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return Mr.join(this._serverRootPath,Rt.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return Wt(a),e}const t=e.authority;let n=this._hosts[t];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);const s=this._ports[t],r=this._connectionTokens[t];let o=`path=${encodeURIComponent(e.path)}`;return typeof r=="string"&&(o+=`&${$Nt}=${encodeURIComponent(r)}`),wt.from({scheme:yp?this._preferredWebSchema:Rt.vscodeRemoteResource,authority:`${n}:${s}`,path:this._remoteResourcesPath,query:o})}}const VTe=new qNt,KNt="vscode-app",qI=class qI{uriToBrowserUri(e){return e.scheme===Rt.vscodeRemote?VTe.rewrite(e):e.scheme===Rt.file&&(kg||Nkt===`${Rt.vscodeFileResource}://${qI.FALLBACK_AUTHORITY}`)?e.with({scheme:Rt.vscodeFileResource,authority:e.authority||qI.FALLBACK_AUTHORITY,query:null,fragment:null}):e}};qI.FALLBACK_AUTHORITY=KNt;let xY=qI;const zTe=new xY;var vY;(function(i){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);i.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function n(r){let o;typeof r=="string"?o=new URL(r).searchParams:r instanceof URL?o=r.searchParams:wt.isUri(r)&&(o=new URL(r.toString(!0)).searchParams);const a=o==null?void 0:o.get(t);if(a)return e.get(a)}i.getHeadersFromQuery=n;function s(r,o,a){if(!globalThis.crossOriginIsolated)return;const l=o&&a?"3":a?"2":"1";r instanceof URLSearchParams?r.set(t,l):r[t]=l}i.addSearchParam=s})(vY||(vY={}));const Ibe=typeof Buffer<"u";new la(()=>new Uint8Array(256));let a$;class Yv{static wrap(e){return Ibe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new Yv(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return Ibe?this.buffer.toString():(a$||(a$=new TextDecoder),a$.decode(this.buffer))}}function GNt(i,e){return i[e+0]<<0>>>0|i[e+1]<<8>>>0}function YNt(i,e,t){i[t+0]=e&255,e=e>>>8,i[t+1]=e&255}function Yh(i,e){return i[e]*2**24+i[e+1]*2**16+i[e+2]*2**8+i[e+3]}function Qh(i,e,t){i[t+3]=e,e=e>>>8,i[t+2]=e,e=e>>>8,i[t+1]=e,e=e>>>8,i[t]=e}function Abe(i,e){return i[e]}function Rbe(i,e,t){i[t]=e}const Mbe="0123456789abcdef";function QNt({buffer:i}){let e="";for(let t=0;t>>4],e+=Mbe[n&15]}return e}function pP(i){return Z7(i,0)}function Z7(i,e){switch(typeof i){case"object":return i===null?zm(349,e):Array.isArray(i)?ZNt(i,e):JNt(i,e);case"string":return Lre(i,e);case"boolean":return XNt(i,e);case"number":return zm(i,e);case"undefined":return zm(937,e);default:return zm(617,e)}}function zm(i,e){return(e<<5)-e+i|0}function XNt(i,e){return zm(i?433:863,e)}function Lre(i,e){e=zm(149417,e);for(let t=0,n=i.length;tZ7(n,t),e)}function JNt(i,e){return e=zm(181387,e),Object.keys(i).sort().reduce((t,n)=>(t=Lre(n,t),Z7(i[n],t)),e)}function l$(i,e,t=32){const n=t-e,s=~((1<>>n)>>>0}function AT(i,e=32){return i instanceof ArrayBuffer?QNt(Yv.wrap(new Uint8Array(i))):(i>>>0).toString(16).padStart(e/4,"0")}const x9=class x9{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const n=this._buff;let s=this._buffLen,r=this._leftoverHighSurrogate,o,a;for(r!==0?(o=r,a=-1,r=0):(o=e.charCodeAt(0),a=0);;){let l=o;if(Yr(o))if(a+1>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),AT(this._h0)+AT(this._h1)+AT(this._h2)+AT(this._h3)+AT(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=x9._bigBlock32,t=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,t.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,l$(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let n=this._h0,s=this._h1,r=this._h2,o=this._h3,a=this._h4,l,c,u;for(let h=0;h<80;h++)h<20?(l=s&r|~s&o,c=1518500249):h<40?(l=s^r^o,c=1859775393):h<60?(l=s&r|s&o|r&o,c=2400959708):(l=s^r^o,c=3395469782),u=l$(n,5)+l+a+c+e.getUint32(h*4,!1)&4294967295,a=o,o=r,r=l$(s,30),s=n,n=u;this._h0=this._h0+n&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+r&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+a&4294967295}};x9._bigBlock32=new DataView(new ArrayBuffer(320));let _Y=x9;function eEt(i){if(i.length===0)throw new Error("Invalid tail call");return[i.slice(0,i.length-1),i[i.length-1]]}function us(i,e,t=(n,s)=>n===s){if(i===e)return!0;if(!i||!e||i.length!==e.length)return!1;for(let n=0,s=i.length;nt(i[n],e))}function Dre(i,e){let t=0,n=i-1;for(;t<=n;){const s=(t+n)/2|0,r=e(s);if(r<0)t=s+1;else if(r>0)n=s-1;else return s}return-(t+1)}function yY(i,e,t){if(i=i|0,i>=e.length)throw new TypeError("invalid index");const n=e[Math.floor(e.length*Math.random())],s=[],r=[],o=[];for(const a of e){const l=t(a,n);l<0?s.push(a):l>0?r.push(a):o.push(a)}return i!!e)}function Obe(i){let e=0;for(let t=0;t0}function Eb(i,e=t=>t){const t=new Set;return i.filter(n=>{const s=e(n);return t.has(s)?!1:(t.add(s),!0)})}function bl(i,e){let t=typeof e=="number"?i:0;typeof e=="number"?t=i:(t=0,e=i);const n=[];if(t<=e)for(let s=t;se;s--)n.push(s);return n}function J7(i,e,t){const n=i.slice(0,e),s=i.slice(e);return n.concat(t,s)}function c$(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.unshift(e))}function q5(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.push(e))}function wY(i,e){for(const t of e)i.push(t)}function iEt(i,e){const t=[];for(const n of i){const s=e(n);s!==void 0&&t.push(s)}return t}function Ire(i){return Array.isArray(i)?i:[i]}function sEt(i,e,t){const n=qTe(i,e),s=i.length,r=t.length;i.length=s+r;for(let o=s-1;o>=n;o--)i[o+r]=i[o];for(let o=0;o0}i.isGreaterThan=n;function s(r){return r===0}i.isNeitherLessOrGreaterThan=s,i.greaterThan=1,i.lessThan=-1,i.neitherLessOrGreaterThan=0})(Qv||(Qv={}));function ua(i,e){return(t,n)=>e(i(t),i(n))}function rEt(...i){return(e,t)=>{for(const n of i){const s=n(e,t);if(!Qv.isNeitherLessOrGreaterThan(s))return s}return Qv.neitherLessOrGreaterThan}}const Ac=(i,e)=>i-e,KTe=(i,e)=>Ac(i?1:0,e?1:0);function GTe(i){return(e,t)=>-i(e,t)}function oEt(i){return(e,t)=>e===void 0?t===void 0?Qv.neitherLessOrGreaterThan:Qv.lessThan:t===void 0?Qv.greaterThan:i(e,t)}class Lb{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 n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}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 eN=class eN{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new eN(t=>this.iterate(n=>e(n)?t(n):!0))}map(e){return new eN(t=>this.iterate(n=>t(e(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(s=>((n||Qv.isGreaterThan(e(s,t)))&&(n=!1,t=s),!0)),t}};eN.empty=new eN(e=>{});let g1=eN;class aF{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const n=Array.from(e.keys()).sort((s,r)=>t(e[s],e[r]));return new aF(n)}apply(e){return e.map((t,n)=>e[this._indexMap[n]])}inverse(){const e=this._indexMap.slice();for(let t=0;te+t,0)}let Y0;function aEt(i){Y0?Y0 instanceof jbe?Y0.loggers.push(i):Y0=new jbe([Y0,i]):Y0=i}function La(){return Y0}class jbe{constructor(e){this.loggers=e}handleObservableCreated(e,t){for(const n of this.loggers)n.handleObservableCreated(e,t)}handleOnListenerCountChanged(e,t){for(const n of this.loggers)n.handleOnListenerCountChanged(e,t)}handleObservableUpdated(e,t){for(const n of this.loggers)n.handleObservableUpdated(e,t)}handleAutorunCreated(e,t){for(const n of this.loggers)n.handleAutorunCreated(e,t)}handleAutorunDisposed(e){for(const t of this.loggers)t.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,t,n){for(const s of this.loggers)s.handleAutorunDependencyChanged(e,t,n)}handleAutorunStarted(e){for(const t of this.loggers)t.handleAutorunStarted(e)}handleAutorunFinished(e){for(const t of this.loggers)t.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,t,n){for(const s of this.loggers)s.handleDerivedDependencyChanged(e,t,n)}handleDerivedCleared(e){for(const t of this.loggers)t.handleDerivedCleared(e)}handleBeginTransaction(e){for(const t of this.loggers)t.handleBeginTransaction(e)}handleEndTransaction(e){for(const t of this.loggers)t.handleEndTransaction(e)}}var no;(function(i){let e=!1;function t(){e=!0}i.enable=t;function n(){if(!e)return;const s=Error,r=s.stackTraceLimit;s.stackTraceLimit=3;const o=new Error().stack;return s.stackTraceLimit=r,Are.fromStack(o,2)}i.ofCaller=n})(no||(no={}));class Are{static fromStack(e,t){const n=e.split(`
-`),s=lEt(n[t+1]);if(s)return new Are(s.fileName,s.line,s.column,s.id)}constructor(e,t,n,s){this.fileName=e,this.line=t,this.column=n,this.id=s}}function lEt(i){const e=i.match(/\((.*):(\d+):(\d+)\)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:i};const t=i.match(/at ([^\(\)]*):(\d+):(\d+)/);if(t)return{fileName:t[1],line:parseInt(t[2]),column:parseInt(t[3]),id:i}}const Md=(i,e)=>i===e;function FA(i=Md){return(e,t)=>us(e,t,i)}function Rre(){return(i,e)=>i.equals(e)}function By(i,e,t){if(t!==void 0){const n=i;return n==null||e===void 0||e===null?e===n:t(n,e)}else{const n=i;return(s,r)=>s==null||r===void 0||r===null?r===s:n(s,r)}}function CY(i,e){if(i===e)return!0;if(Array.isArray(i)&&Array.isArray(e)){if(i.length!==e.length)return!1;for(let t=0;t{const o=Mre(r);if(o!==void 0)return o;const l=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(r.toString());if(l)return`${this.debugName}.${l[2]}`;if(!s)return`${this.debugName} (mapped)`},debugReferenceFn:r},o=>r(this.read(o),o),n)}flatten(){return kY({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(QTe(this,t)),this}}class ZL extends XTe{constructor(e){var t;super(),this._observers=new Set,(t=La())==null||t.handleObservableCreated(this,e)}addObserver(e){var n;const t=this._observers.size;this._observers.add(e),t===0&&this.onFirstObserverAdded(),t!==this._observers.size&&((n=La())==null||n.handleOnListenerCountChanged(this,this._observers.size))}removeObserver(e){var n;const t=this._observers.delete(e);t&&this._observers.size===0&&this.onLastObserverRemoved(),t&&((n=La())==null||n.handleOnListenerCountChanged(this,this._observers.size))}onFirstObserverAdded(){}onLastObserverRemoved(){}debugGetObservers(){return this._observers}}function pEt(i){switch(i){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}class au extends ZL{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,n,s=void 0,r,o){var a;super(o),this._debugNameData=e,this._computeFn=t,this._changeTracker=n,this._handleLastObserverRemoved=s,this._equalityComparator=r,this._state=0,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=(a=this._changeTracker)==null?void 0:a.createChangeSummary(void 0)}onLastObserverRemoved(){var e,t;this._state=0,this._value=void 0,(e=La())==null||e.handleDerivedCleared(this);for(const n of this._dependencies)n.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),(t=this._handleLastObserverRemoved)==null||t.call(this)}get(){var t,n;if(this._isComputing,this._observers.size===0){let s;try{this._isReaderValid=!0;let r;this._changeTracker&&(r=this._changeTracker.createChangeSummary(void 0),(n=(t=this._changeTracker).beforeUpdate)==null||n.call(t,this,r)),s=this._computeFn(this,r)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),s}else{do{if(this._state===1){for(const s of this._dependencies)if(s.reportChanges(),this._state===2)break}this._state===1&&(this._state=3),this._state!==3&&this._recompute()}while(this._state!==3);return this._value}}_recompute(){var n,s,r,o;let e=!1;this._isComputing=!0,this._didReportChange=!1;const t=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=t;try{const a=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,(s=(n=this._changeTracker).beforeUpdate)==null||s.call(n,this,a),this._isInBeforeUpdate=!1,this._changeSummary=(r=this._changeTracker)==null?void 0:r.createChangeSummary(a));const l=this._state!==0,c=this._value;this._state=3;const u=this._delayedStore;u!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,a)}finally{this._isReaderValid=!1;for(const h of this._dependenciesToBeRemoved)h.removeObserver(this);this._dependenciesToBeRemoved.clear(),u!==void 0&&u.dispose()}e=this._didReportChange||l&&!this._equalityComparator(c,this._value),(o=La())==null||o.handleObservableUpdated(this,{oldValue:c,newValue:this._value,change:void 0,didChange:e,hadValue:l})}catch(a){Yj(a)}if(this._isComputing=!1,!this._didReportChange&&e)for(const a of this._observers)a.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new St("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{const t=this._updateCount===1;if(this._state===3&&(this._state=1,!t))for(const n of this._observers)n.handlePossibleChange(this);if(t)for(const n of this._observers)n.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){const t=[...this._observers];for(const n of t)n.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){const n=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(const s of n)s.endUpdate(this)}}L_(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===3&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(const t of this._observers)t.handlePossibleChange(this)}}handleChange(e,t){var n;if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){(n=La())==null||n.handleDerivedDependencyChanged(this,e,t);let s=!1;try{s=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:t,didChange:o=>o===e},this._changeSummary):!0}catch(o){Yj(o)}const r=this._state===3;if(s&&(this._state===1||r)&&(this._state=2,r))for(const o of this._observers)o.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new St("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new ve),this._store}addObserver(e){const t=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),t&&(this._removedObserverToCallEndUpdateOn&&this._removedObserverToCallEndUpdateOn.has(e)?this._removedObserverToCallEndUpdateOn.delete(e):e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:pEt(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this._isComputing?this._state=2:this._recompute()}setValue(e,t,n){this._value=e;const s=this._observers;t.updateObserver(this,this);for(const r of s)r.handleChange(this,n)}}class ZTe extends au{constructor(e,t,n,s=void 0,r,o,a){super(e,t,n,s,r,a),this.set=o}}function we(i,e,t=no.ofCaller()){return e!==void 0?new au(new pa(i,void 0,e),e,void 0,void 0,Md,t):new au(new pa(void 0,void 0,i),i,void 0,void 0,Md,t)}function Pre(i,e,t,n=no.ofCaller()){return new ZTe(new pa(i,void 0,e),e,void 0,void 0,Md,t,n)}function aa(i,e,t=no.ofCaller()){return new au(new pa(i.owner,i.debugName,i.debugReferenceFn),e,void 0,i.onLastObserverRemoved,i.equalsFn??Md,t)}gEt(aa);function Wbe(i,e,t=no.ofCaller()){return new au(new pa(i.owner,i.debugName,void 0),e,i.changeTracker,void 0,i.equalityComparer??Md,t)}function ru(i,e,t=no.ofCaller()){let n,s;e===void 0?(n=i,s=void 0):(s=i,n=e);let r;return new au(new pa(s,void 0,n),o=>{r?r.clear():r=new ve;const a=n(o);return a&&r.add(a),a},void 0,()=>{r&&(r.dispose(),r=void 0)},Md,t)}function mEt(i){switch(i){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}class BA{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,n,s){var r,o;this._debugNameData=e,this._runFn=t,this._changeTracker=n,this._state=2,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._store=void 0,this._delayedStore=void 0,this._changeSummary=(r=this._changeTracker)==null?void 0:r.createChangeSummary(void 0),(o=La())==null||o.handleAutorunCreated(this,s),this._run()}dispose(){var e;if(!this._disposed){this._disposed=!0;for(const t of this._dependencies)t.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),(e=La())==null||e.handleAutorunDisposed(this)}}_run(){var t,n,s,r;const e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){(t=La())==null||t.handleAutorunStarted(this);const o=this._changeSummary,a=this._delayedStore;a!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&((s=(n=this._changeTracker).beforeUpdate)==null||s.call(n,this,o),this._changeSummary=this._changeTracker.createChangeSummary(o)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,o)}catch(l){Yj(l)}finally{this._isRunning=!1,a!==void 0&&a.dispose()}}}finally{this._disposed||(r=La())==null||r.handleAutorunFinished(this);for(const o of this._dependenciesToBeRemoved)o.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===3&&(this._state=1),this._updateCount++}endUpdate(e){try{if(this._updateCount===1)do{if(this._state===1){this._state=3;for(const t of this._dependencies)if(t.reportChanges(),this._state===2)break}this._state!==3&&this._run()}while(this._state!==3)}finally{this._updateCount--}L_(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===3&&this._isDependency(e)&&(this._state=1)}handleChange(e,t){var n;if(this._isDependency(e)){(n=La())==null||n.handleAutorunDependencyChanged(this,e,t);try{(this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:t,didChange:r=>r===e},this._changeSummary):!0)&&(this._state=2)}catch(s){Yj(s)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new St("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){if(this._ensureNoRunning(),this._disposed)throw new St("Cannot access store after dispose");return this._store===void 0&&(this._store=new ve),this._store}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:mEt(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}}function At(i,e=no.ofCaller()){return new BA(new pa(void 0,void 0,i),i,void 0,e)}function eH(i,e,t=no.ofCaller()){return new BA(new pa(i.owner,i.debugName,i.debugReferenceFn??e),e,void 0,t)}function JL(i,e,t=no.ofCaller()){return new BA(new pa(i.owner,i.debugName,i.debugReferenceFn??e),e,i.changeTracker,t)}function bEt(i,e){const t=new ve,n=JL({owner:i.owner,debugName:i.debugName,debugReferenceFn:i.debugReferenceFn??e,changeTracker:i.changeTracker},(s,r)=>{t.clear(),e(s,r,t)});return ut(()=>{n.dispose(),t.dispose()})}function Ta(i){const e=new ve,t=eH({owner:void 0,debugName:void 0,debugReferenceFn:i},n=>{e.clear(),i(n,e)});return ut(()=>{t.dispose(),e.dispose()})}function xEt(i,e){let t;return eH({debugReferenceFn:e},n=>{const s=i.read(n),r=t;t=s,e({lastValue:r,newValue:s})})}function Vbe(i){const e=new Error("BugIndicatingErrorRecovery: "+i);Wt(e),console.error("recovered from an error that indicates a bug",e)}function Hi(i,e){const t=new eD(i,e);try{i(t)}finally{t.finish()}}let K5;function v2(i){if(K5)i(K5);else{const e=new eD(i,void 0);K5=e;try{i(e)}finally{e.finish(),K5=void 0}}}async function vEt(i,e){const t=new eD(i,e);try{await i(t)}finally{t.finish()}}function KE(i,e,t){i?e(i):Hi(e,t)}class eD{constructor(e,t){var n;this._fn=e,this._getDebugName=t,this._updatingObservers=[],(n=La())==null||n.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Mre(this._fn)}updateObserver(e,t){if(!this._updatingObservers){Vbe("Transaction already finished!"),Hi(n=>{n.updateObserver(e,t)});return}this._updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var t;const e=this._updatingObservers;if(!e){Vbe("transaction.finish() has already been called!");return}for(let n=0;nUm.globalTransaction,Md,s??no.ofCaller())}function JTe(i,e,t,n=no.ofCaller()){return new Um(new pa(i.owner,i.debugName,i.debugReferenceFn??t),e,t,()=>Um.globalTransaction,i.equalsFn??Md,n)}class Um extends ZL{constructor(e,t,n,s,r,o){super(o),this._debugNameData=e,this.event=t,this._getValue=n,this._getTransaction=s,this._equalityComparator=r,this._hasValue=!1,this.handleEvent=a=>{var g;const l=this._getValue(a),c=this._value,u=!this._hasValue||!this._equalityComparator(c,l);let h=!1;u&&(this._value=l,this._hasValue&&(h=!0,KE(this._getTransaction(),f=>{var m;(m=La())==null||m.handleObservableUpdated(this,{oldValue:c,newValue:l,change:void 0,didChange:u,hadValue:this._hasValue});for(const x of this._observers)f.updateObserver(x,this),x.handleChange(this,void 0)},()=>{const f=this.getDebugName();return"Event fired"+(f?`: ${f}`:"")})),this._hasValue=!0),h||(g=La())==null||g.handleObservableUpdated(this,{oldValue:c,newValue:l,change:void 0,didChange:u,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}}(function(i){i.Observer=Um;function e(t,n){let s=!1;Um.globalTransaction===void 0&&(Um.globalTransaction=t,s=!0);try{n()}finally{s&&(Um.globalTransaction=void 0)}}i.batchEventsGlobally=e})(Gn||(Gn={}));function zbe(i,e){let t=!1,n,s;return Gn(r=>{const o=At(a=>{const l=i.read(a);t?(s&&clearTimeout(s),s=setTimeout(()=>{n=l,r()},e)):(t=!0,n=l)});return{dispose(){o.dispose(),t=!1,n=void 0}}},()=>t?n:i.get())}function GE(i,e){const t=new _Et(!0,e);i.addObserver(t);try{t.beginUpdate(i)}finally{t.endUpdate(i)}return ut(()=>{i.removeObserver(t)})}fEt(GE);class _Et{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,t){}}function $b(i,e){let t;return aa({owner:i,debugReferenceFn:e},s=>(t=e(s,t),t))}function Ore(i,e,t,n){let s=new Ube(t,n);return aa({debugReferenceFn:t,owner:i,onLastObserverRemoved:()=>{s.dispose(),s=new Ube(t)}},o=>(s.setItems(e.read(o)),s.getItems()))}let Ube=class{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){const t=[],n=new Set(this._cache.keys());for(const s of e){const r=this._keySelector?this._keySelector(s):s;let o=this._cache.get(r);if(o)n.delete(r);else{const a=new ve;o={out:this._map(s,a),store:a},this._cache.set(r,o)}t.push(o.out)}for(const s of n)this._cache.get(s).store.dispose(),this._cache.delete(s);this._items=t}getItems(){return this._items}};function Tk(i,e){switch(typeof i){case"number":return""+i;case"string":return i.length+2<=e?`"${i}"`:`"${i.substr(0,e-7)}"+...`;case"boolean":return i?"true":"false";case"undefined":return"undefined";case"object":return i===null?"null":Array.isArray(i)?yEt(i,e):wEt(i,e);case"symbol":return i.toString();case"function":return`[[Function${i.name?" "+i.name:""}]]`;default:return""+i}}function yEt(i,e){let t="[ ",n=!0;for(const s of i){if(n||(t+=", "),t.length-5>e){t+="...";break}n=!1,t+=`${Tk(s,e-t.length)}`}return t+=" ]",t}function wEt(i,e){if(typeof i.toString=="function"&&i.toString!==Object.prototype.toString){const r=i.toString();return r.length<=e?r:r.substring(0,e-3)+"..."}const t=YTe(i);let n=t?t+"(":"{ ",s=!0;for(const[r,o]of Object.entries(i)){if(s||(n+=", "),n.length-5>e){n+="...";break}s=!1,n+=`${r}: ${Tk(o,e-n.length)}`}return n+=t?")":" }",n}class jre{static createClient(e,t){return new jre(e,t)}constructor(e,t){this._channelFactory=e,this._getHandler=t,this._channel=this._channelFactory({handleNotification:r=>{const o=r,a=this._getHandler().notifications[o[0]];if(!a)throw new Error(`Unknown notification "${o[0]}"!`);a(...o[1])},handleRequest:r=>{const o=r;try{return{type:"result",value:this._getHandler().requests[o[0]](...o[1])}}catch(a){return{type:"error",value:a}}}});const n=new Proxy({},{get:(r,o)=>async(...a)=>{const l=await this._channel.sendRequest([o,a]);if(l.type==="error")throw l.value;return l.value}}),s=new Proxy({},{get:(r,o)=>(...a)=>{this._channel.sendNotification([o,a])}});this.api={notifications:s,requests:n}}}function CEt(i,e){const t=globalThis;let n=[],s;const{channel:r,handler:o}=SEt({sendNotification:l=>{s?s.sendNotification(l):n.push(l)}});let a;return(t.$$debugValueEditor_debugChannels??(t.$$debugValueEditor_debugChannels={}))[i]=l=>{a=e(),s=l;for(const c of n)l.sendNotification(c);return n=[],o},jre.createClient(r,()=>{if(!a)throw new Error("Not supported");return a})}function SEt(i){let e;return{channel:n=>(e=n,{sendNotification:s=>{i.sendNotification(s)},sendRequest:s=>{throw new Error("not supported")}}),handler:{handleRequest:n=>n.type==="notification"?e==null?void 0:e.handleNotification(n.data):e==null?void 0:e.handleRequest(n.data)}}}class kEt{constructor(){this._timeout=void 0}throttle(e,t){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},t))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}}function e2e(i,e){for(const t in e)i[t]&&typeof i[t]=="object"&&e[t]&&typeof e[t]=="object"?e2e(i[t],e[t]):i[t]=e[t]}function t2e(i,e){for(const t in e)e[t]===null?delete i[t]:i[t]&&typeof i[t]=="object"&&e[t]&&typeof e[t]=="object"?t2e(i[t],e[t]):i[t]=e[t]}function Ot(i,e,t=no.ofCaller()){let n;return typeof i=="string"?n=new pa(void 0,i,void 0):n=new pa(i,void 0,void 0),new HA(n,e,Md,t)}class HA extends ZL{get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,t,n,s){var r;super(s),this._debugNameData=e,this._equalityComparator=n,this._value=t,(r=La())==null||r.handleObservableUpdated(this,{hadValue:!1,newValue:t,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,t,n){var r;if(n===void 0&&this._equalityComparator(this._value,e))return;let s;t||(t=s=new eD(()=>{},()=>`Setting ${this.debugName}`));try{const o=this._value;this._setValue(e),(r=La())==null||r.handleObservableUpdated(this,{oldValue:o,newValue:e,change:n,didChange:!0,hadValue:!0});for(const a of this._observers)t.updateObserver(a,this),a.handleChange(this,n)}finally{s&&s.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}}function Fre(i,e,t=no.ofCaller()){let n;return typeof i=="string"?n=new pa(void 0,i,void 0):n=new pa(i,void 0,void 0),new NEt(n,e,Md,t)}class NEt extends HA{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)==null||e.dispose()}}const ky=class ky{static getInstance(){return ky._instance===void 0&&(ky._instance=new ky),ky._instance}getTransactionState(){const e=[],t=[...this._activeTransactions];if(t.length===0)return;const n=t.flatMap(r=>r.debugGetUpdatingObservers()??[]).map(r=>r.observer),s=new Set;for(;n.length>0;){const r=n.shift();if(s.has(r))continue;s.add(r);const o=this._getInfo(r,a=>{s.has(a)||n.push(a)});o&&e.push(o)}return{names:t.map(r=>r.getDebugName()??"tx"),affected:e}}_getObservableInfo(e){const t=this._instanceInfos.get(e);if(!t){Wt(new St("No info found"));return}return t}_getAutorunInfo(e){const t=this._instanceInfos.get(e);if(!t){Wt(new St("No info found"));return}return t}_getInfo(e,t){if(e instanceof au){const n=[...e.debugGetObservers()];for(const l of n)t(l);const s=this._getObservableInfo(e);if(!s)return;const r=e.debugGetState(),o={name:e.debugName,instanceId:s.instanceId,updateCount:r.updateCount},a=[...s.changedObservables].map(l=>{var c;return(c=this._instanceInfos.get(l))==null?void 0:c.instanceId}).filter(No);if(r.isComputing)return{...o,type:"observable/derived",state:"updating",changedDependencies:a,initialComputation:!1};switch(r.state){case 0:return{...o,type:"observable/derived",state:"noValue"};case 3:return{...o,type:"observable/derived",state:"upToDate"};case 2:return{...o,type:"observable/derived",state:"stale",changedDependencies:a};case 1:return{...o,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof BA){const n=this._getAutorunInfo(e);if(!n)return;const s={name:e.debugName,instanceId:n.instanceId,updateCount:n.updateCount},r=[...n.changedObservables].map(o=>this._instanceInfos.get(o).instanceId);if(e.debugGetState().isRunning)return{...s,type:"autorun",state:"updating",changedDependencies:r};switch(e.debugGetState().state){case 3:return{...s,type:"autorun",state:"upToDate"};case 2:return{...s,type:"autorun",state:"stale",changedDependencies:r};case 1:return{...s,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){const t=this._getObservableInfo(e);if(t)return{name:e.debugName,instanceId:t.instanceId}}_formatObserver(e){var n;if(e instanceof au)return{name:e.toString(),instanceId:(n=this._getObservableInfo(e))==null?void 0:n.instanceId};const t=this._getAutorunInfo(e);if(t)return{name:e.toString(),instanceId:t.instanceId}}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=CEt("observableDevTools",()=>({notifications:{setDeclarationIdFilter:e=>{},logObservableValue:e=>{console.log("logObservableValue",e)},flushUpdates:()=>{this._flushUpdates()},resetUpdates:()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)}},requests:{getDeclarations:()=>{const e={};for(const t of this._declarations.values())e[t.id]=t;return{decls:e}},getSummarizedInstances:()=>null,getObservableValueInfo:e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(n=>this._formatObserver(n)).filter(No)}),getDerivedInfo:e=>{const t=this._aliveInstances.get(e);return{dependencies:[...t.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(No),observers:[...t.debugGetObservers()].map(n=>this._formatObserver(n)).filter(No)}},getAutorunInfo:e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(No)}),getTransactionState:()=>this.getTransactionState(),setValue:(e,t)=>{const n=this._aliveInstances.get(e);if(n instanceof au)n.debugSetValue(t);else if(n instanceof HA)n.debugSetValue(t);else if(n instanceof Um)n.debugSetValue(t);else throw new St("Observable is not supported");const s=[...n.debugGetObservers()];for(const r of s)r.beginUpdate(n);for(const r of s)r.handleChange(n,void 0);for(const r of s)r.endUpdate(n)},getValue:e=>{const t=this._aliveInstances.get(e);if(t instanceof au)return Tk(t.debugGetState().value,200);if(t instanceof HA)return Tk(t.debugGetState().value,200)},logValue:e=>{const t=this._aliveInstances.get(e);if(t&&"get"in t)console.log("Logged Value:",t.get());else throw new St("Observable is not supported")},rerun:e=>{const t=this._aliveInstances.get(e);if(t instanceof au)t.debugRecompute();else if(t instanceof BA)t.debugRerun();else throw new St("Observable is not supported")}}})),this._pendingChanges=null,this._changeThrottler=new kEt,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},no.enable()}_handleChange(e){t2e(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:e2e(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,t){if(!t)return-1;let n=this._declarations.get(t.id);return n===void 0&&(n={id:this._declarationId++,type:e,url:t.fileName,line:t.line,column:t.column},this._declarations.set(t.id,n),this._handleChange({decls:{[n.id]:n}})),n.id}handleObservableCreated(e,t){const s={declarationId:this._getDeclarationId("observable/value",t),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,s)}handleOnListenerCountChanged(e,t){const n=this._getObservableInfo(e);if(n){if(n.listenerCount===0&&t>0){const s=e instanceof au?"observable/derived":"observable/value";this._aliveInstances.set(n.instanceId,e),this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,formattedValue:n.lastValue,type:s,name:e.debugName}}})}else n.listenerCount>0&&t===0&&(this._handleChange({instances:{[n.instanceId]:null}}),this._aliveInstances.delete(n.instanceId));n.listenerCount=t}}handleObservableUpdated(e,t){if(e instanceof au){this._handleDerivedRecomputed(e,t);return}const n=this._getObservableInfo(e);n&&t.didChange&&(n.lastValue=Tk(t.newValue,30),n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:n.lastValue}}}))}handleAutorunCreated(e,t){const s={declarationId:this._getDeclarationId("autorun",t),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,s),this._aliveInstances.set(s.instanceId,e),s&&this._handleChange({instances:{[s.instanceId]:{instanceId:s.instanceId,declarationId:s.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){const t=this._getAutorunInfo(e);t&&(this._handleChange({instances:{[t.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(t.instanceId))}handleAutorunDependencyChanged(e,t,n){const s=this._getAutorunInfo(e);s&&s.changedObservables.add(t)}handleAutorunStarted(e){}handleAutorunFinished(e){const t=this._getAutorunInfo(e);t&&(t.changedObservables.clear(),t.updateCount++,this._handleChange({instances:{[t.instanceId]:{runCount:t.updateCount}}}))}handleDerivedDependencyChanged(e,t,n){const s=this._getObservableInfo(e);s&&s.changedObservables.add(t)}_handleDerivedRecomputed(e,t){const n=this._getObservableInfo(e);if(!n)return;const s=Tk(t.newValue,30);n.updateCount++,n.changedObservables.clear(),n.lastValue=s,n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:s,recomputationCount:n.updateCount}}})}handleDerivedCleared(e){const t=this._getObservableInfo(e);t&&(t.lastValue=void 0,t.changedObservables.clear(),t.listenerCount>0&&this._handleChange({instances:{[t.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}};ky._instance=void 0;let NY=ky;nF&&nF.VSCODE_DEV_DEBUG_OBSERVABLES&&aEt(NY.getInstance());const{getWindow:xt,getDocument:EEt,getWindows:n2e,getWindowsCount:LEt,getWindowId:WA,getWindowById:$be,onDidRegisterWindow:mP,onWillUnregisterWindow:DEt,onDidUnregisterWindow:TEt}=(function(){const i=new Map;fkt(hi,1);const e={window:hi,disposables:new ve};i.set(hi.vscodeWindowId,e);const t=new se,n=new se,s=new se;function r(o,a){return(typeof o=="number"?i.get(o):void 0)??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:n.event,registerWindow(o){if(i.has(o.vscodeWindowId))return re.None;const a=new ve,l={window:o,disposables:a.add(new ve)};return i.set(o.vscodeWindowId,l),a.add(ut(()=>{i.delete(o.vscodeWindowId),n.fire(o)})),a.add(de(o,Pe.BEFORE_UNLOAD,()=>{s.fire(o)})),t.fire(l),a},getWindows(){return i.values()},getWindowsCount(){return i.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return i.has(o)},getWindowById:r,getWindow(o){var c;const a=o;if((c=a==null?void 0:a.ownerDocument)!=null&&c.defaultView)return a.ownerDocument.defaultView.window;const l=o;return l!=null&&l.view?l.view.window:hi},getDocument(o){return xt(o).document}}})();function Wo(i){for(;i.firstChild;)i.firstChild.remove()}class IEt{constructor(e,t,n,s){this._node=e,this._type=t,this._handler=n,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function de(i,e,t,n){return new IEt(i,e,t,n)}function i2e(i,e){return function(t){return e(new da(i,t))}}function AEt(i){return function(e){return i(new yi(e))}}const pr=function(e,t,n,s){let r=n;return t==="click"||t==="mousedown"||t==="contextmenu"?r=i2e(xt(e),n):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=AEt(n)),de(e,t,r,s)},REt=function(e,t,n){const s=i2e(xt(e),t);return s2e(e,s,n)};function s2e(i,e,t){return de(i,Nu&&uP.pointerEvents?Pe.POINTER_DOWN:Pe.MOUSE_DOWN,e,t)}function MEt(i,e,t){return de(i,Nu&&uP.pointerEvents?Pe.POINTER_MOVE:Pe.MOUSE_MOVE,e,t)}function qbe(i,e,t){return de(i,Nu&&uP.pointerEvents?Pe.POINTER_UP:Pe.MOUSE_UP,e,t)}function _2(i,e,t){return J2(i,e,t)}class d$ extends kTe{constructor(e,t){super(e,t)}}let cF,rc;class Bre extends vre{constructor(e){super(),this.defaultTarget=e&&xt(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}}class u${constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Wt(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const i=new Map,e=new Map,t=new Map,n=new Map,s=r=>{t.set(r,!1);const o=i.get(r)??[];for(e.set(r,o),i.set(r,[]),n.set(r,!0);o.length>0;)o.sort(u$.sort),o.shift().execute();n.set(r,!1)};rc=(r,o,a=0)=>{const l=WA(r),c=new u$(o,a);let u=i.get(l);return u||(u=[],i.set(l,u)),u.push(c),t.get(l)||(t.set(l,!0),r.requestAnimationFrame(()=>s(l))),c},cF=(r,o,a)=>{const l=WA(r);if(n.get(l)){const c=new u$(o,a);let u=e.get(l);return u||(u=[],e.set(l,u)),u.push(c),c}else return rc(r,o,a)}})();function tH(i){return xt(i).getComputedStyle(i,null)}function T_(i,e,t){const n=xt(i),s=n.document;if(i!==s.body)return new ei(i.clientWidth,i.clientHeight);if(Nu&&(n!=null&&n.visualViewport))return new ei(n.visualViewport.width,n.visualViewport.height);if(n!=null&&n.innerWidth&&n.innerHeight)return new ei(n.innerWidth,n.innerHeight);if(s.body&&s.body.clientWidth&&s.body.clientHeight)return new ei(s.body.clientWidth,s.body.clientHeight);if(s.documentElement&&s.documentElement.clientWidth&&s.documentElement.clientHeight)return new ei(s.documentElement.clientWidth,s.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class fr{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t){const n=tH(e),s=n?n.getPropertyValue(t):"0";return fr.convertToPixels(e,s)}static getBorderLeftWidth(e){return fr.getDimension(e,"border-left-width")}static getBorderRightWidth(e){return fr.getDimension(e,"border-right-width")}static getBorderTopWidth(e){return fr.getDimension(e,"border-top-width")}static getBorderBottomWidth(e){return fr.getDimension(e,"border-bottom-width")}static getPaddingLeft(e){return fr.getDimension(e,"padding-left")}static getPaddingRight(e){return fr.getDimension(e,"padding-right")}static getPaddingTop(e){return fr.getDimension(e,"padding-top")}static getPaddingBottom(e){return fr.getDimension(e,"padding-bottom")}static getMarginLeft(e){return fr.getDimension(e,"margin-left")}static getMarginTop(e){return fr.getDimension(e,"margin-top")}static getMarginRight(e){return fr.getDimension(e,"margin-right")}static getMarginBottom(e){return fr.getDimension(e,"margin-bottom")}}const Ny=class Ny{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Ny(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof Ny?e:new Ny(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};Ny.None=new Ny(0,0);let ei=Ny;function r2e(i){let e=i.offsetParent,t=i.offsetTop,n=i.offsetLeft;for(;(i=i.parentNode)!==null&&i!==i.ownerDocument.body&&i!==i.ownerDocument.documentElement;){t-=i.scrollTop;const s=a2e(i)?null:tH(i);s&&(n-=s.direction!=="rtl"?i.scrollLeft:-i.scrollLeft),i===e&&(n+=fr.getBorderLeftWidth(i),t+=fr.getBorderTopWidth(i),t+=i.offsetTop,n+=i.offsetLeft,e=i.offsetParent)}return{left:n,top:t}}function PEt(i,e,t){typeof e=="number"&&(i.style.width=`${e}px`),typeof t=="number"&&(i.style.height=`${t}px`)}function Gs(i){const e=i.getBoundingClientRect(),t=xt(i);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function o2e(i){let e=i,t=1;do{const n=tH(e).zoom;n!=null&&n!=="1"&&(t*=n),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function Cc(i){const e=fr.getMarginLeft(i)+fr.getMarginRight(i);return i.offsetWidth+e}function h$(i){const e=fr.getBorderLeftWidth(i)+fr.getBorderRightWidth(i),t=fr.getPaddingLeft(i)+fr.getPaddingRight(i);return i.offsetWidth-e-t}function OEt(i){const e=fr.getBorderTopWidth(i)+fr.getBorderBottomWidth(i),t=fr.getPaddingTop(i)+fr.getPaddingBottom(i);return i.offsetHeight-e-t}function $m(i){const e=fr.getMarginTop(i)+fr.getMarginBottom(i);return i.offsetHeight+e}function go(i,e){return!!(e!=null&&e.contains(i))}function jEt(i,e,t){for(;i&&i.nodeType===i.ELEMENT_NODE;){if(i.classList.contains(e))return i;if(t){if(typeof t=="string"){if(i.classList.contains(t))return null}else if(i===t)return null}i=i.parentNode}return null}function g$(i,e,t){return!!jEt(i,e,t)}function a2e(i){return i&&!!i.host&&!!i.mode}function dF(i){return!!I_(i)}function I_(i){var e;for(;i.parentNode;){if(i===((e=i.ownerDocument)==null?void 0:e.body))return null;i=i.parentNode}return a2e(i)?i:null}function eo(){let i=bP().activeElement;for(;i!=null&&i.shadowRoot;)i=i.shadowRoot.activeElement;return i}function nH(i){return eo()===i}function l2e(i){return go(eo(),i)}function bP(){return LEt()<=1?hi.document:Array.from(n2e()).map(({window:e})=>e.document).find(e=>e.hasFocus())??hi.document}function oi(){var e;return((e=bP().defaultView)==null?void 0:e.window)??hi}const FEt=new class{constructor(){this.mutationObservers=new Map}observe(i,e,t){let n=this.mutationObservers.get(i);n||(n=new Map,this.mutationObservers.set(i,n));const s=pP(t);let r=n.get(s);if(r)r.users+=1;else{const o=new se,a=new MutationObserver(c=>o.fire(c));a.observe(i,t);const l=r={users:1,observer:a,onDidMutate:o.event};e.add(ut(()=>{l.users-=1,l.users===0&&(o.dispose(),a.disconnect(),n==null||n.delete(s),(n==null?void 0:n.size)===0&&this.mutationObservers.delete(i))})),n.set(s,r)}return r.onDidMutate}};function Qs(i){return i instanceof HTMLElement||i instanceof xt(i).HTMLElement}function Kbe(i){return i instanceof HTMLAnchorElement||i instanceof xt(i).HTMLAnchorElement}function c2e(i){return i instanceof SVGElement||i instanceof xt(i).SVGElement}function Hre(i){return i instanceof MouseEvent||i instanceof xt(i).MouseEvent}function Em(i){return i instanceof KeyboardEvent||i instanceof xt(i).KeyboardEvent}const Pe={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend"};function BEt(i){const e=i;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const Wn={stop:(i,e)=>(i.preventDefault(),e&&i.stopPropagation(),i)};function HEt(i){const e=[];for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)e[t]=i.scrollTop,i=i.parentNode;return e}function WEt(i,e){for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)i.scrollTop!==e[t]&&(i.scrollTop=e[t]),i=i.parentNode}let VEt=class EY extends re{get onDidFocus(){return this._onDidFocus.event}get onDidBlur(){return this._onDidBlur.event}static hasFocusWithin(e){if(Qs(e)){const t=I_(e),n=t?t.activeElement:e.ownerDocument.activeElement;return go(n,e)}else{const t=e;return go(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new se),this._onDidBlur=this._register(new se);let t=EY.hasFocusWithin(e),n=!1;const s=()=>{n=!1,t||(t=!0,this._onDidFocus.fire())},r=()=>{t&&(n=!0,(Qs(e)?xt(e):e).setTimeout(()=>{n&&(n=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{EY.hasFocusWithin(e)!==t&&(t?r():s())},this._register(de(e,Pe.FOCUS,s,!0)),this._register(de(e,Pe.BLUR,r,!0)),Qs(e)&&(this._register(de(e,Pe.FOCUS_IN,()=>this._refreshStateHandler())),this._register(de(e,Pe.FOCUS_OUT,()=>this._refreshStateHandler())))}};function Lu(i){return new VEt(i)}function zEt(i,e){return i.after(e),e}function Le(i,...e){if(i.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function iH(i,e){return i.insertBefore(e,i.firstChild),e}function fo(i,...e){i.textContent="",Le(i,...e)}const UEt=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var VA;(function(i){i.HTML="http://www.w3.org/1999/xhtml",i.SVG="http://www.w3.org/2000/svg"})(VA||(VA={}));function d2e(i,e,t,...n){const s=UEt.exec(e);if(!s)throw new Error("Bad use of emmet");const r=s[1]||"div";let o;return i!==VA.HTML?o=document.createElementNS(i,r):o=document.createElement(r),s[3]&&(o.id=s[3]),s[4]&&(o.className=s[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?o[a]=l:a==="selected"?l&&o.setAttribute(a,"true"):o.setAttribute(a,l))}),o.append(...n),o}function Re(i,e,...t){return d2e(VA.HTML,i,e,...t)}Re.SVG=function(i,e,...t){return d2e(VA.SVG,i,e,...t)};function $Et(i,...e){i?Nc(...e):vl(...e)}function Nc(...i){for(const e of i)e.style.display="",e.removeAttribute("aria-hidden")}function vl(...i){for(const e of i)e.style.display="none",e.setAttribute("aria-hidden","true")}function Gbe(i,e){const t=i.devicePixelRatio*e;return Math.max(1,Math.floor(t))/i.devicePixelRatio}function u2e(i){hi.open(i,"_blank","noopener")}function qEt(i,e){const t=()=>{e(),n=rc(i,t)};let n=rc(i,t);return ut(()=>n.dispose())}VTe.setPreferredWebSchema(/^https:/.test(hi.location.href)?"https":"http");class qm extends se{constructor(){super(),this._subscriptions=new ve,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(je.runAndSubscribe(mP,({window:e,disposables:t})=>this.registerListeners(e,t),{window:hi,disposables:this._subscriptions}))}registerListeners(e,t){t.add(de(e,"keydown",n=>{if(n.defaultPrevented)return;const s=new yi(n);if(!(s.keyCode===6&&n.repeat)){if(n.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(n.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(n.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(n.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(s.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=n.altKey,this._keyStatus.ctrlKey=n.ctrlKey,this._keyStatus.metaKey=n.metaKey,this._keyStatus.shiftKey=n.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=n,this.fire(this._keyStatus))}},!0)),t.add(de(e,"keyup",n=>{n.defaultPrevented||(!n.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!n.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!n.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!n.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=n.altKey,this._keyStatus.ctrlKey=n.ctrlKey,this._keyStatus.metaKey=n.metaKey,this._keyStatus.shiftKey=n.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=n,this.fire(this._keyStatus)))},!0)),t.add(de(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(de(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(de(e.document.body,"mousemove",n=>{n.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(de(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return qm.instance||(qm.instance=new qm),qm.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class KEt extends re{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(de(this.element,Pe.DRAG_START,e=>{var t,n;(n=(t=this.callbacks).onDragStart)==null||n.call(t,e)})),this.callbacks.onDrag&&this._register(de(this.element,Pe.DRAG,e=>{var t,n;(n=(t=this.callbacks).onDrag)==null||n.call(t,e)})),this._register(de(this.element,Pe.DRAG_ENTER,e=>{var t,n;this.counter++,this.dragStartTime=e.timeStamp,(n=(t=this.callbacks).onDragEnter)==null||n.call(t,e)})),this._register(de(this.element,Pe.DRAG_OVER,e=>{var t,n;e.preventDefault(),(n=(t=this.callbacks).onDragOver)==null||n.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(de(this.element,Pe.DRAG_LEAVE,e=>{var t,n;this.counter--,this.counter===0&&(this.dragStartTime=0,(n=(t=this.callbacks).onDragLeave)==null||n.call(t,e))})),this._register(de(this.element,Pe.DRAG_END,e=>{var t,n;this.counter=0,this.dragStartTime=0,(n=(t=this.callbacks).onDragEnd)==null||n.call(t,e)})),this._register(de(this.element,Pe.DROP,e=>{var t,n;this.counter=0,this.dragStartTime=0,(n=(t=this.callbacks).onDrop)==null||n.call(t,e)}))}}const GEt=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function On(i,...e){let t,n;Array.isArray(e[0])?(t={},n=e[0]):(t=e[0]||{},n=e[1]);const s=GEt.exec(i);if(!s||!s.groups)throw new Error("Bad use of h");const r=s.groups.tag||"div",o=document.createElement(r);s.groups.id&&(o.id=s.groups.id);const a=[];if(s.groups.class)for(const c of s.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(o.className=a.join(" "));const l={};if(s.groups.name&&(l[s.groups.name]=o),n)for(const c of n)Qs(c)?o.appendChild(c):typeof c=="string"?o.append(c):"root"in c&&(Object.assign(l,c),o.appendChild(c.root));for(const[c,u]of Object.entries(t))if(c!=="className")if(c==="style")for(const[h,g]of Object.entries(u))o.style.setProperty(zA(h),typeof g=="number"?g+"px":""+g);else c==="tabIndex"?o.tabIndex=u:o.setAttribute(zA(c),u.toString());return l.root=o,l}function zA(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function xg(i){return i.tagName.toLowerCase()==="input"||i.tagName.toLowerCase()==="textarea"||Qs(i)&&!!i.editContext}var Xt;(function(i){function e(s=void 0){return(r,o,a)=>{const l=o.class;delete o.class;const c=o.ref;delete o.ref;const u=o.obsRef;return delete o.obsRef,new QEt(r,c,u,s,l,o,a)}}function t(s,r=void 0){const o=e(r);return(a,l)=>o(s,a,l)}i.div=t("div"),i.elem=e(void 0),i.svg=t("svg","http://www.w3.org/2000/svg"),i.svgElem=e("http://www.w3.org/2000/svg");function n(){let s;const r=function(o){s=o};return Object.defineProperty(r,"element",{get(){if(!s)throw new St("Make sure the ref is set before accessing the element. Maybe wrong initialization order?");return s}}),r}i.ref=n})(Xt||(Xt={}));class Wre{constructor(e,t,n,s,r,o,a){this._deriveds=[],this._element=s?document.createElementNS(s,e):document.createElement(e),t&&t(this._element),n&&this._deriveds.push(we(l=>{n(this),l.store.add({dispose:()=>{n(null)}})})),r&&(g2e(r)?this._deriveds.push(we(this,l=>{Ybe(this._element,Qbe(r,l))})):Ybe(this._element,Qbe(r,void 0)));for(const[l,c]of Object.entries(o))if(l==="style")for(const[u,h]of Object.entries(c)){const g=zA(u);Hy(h)?this._deriveds.push(aa({owner:this,debugName:()=>`set.style.${g}`},f=>{this._element.style.setProperty(g,Xbe(h.read(f)))})):this._element.style.setProperty(g,Xbe(h))}else l==="tabIndex"?Hy(c)?this._deriveds.push(we(this,u=>{this._element.tabIndex=c.read(u)})):this._element.tabIndex=c:l.startsWith("on")?this._element[l]=c:Hy(c)?this._deriveds.push(aa({owner:this,debugName:()=>`set.${l}`},u=>{Zbe(this._element,l,c.read(u))})):Zbe(this._element,l,c);if(a){let l=function(u,h){return Hy(h)?l(u,h.read(u)):Array.isArray(h)?h.flatMap(g=>l(u,g)):h instanceof Wre?(u&&h.readEffect(u),[h._element]):h?[h]:[]};const c=we(this,u=>{this._element.replaceChildren(...l(u,a))});this._deriveds.push(c),f2e(a)||c.get()}}readEffect(e){for(const t of this._deriveds)t.read(e)}keepUpdated(e){return we(t=>{this.readEffect(t)}).recomputeInitiallyAndOnChange(e),this}toDisposableLiveElement(){const e=new ve;return this.keepUpdated(e),new YEt(this._element,e)}}function Ybe(i,e){c2e(i)?i.setAttribute("class",e):i.className=e}function h2e(i,e,t){if(Hy(i)){t(i.read(e));return}if(Array.isArray(i)){for(const n of i)h2e(n,e,t);return}t(i)}function Qbe(i,e){let t="";return h2e(i,e,n=>{n&&(t.length===0?t=n:t+=" "+n)}),t}function g2e(i){return Hy(i)?!0:Array.isArray(i)?i.some(e=>g2e(e)):!1}function Xbe(i){return typeof i=="number"?i+"px":i}function f2e(i){return Hy(i)?!0:Array.isArray(i)?i.some(e=>f2e(e)):!1}class YEt{constructor(e,t){this.element=e,this._disposable=t}dispose(){this._disposable.dispose()}}class QEt extends Wre{constructor(){super(...arguments),this._isHovered=void 0,this._didMouseMoveDuringHover=void 0}get element(){return this._element}get isHovered(){if(!this._isHovered){const e=Ot("hovered",!1);this._element.addEventListener("mouseenter",t=>e.set(!0,void 0)),this._element.addEventListener("mouseleave",t=>e.set(!1,void 0)),this._isHovered=e}return this._isHovered}get didMouseMoveDuringHover(){if(!this._didMouseMoveDuringHover){let e=!1;const t=Ot("didMouseMoveDuringHover",!1);this._element.addEventListener("mouseenter",n=>{e=!0}),this._element.addEventListener("mousemove",n=>{e&&t.set(!0,void 0)}),this._element.addEventListener("mouseleave",n=>{e=!1,t.set(!1,void 0)}),this._didMouseMoveDuringHover=t}return this._didMouseMoveDuringHover}}function Zbe(i,e,t){t==null?i.removeAttribute(zA(e)):i.setAttribute(zA(e),String(t))}function Hy(i){return!!i&&i.read!==void 0&&i.reportChanges!==void 0}const Jbe=2e4;let ly,A4,LY,R4,DY;function XEt(i){ly=document.createElement("div"),ly.className="monaco-aria-container";const e=()=>{const n=document.createElement("div");return n.className="monaco-alert",n.setAttribute("role","alert"),n.setAttribute("aria-atomic","true"),ly.appendChild(n),n};A4=e(),LY=e();const t=()=>{const n=document.createElement("div");return n.className="monaco-status",n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),ly.appendChild(n),n};R4=t(),DY=t(),i.appendChild(ly)}function Dl(i){ly&&(A4.textContent!==i?(Wo(LY),uF(A4,i)):(Wo(A4),uF(LY,i)))}function Ng(i){ly&&(R4.textContent!==i?(Wo(DY),uF(R4,i)):(Wo(R4),uF(DY,i)))}function uF(i,e){Wo(i),e.length>Jbe&&(e=e.substr(0,Jbe)),i.textContent=e,i.style.visibility="hidden",i.style.visibility="visible"}var gg;(function(i){i.serviceIds=new Map,i.DI_TARGET="$di$target",i.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[i.DI_DEPENDENCIES]||[]}i.getServiceDependencies=e})(gg||(gg={}));const pt=rn("instantiationService");function ZEt(i,e,t){e[gg.DI_TARGET]===e?e[gg.DI_DEPENDENCIES].push({id:i,index:t}):(e[gg.DI_DEPENDENCIES]=[{id:i,index:t}],e[gg.DI_TARGET]=e)}function rn(i){if(gg.serviceIds.has(i))return gg.serviceIds.get(i);const e=function(t,n,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ZEt(e,t,s)};return e.toString=()=>i,gg.serviceIds.set(i,e),e}const Fn=rn("codeEditorService");let ie=class Q0{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new Q0(e,t)}delta(e=0,t=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+t))}equals(e){return Q0.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Q0.isBefore(this,e)}static isBefore(e,t){return e.lineNumberi.run(...e)}}const IY=Object.create(null);function F(i,e){if(ho(e)){const t=IY[e];if(t===void 0)throw new Error(`${i} references an unknown codicon: ${e}`);e=t}return IY[i]=e,{id:i}}function p2e(){return IY}const JEt={add:F("add",6e4),plus:F("plus",6e4),gistNew:F("gist-new",6e4),repoCreate:F("repo-create",6e4),lightbulb:F("lightbulb",60001),lightBulb:F("light-bulb",60001),repo:F("repo",60002),repoDelete:F("repo-delete",60002),gistFork:F("gist-fork",60003),repoForked:F("repo-forked",60003),gitPullRequest:F("git-pull-request",60004),gitPullRequestAbandoned:F("git-pull-request-abandoned",60004),recordKeys:F("record-keys",60005),keyboard:F("keyboard",60005),tag:F("tag",60006),gitPullRequestLabel:F("git-pull-request-label",60006),tagAdd:F("tag-add",60006),tagRemove:F("tag-remove",60006),person:F("person",60007),personFollow:F("person-follow",60007),personOutline:F("person-outline",60007),personFilled:F("person-filled",60007),sourceControl:F("source-control",60008),mirror:F("mirror",60009),mirrorPublic:F("mirror-public",60009),star:F("star",60010),starAdd:F("star-add",60010),starDelete:F("star-delete",60010),starEmpty:F("star-empty",60010),comment:F("comment",60011),commentAdd:F("comment-add",60011),alert:F("alert",60012),warning:F("warning",60012),search:F("search",60013),searchSave:F("search-save",60013),logOut:F("log-out",60014),signOut:F("sign-out",60014),logIn:F("log-in",60015),signIn:F("sign-in",60015),eye:F("eye",60016),eyeUnwatch:F("eye-unwatch",60016),eyeWatch:F("eye-watch",60016),circleFilled:F("circle-filled",60017),primitiveDot:F("primitive-dot",60017),closeDirty:F("close-dirty",60017),debugBreakpoint:F("debug-breakpoint",60017),debugBreakpointDisabled:F("debug-breakpoint-disabled",60017),debugHint:F("debug-hint",60017),terminalDecorationSuccess:F("terminal-decoration-success",60017),primitiveSquare:F("primitive-square",60018),edit:F("edit",60019),pencil:F("pencil",60019),info:F("info",60020),issueOpened:F("issue-opened",60020),gistPrivate:F("gist-private",60021),gitForkPrivate:F("git-fork-private",60021),lock:F("lock",60021),mirrorPrivate:F("mirror-private",60021),close:F("close",60022),removeClose:F("remove-close",60022),x:F("x",60022),repoSync:F("repo-sync",60023),sync:F("sync",60023),clone:F("clone",60024),desktopDownload:F("desktop-download",60024),beaker:F("beaker",60025),microscope:F("microscope",60025),vm:F("vm",60026),deviceDesktop:F("device-desktop",60026),file:F("file",60027),more:F("more",60028),ellipsis:F("ellipsis",60028),kebabHorizontal:F("kebab-horizontal",60028),mailReply:F("mail-reply",60029),reply:F("reply",60029),organization:F("organization",60030),organizationFilled:F("organization-filled",60030),organizationOutline:F("organization-outline",60030),newFile:F("new-file",60031),fileAdd:F("file-add",60031),newFolder:F("new-folder",60032),fileDirectoryCreate:F("file-directory-create",60032),trash:F("trash",60033),trashcan:F("trashcan",60033),history:F("history",60034),clock:F("clock",60034),folder:F("folder",60035),fileDirectory:F("file-directory",60035),symbolFolder:F("symbol-folder",60035),logoGithub:F("logo-github",60036),markGithub:F("mark-github",60036),github:F("github",60036),terminal:F("terminal",60037),console:F("console",60037),repl:F("repl",60037),zap:F("zap",60038),symbolEvent:F("symbol-event",60038),error:F("error",60039),stop:F("stop",60039),variable:F("variable",60040),symbolVariable:F("symbol-variable",60040),array:F("array",60042),symbolArray:F("symbol-array",60042),symbolModule:F("symbol-module",60043),symbolPackage:F("symbol-package",60043),symbolNamespace:F("symbol-namespace",60043),symbolObject:F("symbol-object",60043),symbolMethod:F("symbol-method",60044),symbolFunction:F("symbol-function",60044),symbolConstructor:F("symbol-constructor",60044),symbolBoolean:F("symbol-boolean",60047),symbolNull:F("symbol-null",60047),symbolNumeric:F("symbol-numeric",60048),symbolNumber:F("symbol-number",60048),symbolStructure:F("symbol-structure",60049),symbolStruct:F("symbol-struct",60049),symbolParameter:F("symbol-parameter",60050),symbolTypeParameter:F("symbol-type-parameter",60050),symbolKey:F("symbol-key",60051),symbolText:F("symbol-text",60051),symbolReference:F("symbol-reference",60052),goToFile:F("go-to-file",60052),symbolEnum:F("symbol-enum",60053),symbolValue:F("symbol-value",60053),symbolRuler:F("symbol-ruler",60054),symbolUnit:F("symbol-unit",60054),activateBreakpoints:F("activate-breakpoints",60055),archive:F("archive",60056),arrowBoth:F("arrow-both",60057),arrowDown:F("arrow-down",60058),arrowLeft:F("arrow-left",60059),arrowRight:F("arrow-right",60060),arrowSmallDown:F("arrow-small-down",60061),arrowSmallLeft:F("arrow-small-left",60062),arrowSmallRight:F("arrow-small-right",60063),arrowSmallUp:F("arrow-small-up",60064),arrowUp:F("arrow-up",60065),bell:F("bell",60066),bold:F("bold",60067),book:F("book",60068),bookmark:F("bookmark",60069),debugBreakpointConditionalUnverified:F("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:F("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:F("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:F("debug-breakpoint-data-unverified",60072),debugBreakpointData:F("debug-breakpoint-data",60073),debugBreakpointDataDisabled:F("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:F("debug-breakpoint-log-unverified",60074),debugBreakpointLog:F("debug-breakpoint-log",60075),debugBreakpointLogDisabled:F("debug-breakpoint-log-disabled",60075),briefcase:F("briefcase",60076),broadcast:F("broadcast",60077),browser:F("browser",60078),bug:F("bug",60079),calendar:F("calendar",60080),caseSensitive:F("case-sensitive",60081),check:F("check",60082),checklist:F("checklist",60083),chevronDown:F("chevron-down",60084),chevronLeft:F("chevron-left",60085),chevronRight:F("chevron-right",60086),chevronUp:F("chevron-up",60087),chromeClose:F("chrome-close",60088),chromeMaximize:F("chrome-maximize",60089),chromeMinimize:F("chrome-minimize",60090),chromeRestore:F("chrome-restore",60091),circleOutline:F("circle-outline",60092),circle:F("circle",60092),debugBreakpointUnverified:F("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:F("terminal-decoration-incomplete",60092),circleSlash:F("circle-slash",60093),circuitBoard:F("circuit-board",60094),clearAll:F("clear-all",60095),clippy:F("clippy",60096),closeAll:F("close-all",60097),cloudDownload:F("cloud-download",60098),cloudUpload:F("cloud-upload",60099),code:F("code",60100),collapseAll:F("collapse-all",60101),colorMode:F("color-mode",60102),commentDiscussion:F("comment-discussion",60103),creditCard:F("credit-card",60105),dash:F("dash",60108),dashboard:F("dashboard",60109),database:F("database",60110),debugContinue:F("debug-continue",60111),debugDisconnect:F("debug-disconnect",60112),debugPause:F("debug-pause",60113),debugRestart:F("debug-restart",60114),debugStart:F("debug-start",60115),debugStepInto:F("debug-step-into",60116),debugStepOut:F("debug-step-out",60117),debugStepOver:F("debug-step-over",60118),debugStop:F("debug-stop",60119),debug:F("debug",60120),deviceCameraVideo:F("device-camera-video",60121),deviceCamera:F("device-camera",60122),deviceMobile:F("device-mobile",60123),diffAdded:F("diff-added",60124),diffIgnored:F("diff-ignored",60125),diffModified:F("diff-modified",60126),diffRemoved:F("diff-removed",60127),diffRenamed:F("diff-renamed",60128),diff:F("diff",60129),diffSidebyside:F("diff-sidebyside",60129),discard:F("discard",60130),editorLayout:F("editor-layout",60131),emptyWindow:F("empty-window",60132),exclude:F("exclude",60133),extensions:F("extensions",60134),eyeClosed:F("eye-closed",60135),fileBinary:F("file-binary",60136),fileCode:F("file-code",60137),fileMedia:F("file-media",60138),filePdf:F("file-pdf",60139),fileSubmodule:F("file-submodule",60140),fileSymlinkDirectory:F("file-symlink-directory",60141),fileSymlinkFile:F("file-symlink-file",60142),fileZip:F("file-zip",60143),files:F("files",60144),filter:F("filter",60145),flame:F("flame",60146),foldDown:F("fold-down",60147),foldUp:F("fold-up",60148),fold:F("fold",60149),folderActive:F("folder-active",60150),folderOpened:F("folder-opened",60151),gear:F("gear",60152),gift:F("gift",60153),gistSecret:F("gist-secret",60154),gist:F("gist",60155),gitCommit:F("git-commit",60156),gitCompare:F("git-compare",60157),compareChanges:F("compare-changes",60157),gitMerge:F("git-merge",60158),githubAction:F("github-action",60159),githubAlt:F("github-alt",60160),globe:F("globe",60161),grabber:F("grabber",60162),graph:F("graph",60163),gripper:F("gripper",60164),heart:F("heart",60165),home:F("home",60166),horizontalRule:F("horizontal-rule",60167),hubot:F("hubot",60168),inbox:F("inbox",60169),issueReopened:F("issue-reopened",60171),issues:F("issues",60172),italic:F("italic",60173),jersey:F("jersey",60174),json:F("json",60175),kebabVertical:F("kebab-vertical",60176),key:F("key",60177),law:F("law",60178),lightbulbAutofix:F("lightbulb-autofix",60179),linkExternal:F("link-external",60180),link:F("link",60181),listOrdered:F("list-ordered",60182),listUnordered:F("list-unordered",60183),liveShare:F("live-share",60184),loading:F("loading",60185),location:F("location",60186),mailRead:F("mail-read",60187),mail:F("mail",60188),markdown:F("markdown",60189),megaphone:F("megaphone",60190),mention:F("mention",60191),milestone:F("milestone",60192),gitPullRequestMilestone:F("git-pull-request-milestone",60192),mortarBoard:F("mortar-board",60193),move:F("move",60194),multipleWindows:F("multiple-windows",60195),mute:F("mute",60196),noNewline:F("no-newline",60197),note:F("note",60198),octoface:F("octoface",60199),openPreview:F("open-preview",60200),package:F("package",60201),paintcan:F("paintcan",60202),pin:F("pin",60203),play:F("play",60204),run:F("run",60204),plug:F("plug",60205),preserveCase:F("preserve-case",60206),preview:F("preview",60207),project:F("project",60208),pulse:F("pulse",60209),question:F("question",60210),quote:F("quote",60211),radioTower:F("radio-tower",60212),reactions:F("reactions",60213),references:F("references",60214),refresh:F("refresh",60215),regex:F("regex",60216),remoteExplorer:F("remote-explorer",60217),remote:F("remote",60218),remove:F("remove",60219),replaceAll:F("replace-all",60220),replace:F("replace",60221),repoClone:F("repo-clone",60222),repoForcePush:F("repo-force-push",60223),repoPull:F("repo-pull",60224),repoPush:F("repo-push",60225),report:F("report",60226),requestChanges:F("request-changes",60227),rocket:F("rocket",60228),rootFolderOpened:F("root-folder-opened",60229),rootFolder:F("root-folder",60230),rss:F("rss",60231),ruby:F("ruby",60232),saveAll:F("save-all",60233),saveAs:F("save-as",60234),save:F("save",60235),screenFull:F("screen-full",60236),screenNormal:F("screen-normal",60237),searchStop:F("search-stop",60238),server:F("server",60240),settingsGear:F("settings-gear",60241),settings:F("settings",60242),shield:F("shield",60243),smiley:F("smiley",60244),sortPrecedence:F("sort-precedence",60245),splitHorizontal:F("split-horizontal",60246),splitVertical:F("split-vertical",60247),squirrel:F("squirrel",60248),starFull:F("star-full",60249),starHalf:F("star-half",60250),symbolClass:F("symbol-class",60251),symbolColor:F("symbol-color",60252),symbolConstant:F("symbol-constant",60253),symbolEnumMember:F("symbol-enum-member",60254),symbolField:F("symbol-field",60255),symbolFile:F("symbol-file",60256),symbolInterface:F("symbol-interface",60257),symbolKeyword:F("symbol-keyword",60258),symbolMisc:F("symbol-misc",60259),symbolOperator:F("symbol-operator",60260),symbolProperty:F("symbol-property",60261),wrench:F("wrench",60261),wrenchSubaction:F("wrench-subaction",60261),symbolSnippet:F("symbol-snippet",60262),tasklist:F("tasklist",60263),telescope:F("telescope",60264),textSize:F("text-size",60265),threeBars:F("three-bars",60266),thumbsdown:F("thumbsdown",60267),thumbsup:F("thumbsup",60268),tools:F("tools",60269),triangleDown:F("triangle-down",60270),triangleLeft:F("triangle-left",60271),triangleRight:F("triangle-right",60272),triangleUp:F("triangle-up",60273),twitter:F("twitter",60274),unfold:F("unfold",60275),unlock:F("unlock",60276),unmute:F("unmute",60277),unverified:F("unverified",60278),verified:F("verified",60279),versions:F("versions",60280),vmActive:F("vm-active",60281),vmOutline:F("vm-outline",60282),vmRunning:F("vm-running",60283),watch:F("watch",60284),whitespace:F("whitespace",60285),wholeWord:F("whole-word",60286),window:F("window",60287),wordWrap:F("word-wrap",60288),zoomIn:F("zoom-in",60289),zoomOut:F("zoom-out",60290),listFilter:F("list-filter",60291),listFlat:F("list-flat",60292),listSelection:F("list-selection",60293),selection:F("selection",60293),listTree:F("list-tree",60294),debugBreakpointFunctionUnverified:F("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:F("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:F("debug-breakpoint-function-disabled",60296),debugStackframeActive:F("debug-stackframe-active",60297),circleSmallFilled:F("circle-small-filled",60298),debugStackframeDot:F("debug-stackframe-dot",60298),terminalDecorationMark:F("terminal-decoration-mark",60298),debugStackframe:F("debug-stackframe",60299),debugStackframeFocused:F("debug-stackframe-focused",60299),debugBreakpointUnsupported:F("debug-breakpoint-unsupported",60300),symbolString:F("symbol-string",60301),debugReverseContinue:F("debug-reverse-continue",60302),debugStepBack:F("debug-step-back",60303),debugRestartFrame:F("debug-restart-frame",60304),debugAlt:F("debug-alt",60305),callIncoming:F("call-incoming",60306),callOutgoing:F("call-outgoing",60307),menu:F("menu",60308),expandAll:F("expand-all",60309),feedback:F("feedback",60310),gitPullRequestReviewer:F("git-pull-request-reviewer",60310),groupByRefType:F("group-by-ref-type",60311),ungroupByRefType:F("ungroup-by-ref-type",60312),account:F("account",60313),gitPullRequestAssignee:F("git-pull-request-assignee",60313),bellDot:F("bell-dot",60314),debugConsole:F("debug-console",60315),library:F("library",60316),output:F("output",60317),runAll:F("run-all",60318),syncIgnored:F("sync-ignored",60319),pinned:F("pinned",60320),githubInverted:F("github-inverted",60321),serverProcess:F("server-process",60322),serverEnvironment:F("server-environment",60323),pass:F("pass",60324),issueClosed:F("issue-closed",60324),stopCircle:F("stop-circle",60325),playCircle:F("play-circle",60326),record:F("record",60327),debugAltSmall:F("debug-alt-small",60328),vmConnect:F("vm-connect",60329),cloud:F("cloud",60330),merge:F("merge",60331),export:F("export",60332),graphLeft:F("graph-left",60333),magnet:F("magnet",60334),notebook:F("notebook",60335),redo:F("redo",60336),checkAll:F("check-all",60337),pinnedDirty:F("pinned-dirty",60338),passFilled:F("pass-filled",60339),circleLargeFilled:F("circle-large-filled",60340),circleLarge:F("circle-large",60341),circleLargeOutline:F("circle-large-outline",60341),combine:F("combine",60342),gather:F("gather",60342),table:F("table",60343),variableGroup:F("variable-group",60344),typeHierarchy:F("type-hierarchy",60345),typeHierarchySub:F("type-hierarchy-sub",60346),typeHierarchySuper:F("type-hierarchy-super",60347),gitPullRequestCreate:F("git-pull-request-create",60348),runAbove:F("run-above",60349),runBelow:F("run-below",60350),notebookTemplate:F("notebook-template",60351),debugRerun:F("debug-rerun",60352),workspaceTrusted:F("workspace-trusted",60353),workspaceUntrusted:F("workspace-untrusted",60354),workspaceUnknown:F("workspace-unknown",60355),terminalCmd:F("terminal-cmd",60356),terminalDebian:F("terminal-debian",60357),terminalLinux:F("terminal-linux",60358),terminalPowershell:F("terminal-powershell",60359),terminalTmux:F("terminal-tmux",60360),terminalUbuntu:F("terminal-ubuntu",60361),terminalBash:F("terminal-bash",60362),arrowSwap:F("arrow-swap",60363),copy:F("copy",60364),personAdd:F("person-add",60365),filterFilled:F("filter-filled",60366),wand:F("wand",60367),debugLineByLine:F("debug-line-by-line",60368),inspect:F("inspect",60369),layers:F("layers",60370),layersDot:F("layers-dot",60371),layersActive:F("layers-active",60372),compass:F("compass",60373),compassDot:F("compass-dot",60374),compassActive:F("compass-active",60375),azure:F("azure",60376),issueDraft:F("issue-draft",60377),gitPullRequestClosed:F("git-pull-request-closed",60378),gitPullRequestDraft:F("git-pull-request-draft",60379),debugAll:F("debug-all",60380),debugCoverage:F("debug-coverage",60381),runErrors:F("run-errors",60382),folderLibrary:F("folder-library",60383),debugContinueSmall:F("debug-continue-small",60384),beakerStop:F("beaker-stop",60385),graphLine:F("graph-line",60386),graphScatter:F("graph-scatter",60387),pieChart:F("pie-chart",60388),bracket:F("bracket",60175),bracketDot:F("bracket-dot",60389),bracketError:F("bracket-error",60390),lockSmall:F("lock-small",60391),azureDevops:F("azure-devops",60392),verifiedFilled:F("verified-filled",60393),newline:F("newline",60394),layout:F("layout",60395),layoutActivitybarLeft:F("layout-activitybar-left",60396),layoutActivitybarRight:F("layout-activitybar-right",60397),layoutPanelLeft:F("layout-panel-left",60398),layoutPanelCenter:F("layout-panel-center",60399),layoutPanelJustify:F("layout-panel-justify",60400),layoutPanelRight:F("layout-panel-right",60401),layoutPanel:F("layout-panel",60402),layoutSidebarLeft:F("layout-sidebar-left",60403),layoutSidebarRight:F("layout-sidebar-right",60404),layoutStatusbar:F("layout-statusbar",60405),layoutMenubar:F("layout-menubar",60406),layoutCentered:F("layout-centered",60407),target:F("target",60408),indent:F("indent",60409),recordSmall:F("record-small",60410),errorSmall:F("error-small",60411),terminalDecorationError:F("terminal-decoration-error",60411),arrowCircleDown:F("arrow-circle-down",60412),arrowCircleLeft:F("arrow-circle-left",60413),arrowCircleRight:F("arrow-circle-right",60414),arrowCircleUp:F("arrow-circle-up",60415),layoutSidebarRightOff:F("layout-sidebar-right-off",60416),layoutPanelOff:F("layout-panel-off",60417),layoutSidebarLeftOff:F("layout-sidebar-left-off",60418),blank:F("blank",60419),heartFilled:F("heart-filled",60420),map:F("map",60421),mapHorizontal:F("map-horizontal",60421),foldHorizontal:F("fold-horizontal",60421),mapFilled:F("map-filled",60422),mapHorizontalFilled:F("map-horizontal-filled",60422),foldHorizontalFilled:F("fold-horizontal-filled",60422),circleSmall:F("circle-small",60423),bellSlash:F("bell-slash",60424),bellSlashDot:F("bell-slash-dot",60425),commentUnresolved:F("comment-unresolved",60426),gitPullRequestGoToChanges:F("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:F("git-pull-request-new-changes",60428),searchFuzzy:F("search-fuzzy",60429),commentDraft:F("comment-draft",60430),send:F("send",60431),sparkle:F("sparkle",60432),insert:F("insert",60433),mic:F("mic",60434),thumbsdownFilled:F("thumbsdown-filled",60435),thumbsupFilled:F("thumbsup-filled",60436),coffee:F("coffee",60437),snake:F("snake",60438),game:F("game",60439),vr:F("vr",60440),chip:F("chip",60441),piano:F("piano",60442),music:F("music",60443),micFilled:F("mic-filled",60444),repoFetch:F("repo-fetch",60445),copilot:F("copilot",60446),lightbulbSparkle:F("lightbulb-sparkle",60447),robot:F("robot",60448),sparkleFilled:F("sparkle-filled",60449),diffSingle:F("diff-single",60450),diffMultiple:F("diff-multiple",60451),surroundWith:F("surround-with",60452),share:F("share",60453),gitStash:F("git-stash",60454),gitStashApply:F("git-stash-apply",60455),gitStashPop:F("git-stash-pop",60456),vscode:F("vscode",60457),vscodeInsiders:F("vscode-insiders",60458),codeOss:F("code-oss",60459),runCoverage:F("run-coverage",60460),runAllCoverage:F("run-all-coverage",60461),coverage:F("coverage",60462),githubProject:F("github-project",60463),mapVertical:F("map-vertical",60464),foldVertical:F("fold-vertical",60464),mapVerticalFilled:F("map-vertical-filled",60465),foldVerticalFilled:F("fold-vertical-filled",60465),goToSearch:F("go-to-search",60466),percentage:F("percentage",60467),sortPercentage:F("sort-percentage",60467),attach:F("attach",60468),goToEditingSession:F("go-to-editing-session",60469),editSession:F("edit-session",60470),codeReview:F("code-review",60471),copilotWarning:F("copilot-warning",60472),python:F("python",60473),copilotLarge:F("copilot-large",60474),copilotWarningLarge:F("copilot-warning-large",60475),keyboardTab:F("keyboard-tab",60476),copilotBlocked:F("copilot-blocked",60477),copilotNotConnected:F("copilot-not-connected",60478),flag:F("flag",60479),lightbulbEmpty:F("lightbulb-empty",60480),symbolMethodArrow:F("symbol-method-arrow",60481),copilotUnavailable:F("copilot-unavailable",60482),repoPinned:F("repo-pinned",60483),keyboardTabAbove:F("keyboard-tab-above",60484),keyboardTabBelow:F("keyboard-tab-below",60485),gitPullRequestDone:F("git-pull-request-done",60486),mcp:F("mcp",60487),extensionsLarge:F("extensions-large",60488),layoutPanelDock:F("layout-panel-dock",60489),layoutSidebarLeftDock:F("layout-sidebar-left-dock",60490),layoutSidebarRightDock:F("layout-sidebar-right-dock",60491),copilotInProgress:F("copilot-in-progress",60492),copilotError:F("copilot-error",60493),copilotSuccess:F("copilot-success",60494),chatSparkle:F("chat-sparkle",60495),searchSparkle:F("search-sparkle",60496),editSparkle:F("edit-sparkle",60497),copilotSnooze:F("copilot-snooze",60498),sendToRemoteAgent:F("send-to-remote-agent",60499),commentDiscussionSparkle:F("comment-discussion-sparkle",60500),chatSparkleWarning:F("chat-sparkle-warning",60501),chatSparkleError:F("chat-sparkle-error",60502),collection:F("collection",60503),newCollection:F("new-collection",60504),thinking:F("thinking",60505),build:F("build",60506),commentDiscussionQuote:F("comment-discussion-quote",60507),cursor:F("cursor",60508),eraser:F("eraser",60509),fileText:F("file-text",60510),gitLens:F("git-lens",60511),quotes:F("quotes",60512),rename:F("rename",60513),runWithDeps:F("run-with-deps",60514),debugConnected:F("debug-connected",60515),strikethrough:F("strikethrough",60516),openInProduct:F("open-in-product",60517),indexZero:F("index-zero",60518),agent:F("agent",60519),editCode:F("edit-code",60520),repoSelected:F("repo-selected",60521),skip:F("skip",60522),mergeInto:F("merge-into",60523),gitBranchChanges:F("git-branch-changes",60524),gitBranchStagedChanges:F("git-branch-staged-changes",60525),gitBranchConflicts:F("git-branch-conflicts",60526),gitBranch:F("git-branch",60527),gitBranchCreate:F("git-branch-create",60527),gitBranchDelete:F("git-branch-delete",60527),searchLarge:F("search-large",60528),terminalGitBash:F("terminal-git-bash",60529)},eLt={dialogError:F("dialog-error","error"),dialogWarning:F("dialog-warning","warning"),dialogInfo:F("dialog-info","info"),dialogClose:F("dialog-close","close"),treeItemExpanded:F("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:F("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:F("tree-filter-on-type-off","list-selection"),treeFilterClear:F("tree-filter-clear","close"),treeItemLoading:F("tree-item-loading","loading"),menuSelection:F("menu-selection","check"),menuSubmenu:F("menu-submenu","chevron-right"),menuBarMore:F("menubar-more","more"),scrollbarButtonLeft:F("scrollbar-button-left","triangle-left"),scrollbarButtonRight:F("scrollbar-button-right","triangle-right"),scrollbarButtonUp:F("scrollbar-button-up","triangle-up"),scrollbarButtonDown:F("scrollbar-button-down","triangle-down"),toolBarMore:F("toolbar-more","more"),quickInputBack:F("quick-input-back","arrow-left"),dropDownButton:F("drop-down-button",60084),symbolCustomColor:F("symbol-customcolor",60252),exportIcon:F("export",60332),workspaceUnspecified:F("workspace-unspecified",60355),newLine:F("newline",60394),thumbsDownFilled:F("thumbsdown-filled",60435),thumbsUpFilled:F("thumbsup-filled",60436),gitFetch:F("git-fetch",60445),lightbulbSparkleAutofix:F("lightbulb-sparkle-autofix",60447),debugBreakpointPending:F("debug-breakpoint-pending",60377)},Ee={...JEt,...eLt};var AY;(function(i){function e(t){return!!t&&typeof t=="object"&&typeof t.id=="string"}i.isThemeColor=e})(AY||(AY={}));var Lt;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9-]+",i.iconModifierExpression="~[A-Za-z]+",i.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function t(m){const x=e.exec(m.id);if(!x)return t(Ee.error);const[,v,_]=x,w=["codicon","codicon-"+v];return _&&w.push("codicon-modifier-"+_.substring(1)),w}i.asClassNameArray=t;function n(m){return t(m).join(" ")}i.asClassName=n;function s(m){return"."+t(m).join(".")}i.asCSSSelector=s;function r(m){return!!m&&typeof m=="object"&&typeof m.id=="string"&&(typeof m.color>"u"||AY.isThemeColor(m.color))}i.isThemeIcon=r;const o=new RegExp(`^\\$\\((${i.iconNameExpression}(?:${i.iconModifierExpression})?)\\)$`);function a(m){const x=o.exec(m);if(!x)return;const[,v]=x;return{id:v}}i.fromString=a;function l(m){return{id:m}}i.fromId=l;function c(m,x){let v=m.id;const _=v.lastIndexOf("~");return _!==-1&&(v=v.substring(0,_)),x&&(v=`${v}~${x}`),{id:v}}i.modify=c;function u(m){const x=m.id.lastIndexOf("~");if(x!==-1)return m.id.substring(x+1)}i.getModifier=u;function h(m,x){var v,_;return m.id===x.id&&((v=m.color)==null?void 0:v.id)===((_=x.color)==null?void 0:_.id)}i.isEqual=h;function g(m){return(m==null?void 0:m.id)===Ee.file.id}i.isFile=g;function f(m){return(m==null?void 0:m.id)===Ee.folder.id}i.isFolder=f})(Lt||(Lt={}));const Qi=rn("commandService"),Dn=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new se,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,e){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:i,handler:e})}if(i.metadata&&Array.isArray(i.metadata.args)){const o=[];for(const l of i.metadata.args)o.push(l.constraint);const a=i.handler;i.handler=function(l,...c){return _kt(c,o),a(l,...c)}}const{id:t}=i;let n=this._commands.get(t);n||(n=new Za,this._commands.set(t,n));const s=n.unshift(i),r=ut(()=>{s();const o=this._commands.get(t);o!=null&&o.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),r}registerCommandAlias(i,e){return Dn.registerCommand(i,(t,...n)=>t.get(Qi).executeCommand(e,...n))}getCommand(i){const e=this._commands.get(i);if(!(!e||e.isEmpty()))return Sn.first(e)}getCommands(){const i=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&i.set(e,t)}return i}};Dn.registerCommand("noop",()=>{});function f$(...i){switch(i.length){case 1:return S(1693,"Did you mean {0}?",i[0]);case 2:return S(1694,"Did you mean {0} or {1}?",i[0],i[1]);case 3:return S(1695,"Did you mean {0}, {1} or {2}?",i[0],i[1],i[2]);default:return}}const tLt=S(1696,"Did you forget to open or close the quote?"),nLt=S(1697,"Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");var eb;let RT=(eb=class{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw Xj(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(f$("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(f$("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(f$("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,n=this._input.substring(this._start,this._current),s={type:19,offset:this._start,lexeme:n};this._errors.push({offset:t,lexeme:n,additionalInfo:e}),this._tokens.push(s)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),n=eb._keywords.get(t);n?this._addToken(n):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(tLt);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,n=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(nLt);return}const r=this._input.charCodeAt(e);if(t)t=!1;else if(r===47&&!n){e++;break}else r===91?n=!0:r===92?t=!0:r===93&&(n=!1);e++}for(;e=this._input.length}},eb._regexFlags=new Set(["i","g","s","m","y","u"].map(e=>e.charCodeAt(0))),eb._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]),eb);const Ia=new Map;Ia.set("false",!1);Ia.set("true",!0);Ia.set("isMac",fn);Ia.set("isLinux",sc);Ia.set("isWindows",Vo);Ia.set("isWeb",yp);Ia.set("isMacNative",fn&&!yp);Ia.set("isEdge",xTe);Ia.set("isFirefox",Dkt);Ia.set("isChrome",fre);Ia.set("isSafari",Tkt);const iLt=Object.prototype.hasOwnProperty,sLt={regexParsingWithErrorRecovery:!0},rLt=S(1675,"Empty context key expression"),oLt=S(1676,"Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),aLt=S(1677,"'in' after 'not'."),exe=S(1678,"closing parenthesis ')'"),lLt=S(1679,"Unexpected token"),cLt=S(1680,"Did you forget to put && or || before the token?"),dLt=S(1681,"Unexpected end of expression"),uLt=S(1682,"Did you forget to put a context key?");var Rf;let hLt=(Rf=class{constructor(e=sLt){this._config=e,this._scanner=new RT,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:rLt,offset:0,lexeme:"",additionalInfo:oLt});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const n=this._peek(),s=n.type===17?cLt:void 0;throw this._parsingErrors.push({message:lLt,offset:n.offset,lexeme:RT.getLexeme(n),additionalInfo:s}),Rf._parseError}return t}catch(t){if(t!==Rf._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:Ne.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:Ne.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Tl.INSTANCE;case 12:return this._advance(),oc.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,exe),t==null?void 0:t.negate()}case 17:return this._advance(),DC.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),Ne.true();case 12:return this._advance(),Ne.false();case 0:{this._advance();const t=this._expr();return this._consume(1,exe),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const s=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),s.type!==10)throw this._errExpectedButGot("REGEX",s);const r=s.lexeme,o=r.lastIndexOf("/"),a=o===r.length-1?void 0:this._removeFlagsGY(r.substring(o+1));let l;try{l=new RegExp(r.substring(1,o),a)}catch{throw this._errExpectedButGot("REGEX",s)}return UA.create(t,l)}switch(s.type){case 10:case 19:{const r=[s.lexeme];this._advance();let o=this._peek(),a=0;for(let g=0;g=0){const c=r.slice(a+1,l),u=r[l+1]==="i"?"i":"";try{o=new RegExp(c,u)}catch{throw this._errExpectedButGot("REGEX",s)}}}if(o===null)throw this._errExpectedButGot("REGEX",s);return UA.create(t,o)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,aLt);const s=this._value();return Ne.notIn(t,s)}switch(this._peek().type){case 3:{this._advance();const s=this._value();if(this._previous().type===18)return Ne.equals(t,s);switch(s){case"true":return Ne.has(t);case"false":return Ne.not(t);default:return Ne.equals(t,s)}}case 4:{this._advance();const s=this._value();if(this._previous().type===18)return Ne.notEquals(t,s);switch(s){case"true":return Ne.not(t);case"false":return Ne.has(t);default:return Ne.notEquals(t,s)}}case 5:return this._advance(),dH.create(t,this._value());case 6:return this._advance(),uH.create(t,this._value());case 7:return this._advance(),lH.create(t,this._value());case 8:return this._advance(),cH.create(t,this._value());case 13:return this._advance(),Ne.in(t,this._value());default:return Ne.has(t)}}case 20:throw this._parsingErrors.push({message:dLt,offset:e.offset,lexeme:"",additionalInfo:uLt}),Rf._parseError;default:throw this._errExpectedButGot(`true | false | KEY
- | KEY '=~' REGEX
- | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,n){const s=S(1683,`Expected: {0}
-Received: '{1}'.`,e,RT.getLexeme(t)),r=t.offset,o=RT.getLexeme(t);return this._parsingErrors.push({message:s,offset:r,lexeme:o,additionalInfo:n}),Rf._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}},Rf._parseError=new Error,Rf);const cce=class cce{static false(){return Tl.INSTANCE}static true(){return oc.INSTANCE}static has(e){return LC.create(e)}static equals(e,t){return tD.create(e,t)}static notEquals(e,t){return oH.create(e,t)}static regex(e,t){return UA.create(e,t)}static in(e,t){return sH.create(e,t)}static notIn(e,t){return rH.create(e,t)}static not(e){return DC.create(e)}static and(...e){return Wy.create(e,null,!0)}static or(...e){return Bm.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}};cce._parser=new hLt({regexParsingWithErrorRecovery:!1});let Ne=cce;function gLt(i,e){const t=i?i.substituteConstants():void 0,n=e?e.substituteConstants():void 0;return!t&&!n?!0:!t||!n?!1:t.equals(n)}function eI(i,e){return i.cmp(e)}const _9=class _9{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return oc.INSTANCE}};_9.INSTANCE=new _9;let Tl=_9;const y9=class y9{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return Tl.INSTANCE}};y9.INSTANCE=new y9;let oc=y9;class LC{static create(e,t=null){const n=Ia.get(e);return typeof n=="boolean"?n?oc.INSTANCE:Tl.INSTANCE:new LC(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:b2e(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Ia.get(this.key);return typeof e=="boolean"?e?oc.INSTANCE:Tl.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=DC.create(this.key,this)),this.negated}}class tD{static create(e,t,n=null){if(typeof t=="boolean")return t?LC.create(e,n):DC.create(e,n);const s=Ia.get(e);return typeof s=="boolean"?t===(s?"true":"false")?oc.INSTANCE:Tl.INSTANCE:new tD(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:TC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Ia.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?oc.INSTANCE:Tl.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=oH.create(this.key,this.value,this)),this.negated}}class sH{static create(e,t){return new sH(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:TC(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),n=e.getValue(this.key);return Array.isArray(t)?t.includes(n):typeof n=="string"&&typeof t=="object"&&t!==null?iLt.call(t,n):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=rH.create(this.key,this.valueKey)),this.negated}}class rH{static create(e,t){return new rH(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=sH.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class oH{static create(e,t,n=null){if(typeof t=="boolean")return t?DC.create(e,n):LC.create(e,n);const s=Ia.get(e);return typeof s=="boolean"?t===(s?"true":"false")?Tl.INSTANCE:oc.INSTANCE:new oH(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:TC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Ia.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Tl.INSTANCE:oc.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=tD.create(this.key,this.value,this)),this.negated}}class DC{static create(e,t=null){const n=Ia.get(e);return typeof n=="boolean"?n?Tl.INSTANCE:oc.INSTANCE:new DC(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:b2e(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Ia.get(this.key);return typeof e=="boolean"?e?Tl.INSTANCE:oc.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=LC.create(this.key,this)),this.negated}}function aH(i,e){if(typeof i=="string"){const t=parseFloat(i);isNaN(t)||(i=t)}return typeof i=="string"||typeof i=="number"?e(i):Tl.INSTANCE}class lH{static create(e,t,n=null){return aH(t,s=>new lH(e,s,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:TC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=uH.create(this.key,this.value,this)),this.negated}}class cH{static create(e,t,n=null){return aH(t,s=>new cH(e,s,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:TC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=dH.create(this.key,this.value,this)),this.negated}}class dH{static create(e,t,n=null){return aH(t,s=>new dH(e,s,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:TC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))new uH(e,s,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:TC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=lH.create(this.key,this.value,this)),this.negated}}class UA{static create(e,t){return new UA(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return tn?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Vre.create(this)),this.negated}}class Vre{static create(e){return new Vre(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function m2e(i){let e=null;for(let t=0,n=i.length;te.expr.length)return 1;for(let t=0,n=this.expr.length;t