diff --git a/config.sample.yml b/config.sample.yml index 5672ba2..66e26d6 100755 --- a/config.sample.yml +++ b/config.sample.yml @@ -51,6 +51,14 @@ token: app_jwt_secret: SECRET_APP api_jwt_secret: SECRET_API expires_in: 31536000 +# Conexiones OAuth de uMind (Gmail/Outlook) — vacío hasta crear las apps en +# Google Cloud Console / Azure. Se completan por variable de entorno +# (GOOGLE_OAUTH_CLIENT_ID, etc.), no acá. +oauth: + google_client_id: "" + google_client_secret: "" + ms_client_id: "" + ms_client_secret: "" jwt: app: secret: SECRET_APP diff --git a/config.yml b/config.yml index c4004d2..d957205 100755 --- a/config.yml +++ b/config.yml @@ -55,6 +55,14 @@ token: app_jwt_secret: SECRET_APP api_jwt_secret: SECRET_API expires_in: 31536000 +# Conexiones OAuth de uMind (Gmail/Outlook) — vacío hasta crear las apps en +# Google Cloud Console / Azure. Se completan por variable de entorno +# (GOOGLE_OAUTH_CLIENT_ID, etc.), no acá. +oauth: + google_client_id: "" + google_client_secret: "" + ms_client_id: "" + ms_client_secret: "" jwt: app: secret: SECRET_APP diff --git a/config/config.go b/config/config.go index 5d1b469..940a93e 100755 --- a/config/config.go +++ b/config/config.go @@ -28,6 +28,7 @@ type AppConfig struct { Server ServerConfig `yaml:"server"` Log LogConfig `yaml:"log"` Token Token `yaml:"token"` + OAuth OAuthConfig `yaml:"oauth"` Profiler ProfilerConfig `yaml:"profiler"` Flash *flash.Flash ConfigFile string diff --git a/config/oauth.go b/config/oauth.go new file mode 100644 index 0000000..77a6e29 --- /dev/null +++ b/config/oauth.go @@ -0,0 +1,12 @@ +package config + +// OAuthConfig trae las credenciales de las apps OAuth para conectar cuentas +// de correo (uMind: enviar/leer correo en nombre de un tenant). Sin +// env-default, igual que los secretos JWT — se cargan por variable de +// entorno, no quedan escritos en config.yml. +type OAuthConfig struct { + GoogleClientID string `mapstructure:"GOOGLE_OAUTH_CLIENT_ID" yaml:"google_client_id" env:"GOOGLE_OAUTH_CLIENT_ID"` + GoogleClientSecret string `mapstructure:"GOOGLE_OAUTH_CLIENT_SECRET" yaml:"google_client_secret" env:"GOOGLE_OAUTH_CLIENT_SECRET"` + MSClientID string `mapstructure:"MS_OAUTH_CLIENT_ID" yaml:"ms_client_id" env:"MS_OAUTH_CLIENT_ID"` + MSClientSecret string `mapstructure:"MS_OAUTH_CLIENT_SECRET" yaml:"ms_client_secret" env:"MS_OAUTH_CLIENT_SECRET"` +} diff --git a/go.mod b/go.mod index 450c9f9..ad0880d 100755 --- a/go.mod +++ b/go.mod @@ -57,11 +57,13 @@ require ( github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e go.mongodb.org/mongo-driver v1.17.9 golang.org/x/net v0.53.0 + golang.org/x/oauth2 v0.23.0 gorm.io/driver/sqlite v1.5.6 gorm.io/driver/sqlserver v1.5.3 ) require ( + cloud.google.com/go/compute/metadata v0.9.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/andybalholm/brotli v1.1.0 // indirect @@ -144,7 +146,6 @@ require ( go.uber.org/atomic v1.11.0 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect - golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.20.0 // indirect golang.org/x/term v0.43.0 // indirect golang.org/x/text v0.37.0 // indirect diff --git a/go.sum b/go.sum index 1ed9ca8..e428e0d 100755 --- a/go.sum +++ b/go.sum @@ -33,6 +33,8 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs= +cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= diff --git a/main.go b/main.go index 094b0a4..ffbd90b 100755 --- a/main.go +++ b/main.go @@ -153,6 +153,7 @@ func main() { &models.UmindMensaje{}, &models.UmindHerramienta{}, &models.UmindCanal{}, + &models.UmindConexion{}, // API Keys de /api/v2 (token + IP obligatoria + scopes) &models.ApiKey{}, } diff --git a/orchestrator/src/App.vue b/orchestrator/src/App.vue index 6786828..b776b1d 100644 --- a/orchestrator/src/App.vue +++ b/orchestrator/src/App.vue @@ -1,17 +1,14 @@ + + diff --git a/orchestrator/src/components/Sidebar.vue b/orchestrator/src/components/Sidebar.vue new file mode 100644 index 0000000..13d1316 --- /dev/null +++ b/orchestrator/src/components/Sidebar.vue @@ -0,0 +1,228 @@ + + + diff --git a/orchestrator/src/router.js b/orchestrator/src/router.js index 05d7413..d28d44b 100644 --- a/orchestrator/src/router.js +++ b/orchestrator/src/router.js @@ -1,11 +1,11 @@ import { createRouter, createWebHistory } from 'vue-router' -import TenantsList from './views/TenantsList.vue' +import Home from './views/Home.vue' import TenantDetail from './views/TenantDetail.vue' const router = createRouter({ history: createWebHistory('/orchestrator/'), routes: [ - { path: '/', name: 'tenants', component: TenantsList }, + { path: '/', name: 'home', component: Home }, { path: '/tenants/:id', name: 'tenant-detail', component: TenantDetail, props: true }, ], }) diff --git a/orchestrator/src/views/Home.vue b/orchestrator/src/views/Home.vue new file mode 100644 index 0000000..23dec87 --- /dev/null +++ b/orchestrator/src/views/Home.vue @@ -0,0 +1,7 @@ + diff --git a/orchestrator/src/views/TenantDetail.vue b/orchestrator/src/views/TenantDetail.vue index 2ecf849..ff95fa1 100644 --- a/orchestrator/src/views/TenantDetail.vue +++ b/orchestrator/src/views/TenantDetail.vue @@ -1,13 +1,15 @@ - - diff --git a/orchestrator/tailwind.config.js b/orchestrator/tailwind.config.js index baea761..f93f266 100644 --- a/orchestrator/tailwind.config.js +++ b/orchestrator/tailwind.config.js @@ -1,5 +1,6 @@ export default { content: ['./index.html', './src/**/*.{vue,js}'], + darkMode: 'media', theme: { extend: { colors: { diff --git a/pkg/models/umind_conexion.go b/pkg/models/umind_conexion.go new file mode 100644 index 0000000..8e9852d --- /dev/null +++ b/pkg/models/umind_conexion.go @@ -0,0 +1,75 @@ +package models + +import ( + "time" + + "github.com/sujit-baniya/fiber-boilerplate/app" + "gorm.io/gorm" +) + +// UmindConexion es una cuenta de correo real (Gmail u Outlook) conectada por +// OAuth a un tenant, para que el agente pueda enviar y leer correo en su +// nombre (tools enviar_correo/leer_bandeja, ver pkg/services/umind_agent_service.go). +// AccessTokenEnc/RefreshTokenEnc viajan cifrados en reposo (ver +// pkg/services/umind_secrets.go) — a diferencia del site_key del widget, +// estos SÍ son secretos: quien los tenga puede leer/mandar correo como el +// dueño de la cuenta. +type UmindConexion struct { + gorm.Model + TenantID uint `json:"tenant_id" gorm:"column:tenant_id;index;not null"` + Proveedor string `json:"proveedor" gorm:"column:proveedor;size:20;not null"` // google | microsoft + Email string `json:"email" gorm:"column:email;size:255"` + AccessTokenEnc string `json:"-" gorm:"column:access_token_enc;type:text"` + RefreshTokenEnc string `json:"-" gorm:"column:refresh_token_enc;type:text"` + ExpiraEn time.Time `json:"expira_en" gorm:"column:expira_en"` + Scopes string `json:"scopes" gorm:"column:scopes;type:text"` + Activo bool `json:"activo" gorm:"column:activo;default:true"` +} + +func (UmindConexion) TableName() string { return "umind_conexiones" } + +func CreateUmindConexion(c *UmindConexion) error { + return app.Http.Database.DB.Create(c).Error +} + +func GetUmindConexionesByTenant(tenantID uint) ([]UmindConexion, error) { + var items []UmindConexion + err := app.Http.Database.DB.Where("tenant_id = ?", tenantID).Order("id DESC").Find(&items).Error + return items, err +} + +func GetUmindConexionByID(id uint) (*UmindConexion, error) { + var c UmindConexion + if err := app.Http.Database.DB.First(&c, id).Error; err != nil { + return nil, err + } + return &c, nil +} + +// GetUmindConexionActiva retorna la primera conexión activa del tenant — +// hoy se soporta una sola cuenta de correo conectada por tenant, no una +// bandeja por proveedor a la vez. +func GetUmindConexionActiva(tenantID uint) (*UmindConexion, error) { + var c UmindConexion + err := app.Http.Database.DB.Where("tenant_id = ? AND activo = ?", tenantID, true).First(&c).Error + if err != nil { + return nil, err + } + return &c, nil +} + +// DesactivarConexionesDelTenant se llama antes de crear una conexión nueva — +// hoy se soporta una sola cuenta de correo activa por tenant a la vez. +func DesactivarConexionesDelTenant(tenantID uint) error { + return app.Http.Database.DB.Model(&UmindConexion{}). + Where("tenant_id = ? AND activo = ?", tenantID, true). + Update("activo", false).Error +} + +func UpdateUmindConexion(id uint, updates map[string]interface{}) error { + return app.Http.Database.DB.Model(&UmindConexion{}).Where("id = ?", id).Updates(updates).Error +} + +func DeleteUmindConexion(id uint) error { + return app.Http.Database.DB.Delete(&UmindConexion{}, id).Error +} diff --git a/pkg/services/umind_agent_service.go b/pkg/services/umind_agent_service.go index 516c908..28ae6aa 100644 --- a/pkg/services/umind_agent_service.go +++ b/pkg/services/umind_agent_service.go @@ -82,9 +82,51 @@ func umindTools(tenantID uint) []agentTool { }, }) } + + if conexion, err := models.GetUmindConexionActiva(tenantID); err == nil && conexion != nil { + tools = append(tools, umindEmailTools()...) + } return tools } +// umindEmailTools son las tools de correo, disponibles solo cuando el +// tenant tiene una cuenta conectada (UmindConexion activa) — nombres +// genéricos porque al modelo no le importa si detrás hay Gmail u Outlook. +func umindEmailTools() []agentTool { + return []agentTool{ + { + Type: "function", + Function: agentToolFunc{ + Name: "enviar_correo", + Description: "Envía un correo electrónico desde la cuenta de correo conectada del negocio.", + Parameters: agentToolParam{ + Type: "object", + Properties: map[string]agentToolParam{ + "destinatario": {Type: "string", Description: "Email del destinatario"}, + "asunto": {Type: "string", Description: "Asunto del correo"}, + "cuerpo": {Type: "string", Description: "Cuerpo del correo en texto plano"}, + }, + Required: []string{"destinatario", "asunto", "cuerpo"}, + }, + }, + }, + { + Type: "function", + Function: agentToolFunc{ + Name: "leer_bandeja", + Description: "Busca correos recibidos en la bandeja conectada del negocio (ej. revisar si llegó un comprobante o la respuesta de un cliente).", + Parameters: agentToolParam{ + Type: "object", + Properties: map[string]agentToolParam{ + "consulta": {Type: "string", Description: "Qué buscar: remitente, palabras clave del asunto o del cuerpo"}, + }, + Required: []string{"consulta"}, + }, + }, + }, + } +} + // executeUmindTool ejecuta buscar_conocimiento (RAG interno) o, si el nombre // no matchea, busca una UmindHerramienta custom del tenant y hace el POST al // webhook configurado. Devuelve el resultado ya serializado, en el mismo @@ -111,6 +153,10 @@ func executeUmindTool(tenantID uint, name string, args map[string]interface{}) s return string(b) } + if name == "enviar_correo" || name == "leer_bandeja" { + return executeUmindEmailTool(tenantID, name, args) + } + herramienta, err := models.GetUmindHerramientaByNombre(tenantID, name) if err != nil { return fmt.Sprintf(`{"error": "herramienta desconocida: %s"}`, name) @@ -131,6 +177,60 @@ func executeUmindTool(tenantID uint, name string, args map[string]interface{}) s return resultado } +// executeUmindEmailTool despacha enviar_correo/leer_bandeja a Gmail o +// Microsoft Graph según el proveedor de la conexión activa del tenant, +// refrescando el token primero si hace falta. +func executeUmindEmailTool(tenantID uint, name string, args map[string]interface{}) string { + conexion, err := models.GetUmindConexionActiva(tenantID) + if err != nil { + return `{"error": "no hay ninguna cuenta de correo conectada"}` + } + if err := RefrescarSiVence(conexion); err != nil { + log.Printf("[UMIND] Error refrescando token OAuth (conexión %d): %v", conexion.ID, err) + return `{"error": "no se pudo usar la cuenta de correo conectada, intenta más tarde"}` + } + + switch name { + case "enviar_correo": + destinatario, _ := args["destinatario"].(string) + asunto, _ := args["asunto"].(string) + cuerpo, _ := args["cuerpo"].(string) + if strings.TrimSpace(destinatario) == "" || strings.TrimSpace(cuerpo) == "" { + return `{"error": "destinatario y cuerpo son requeridos"}` + } + var envErr error + if conexion.Proveedor == UmindOAuthGoogle { + envErr = EnviarCorreoGoogle(conexion, destinatario, asunto, cuerpo) + } else { + envErr = EnviarCorreoMicrosoft(conexion, destinatario, asunto, cuerpo) + } + if envErr != nil { + log.Printf("[UMIND] Error enviando correo (tenant %d): %v", tenantID, envErr) + return `{"error": "no se pudo enviar el correo"}` + } + return `{"ok": true}` + + case "leer_bandeja": + consulta, _ := args["consulta"].(string) + var resultados []CorreoResumen + var lecErr error + if conexion.Proveedor == UmindOAuthGoogle { + resultados, lecErr = LeerBandejaGoogle(conexion, consulta, 5) + } else { + resultados, lecErr = LeerBandejaMicrosoft(conexion, consulta, 5) + } + if lecErr != nil { + log.Printf("[UMIND] Error leyendo bandeja (tenant %d): %v", tenantID, lecErr) + return `{"error": "no se pudo leer la bandeja"}` + } + b, _ := json.Marshal(map[string]interface{}{"resultados": resultados}) + return string(b) + + default: + return `{"error": "herramienta desconocida"}` + } +} + // ProcessWidgetMessage procesa un mensaje del widget de uMind y devuelve la // respuesta del agente. Es el equivalente de ProcessAgentMessage pero // multi-tenant y con un toolset acotado a RAG (sin herramientas internas). diff --git a/pkg/services/umind_oauth_google.go b/pkg/services/umind_oauth_google.go new file mode 100644 index 0000000..6abde23 --- /dev/null +++ b/pkg/services/umind_oauth_google.go @@ -0,0 +1,116 @@ +package services + +import ( + "bytes" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + + "github.com/sujit-baniya/fiber-boilerplate/pkg/models" +) + +// EnviarCorreoGoogle manda un correo de texto plano vía Gmail API en nombre +// de la cuenta conectada. Asume que conexion ya pasó por RefrescarSiVence. +func EnviarCorreoGoogle(conexion *models.UmindConexion, destinatario, asunto, cuerpo string) error { + accessToken, err := DescifrarSecretoUmind(conexion.AccessTokenEnc) + if err != nil { + return fmt.Errorf("no se pudo descifrar el access token: %w", err) + } + + mime := fmt.Sprintf("To: %s\r\nSubject: %s\r\nContent-Type: text/plain; charset=\"UTF-8\"\r\n\r\n%s", + destinatario, asunto, cuerpo) + raw := base64.RawURLEncoding.EncodeToString([]byte(mime)) + + body, _ := json.Marshal(map[string]string{"raw": raw}) + req, err := http.NewRequest(http.MethodPost, "https://gmail.googleapis.com/gmail/v1/users/me/messages/send", bytes.NewReader(body)) + if err != nil { + return err + } + req.Header.Set("Authorization", "Bearer "+accessToken) + req.Header.Set("Content-Type", "application/json") + + resp, err := umindOAuthHTTPClient.Do(req) + if err != nil { + return fmt.Errorf("no se pudo contactar Gmail: %w", err) + } + defer resp.Body.Close() + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + detalle, _ := io.ReadAll(io.LimitReader(resp.Body, 2048)) + return fmt.Errorf("Gmail respondió %d: %s", resp.StatusCode, string(detalle)) + } + return nil +} + +// LeerBandejaGoogle busca mensajes en Gmail (sintaxis de búsqueda de Gmail, +// ej: "from:cliente@ejemplo.com") y devuelve un resumen liviano de cada uno. +func LeerBandejaGoogle(conexion *models.UmindConexion, consulta string, limite int) ([]CorreoResumen, error) { + if limite <= 0 || limite > 10 { + limite = 10 + } + accessToken, err := DescifrarSecretoUmind(conexion.AccessTokenEnc) + if err != nil { + return nil, fmt.Errorf("no se pudo descifrar el access token: %w", err) + } + + listURL := fmt.Sprintf("https://gmail.googleapis.com/gmail/v1/users/me/messages?q=%s&maxResults=%d", + url.QueryEscape(consulta), limite) + var lista struct { + Messages []struct { + ID string `json:"id"` + } `json:"messages"` + } + if err := gmailGetJSON(listURL, accessToken, &lista); err != nil { + return nil, err + } + + resultados := make([]CorreoResumen, 0, len(lista.Messages)) + for _, m := range lista.Messages { + detalleURL := fmt.Sprintf("https://gmail.googleapis.com/gmail/v1/users/me/messages/%s?format=metadata&metadataHeaders=From&metadataHeaders=Subject&metadataHeaders=Date", m.ID) + var msg struct { + Snippet string `json:"snippet"` + Payload struct { + Headers []struct { + Name string `json:"name"` + Value string `json:"value"` + } `json:"headers"` + } `json:"payload"` + } + if err := gmailGetJSON(detalleURL, accessToken, &msg); err != nil { + continue // un mensaje individual que falla no debe tirar abajo toda la búsqueda + } + r := CorreoResumen{Extracto: msg.Snippet} + for _, h := range msg.Payload.Headers { + switch h.Name { + case "From": + r.De = h.Value + case "Subject": + r.Asunto = h.Value + case "Date": + r.Fecha = h.Value + } + } + resultados = append(resultados, r) + } + return resultados, nil +} + +func gmailGetJSON(url, accessToken string, out interface{}) error { + req, err := http.NewRequest(http.MethodGet, url, nil) + if err != nil { + return err + } + req.Header.Set("Authorization", "Bearer "+accessToken) + resp, err := umindOAuthHTTPClient.Do(req) + if err != nil { + return fmt.Errorf("no se pudo contactar Gmail: %w", err) + } + defer resp.Body.Close() + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + detalle, _ := io.ReadAll(io.LimitReader(resp.Body, 2048)) + return fmt.Errorf("Gmail respondió %d: %s", resp.StatusCode, string(detalle)) + } + return json.NewDecoder(resp.Body).Decode(out) +} diff --git a/pkg/services/umind_oauth_microsoft.go b/pkg/services/umind_oauth_microsoft.go new file mode 100644 index 0000000..de69f2c --- /dev/null +++ b/pkg/services/umind_oauth_microsoft.go @@ -0,0 +1,109 @@ +package services + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + + "github.com/sujit-baniya/fiber-boilerplate/pkg/models" +) + +// EnviarCorreoMicrosoft manda un correo de texto plano vía Microsoft Graph +// (POST /me/sendMail) en nombre de la cuenta conectada. +func EnviarCorreoMicrosoft(conexion *models.UmindConexion, destinatario, asunto, cuerpo string) error { + accessToken, err := DescifrarSecretoUmind(conexion.AccessTokenEnc) + if err != nil { + return fmt.Errorf("no se pudo descifrar el access token: %w", err) + } + + payload := map[string]interface{}{ + "message": map[string]interface{}{ + "subject": asunto, + "body": map[string]string{"contentType": "Text", "content": cuerpo}, + "toRecipients": []map[string]interface{}{ + {"emailAddress": map[string]string{"address": destinatario}}, + }, + }, + } + body, _ := json.Marshal(payload) + req, err := http.NewRequest(http.MethodPost, "https://graph.microsoft.com/v1.0/me/sendMail", bytes.NewReader(body)) + if err != nil { + return err + } + req.Header.Set("Authorization", "Bearer "+accessToken) + req.Header.Set("Content-Type", "application/json") + + resp, err := umindOAuthHTTPClient.Do(req) + if err != nil { + return fmt.Errorf("no se pudo contactar Microsoft Graph: %w", err) + } + defer resp.Body.Close() + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + detalle, _ := io.ReadAll(io.LimitReader(resp.Body, 2048)) + return fmt.Errorf("Microsoft Graph respondió %d: %s", resp.StatusCode, string(detalle)) + } + return nil +} + +// LeerBandejaMicrosoft busca mensajes en la bandeja vía Microsoft Graph +// ($search sobre asunto/cuerpo/remitente) y devuelve un resumen liviano. +func LeerBandejaMicrosoft(conexion *models.UmindConexion, consulta string, limite int) ([]CorreoResumen, error) { + if limite <= 0 || limite > 10 { + limite = 10 + } + accessToken, err := DescifrarSecretoUmind(conexion.AccessTokenEnc) + if err != nil { + return nil, fmt.Errorf("no se pudo descifrar el access token: %w", err) + } + + q := fmt.Sprintf("https://graph.microsoft.com/v1.0/me/messages?$search=%s&$top=%d&$select=from,subject,receivedDateTime,bodyPreview", + url.QueryEscape(`"`+consulta+`"`), limite) + req, err := http.NewRequest(http.MethodGet, q, nil) + if err != nil { + return nil, err + } + req.Header.Set("Authorization", "Bearer "+accessToken) + // $search requiere este header ("eventual consistency") en Microsoft Graph. + req.Header.Set("ConsistencyLevel", "eventual") + + resp, err := umindOAuthHTTPClient.Do(req) + if err != nil { + return nil, fmt.Errorf("no se pudo contactar Microsoft Graph: %w", err) + } + defer resp.Body.Close() + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + detalle, _ := io.ReadAll(io.LimitReader(resp.Body, 2048)) + return nil, fmt.Errorf("Microsoft Graph respondió %d: %s", resp.StatusCode, string(detalle)) + } + + var out struct { + Value []struct { + From struct { + EmailAddress struct { + Name string `json:"name"` + Address string `json:"address"` + } `json:"emailAddress"` + } `json:"from"` + Subject string `json:"subject"` + ReceivedDateTime string `json:"receivedDateTime"` + BodyPreview string `json:"bodyPreview"` + } `json:"value"` + } + if err := json.NewDecoder(resp.Body).Decode(&out); err != nil { + return nil, err + } + + resultados := make([]CorreoResumen, 0, len(out.Value)) + for _, m := range out.Value { + resultados = append(resultados, CorreoResumen{ + De: m.From.EmailAddress.Address, + Asunto: m.Subject, + Fecha: m.ReceivedDateTime, + Extracto: m.BodyPreview, + }) + } + return resultados, nil +} diff --git a/pkg/services/umind_oauth_service.go b/pkg/services/umind_oauth_service.go new file mode 100644 index 0000000..7651eff --- /dev/null +++ b/pkg/services/umind_oauth_service.go @@ -0,0 +1,266 @@ +package services + +import ( + "context" + "crypto/hmac" + "crypto/rand" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "fmt" + "log" + "net/http" + "strconv" + "strings" + "time" + + "github.com/sujit-baniya/fiber-boilerplate/app" + "github.com/sujit-baniya/fiber-boilerplate/pkg/models" + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" + "golang.org/x/oauth2/microsoft" +) + +const ( + UmindOAuthGoogle = "google" + UmindOAuthMicrosoft = "microsoft" +) + +// CorreoResumen es el formato común en el que enviar_correo/leer_bandeja +// devuelven un mensaje al agente, sin importar el proveedor real detrás. +type CorreoResumen struct { + De string `json:"de"` + Asunto string `json:"asunto"` + Fecha string `json:"fecha"` + Extracto string `json:"extracto"` +} + +var umindOAuthHTTPClient = &http.Client{Timeout: 15 * time.Second} + +// firmarState / verificarState arman el parámetro state del flujo OAuth +// autoverificable (tenantID + nonce + HMAC con APP_KEY) — evita necesitar una +// tabla de "estados pendientes": si la firma es válida, el state no fue +// alterado desde que lo generamos nosotros. +func firmarState(tenantID uint) (string, error) { + nonce := make([]byte, 8) + if _, err := rand.Read(nonce); err != nil { + return "", err + } + payload := fmt.Sprintf("%d.%s", tenantID, hex.EncodeToString(nonce)) + mac := hmac.New(sha256.New, []byte(app.Http.Server.Key)) + mac.Write([]byte(payload)) + return payload + "." + hex.EncodeToString(mac.Sum(nil)), nil +} + +func verificarState(state string) (uint, error) { + partes := strings.Split(state, ".") + if len(partes) != 3 { + return 0, fmt.Errorf("formato de state inválido") + } + payload := partes[0] + "." + partes[1] + mac := hmac.New(sha256.New, []byte(app.Http.Server.Key)) + mac.Write([]byte(payload)) + esperada := hex.EncodeToString(mac.Sum(nil)) + if !hmac.Equal([]byte(esperada), []byte(partes[2])) { + return 0, fmt.Errorf("firma de state inválida") + } + tenantID, err := strconv.ParseUint(partes[0], 10, 64) + if err != nil { + return 0, fmt.Errorf("tenant_id inválido en state: %w", err) + } + return uint(tenantID), nil +} + +func redirectURLOAuth(proveedor string) string { + return strings.TrimRight(app.Http.Server.Url, "/") + "/app/umind/conexiones/callback/" + proveedor +} + +func oauth2ConfigPara(proveedor string) (*oauth2.Config, error) { + switch proveedor { + case UmindOAuthGoogle: + if app.Http.OAuth.GoogleClientID == "" || app.Http.OAuth.GoogleClientSecret == "" { + return nil, fmt.Errorf("Google OAuth no está configurado en el servidor (GOOGLE_OAUTH_CLIENT_ID/GOOGLE_OAUTH_CLIENT_SECRET)") + } + return &oauth2.Config{ + ClientID: app.Http.OAuth.GoogleClientID, + ClientSecret: app.Http.OAuth.GoogleClientSecret, + RedirectURL: redirectURLOAuth(proveedor), + Scopes: []string{ + "https://www.googleapis.com/auth/gmail.send", + "https://www.googleapis.com/auth/gmail.readonly", + "https://www.googleapis.com/auth/userinfo.email", + }, + Endpoint: google.Endpoint, + }, nil + case UmindOAuthMicrosoft: + if app.Http.OAuth.MSClientID == "" || app.Http.OAuth.MSClientSecret == "" { + return nil, fmt.Errorf("Microsoft OAuth no está configurado en el servidor (MS_OAUTH_CLIENT_ID/MS_OAUTH_CLIENT_SECRET)") + } + return &oauth2.Config{ + ClientID: app.Http.OAuth.MSClientID, + ClientSecret: app.Http.OAuth.MSClientSecret, + RedirectURL: redirectURLOAuth(proveedor), + Scopes: []string{ + "offline_access", "openid", "email", + "https://graph.microsoft.com/Mail.Send", + "https://graph.microsoft.com/Mail.Read", + }, + Endpoint: microsoft.AzureADEndpoint("common"), + }, nil + default: + return nil, fmt.Errorf("proveedor desconocido: %s", proveedor) + } +} + +// IniciarConexionOAuth arma la URL de autorización a la que hay que +// redirigir al staff. prompt=consent en Google fuerza a que siempre vuelva +// un refresh_token (si no, Google solo lo manda la primera vez que el +// usuario autoriza la app, nunca más). +func IniciarConexionOAuth(proveedor string, tenantID uint) (string, error) { + cfg, err := oauth2ConfigPara(proveedor) + if err != nil { + return "", err + } + state, err := firmarState(tenantID) + if err != nil { + return "", err + } + opts := []oauth2.AuthCodeOption{oauth2.AccessTypeOffline} + if proveedor == UmindOAuthGoogle { + opts = append(opts, oauth2.SetAuthURLParam("prompt", "consent")) + } + return cfg.AuthCodeURL(state, opts...), nil +} + +// CompletarConexionOAuth intercambia el code por tokens, identifica la +// cuenta conectada y guarda la conexión cifrada. Reemplaza cualquier +// conexión previa activa del tenant (una cuenta de correo a la vez). +func CompletarConexionOAuth(proveedor, code, state string) (*models.UmindConexion, error) { + tenantID, err := verificarState(state) + if err != nil { + return nil, fmt.Errorf("state inválido: %w", err) + } + cfg, err := oauth2ConfigPara(proveedor) + if err != nil { + return nil, err + } + tok, err := cfg.Exchange(context.Background(), code) + if err != nil { + return nil, fmt.Errorf("no se pudo intercambiar el código de autorización: %w", err) + } + if tok.RefreshToken == "" { + return nil, fmt.Errorf("el proveedor no devolvió un refresh_token — revocá el acceso de esta app en tu cuenta y volvé a conectar") + } + + email, err := obtenerEmailDeCuenta(proveedor, tok.AccessToken) + if err != nil { + log.Printf("[UMIND_OAUTH] no se pudo obtener el email de la cuenta conectada (%s): %v", proveedor, err) + } + + accessEnc, err := CifrarSecretoUmind(tok.AccessToken) + if err != nil { + return nil, err + } + refreshEnc, err := CifrarSecretoUmind(tok.RefreshToken) + if err != nil { + return nil, err + } + + if err := models.DesactivarConexionesDelTenant(tenantID); err != nil { + log.Printf("[UMIND_OAUTH] no se pudieron desactivar conexiones previas del tenant %d: %v", tenantID, err) + } + conexion := &models.UmindConexion{ + TenantID: tenantID, + Proveedor: proveedor, + Email: email, + AccessTokenEnc: accessEnc, + RefreshTokenEnc: refreshEnc, + ExpiraEn: tok.Expiry, + Scopes: strings.Join(cfg.Scopes, " "), + Activo: true, + } + if err := models.CreateUmindConexion(conexion); err != nil { + return nil, err + } + return conexion, nil +} + +func obtenerEmailDeCuenta(proveedor, accessToken string) (string, error) { + var url string + switch proveedor { + case UmindOAuthGoogle: + url = "https://www.googleapis.com/oauth2/v2/userinfo" + case UmindOAuthMicrosoft: + url = "https://graph.microsoft.com/v1.0/me" + default: + return "", fmt.Errorf("proveedor desconocido: %s", proveedor) + } + req, err := http.NewRequest(http.MethodGet, url, nil) + if err != nil { + return "", err + } + req.Header.Set("Authorization", "Bearer "+accessToken) + resp, err := umindOAuthHTTPClient.Do(req) + if err != nil { + return "", err + } + defer resp.Body.Close() + + var out struct { + Email string `json:"email"` // Google + Mail string `json:"mail"` // Microsoft + UserPrincipalName string `json:"userPrincipalName"` // Microsoft, fallback si "mail" viene vacío + } + if err := json.NewDecoder(resp.Body).Decode(&out); err != nil { + return "", err + } + if out.Email != "" { + return out.Email, nil + } + if out.Mail != "" { + return out.Mail, nil + } + return out.UserPrincipalName, nil +} + +// RefrescarSiVence renueva el access token si está vencido o a menos de 2 +// minutos de vencer, y persiste el nuevo valor cifrado. Se llama justo antes +// de usar la conexión (enviar/leer correo), no por un cron aparte — ver nota +// de alcance en el plan: si en la práctica hace falta refresco proactivo, se +// agrega por pkg/services/cron_service.go sin tocar esta función. +func RefrescarSiVence(conexion *models.UmindConexion) error { + if time.Now().Add(2 * time.Minute).Before(conexion.ExpiraEn) { + return nil + } + cfg, err := oauth2ConfigPara(conexion.Proveedor) + if err != nil { + return err + } + refreshToken, err := DescifrarSecretoUmind(conexion.RefreshTokenEnc) + if err != nil { + return fmt.Errorf("no se pudo descifrar el refresh_token: %w", err) + } + + nuevo, err := cfg.TokenSource(context.Background(), &oauth2.Token{RefreshToken: refreshToken}).Token() + if err != nil { + return fmt.Errorf("no se pudo refrescar el token: %w", err) + } + + accessEnc, err := CifrarSecretoUmind(nuevo.AccessToken) + if err != nil { + return err + } + updates := map[string]interface{}{"access_token_enc": accessEnc, "expira_en": nuevo.Expiry} + if nuevo.RefreshToken != "" && nuevo.RefreshToken != refreshToken { + if refreshEnc, err := CifrarSecretoUmind(nuevo.RefreshToken); err == nil { + updates["refresh_token_enc"] = refreshEnc + conexion.RefreshTokenEnc = refreshEnc + } + } + if err := models.UpdateUmindConexion(conexion.ID, updates); err != nil { + log.Printf("[UMIND_OAUTH] no se pudo persistir el refresh del token (conexión %d): %v", conexion.ID, err) + } + conexion.AccessTokenEnc = accessEnc + conexion.ExpiraEn = nuevo.Expiry + return nil +} diff --git a/pkg/services/umind_oauth_service_test.go b/pkg/services/umind_oauth_service_test.go new file mode 100644 index 0000000..31694fe --- /dev/null +++ b/pkg/services/umind_oauth_service_test.go @@ -0,0 +1,34 @@ +package services + +import ( + "testing" + + "github.com/sujit-baniya/fiber-boilerplate/app" + "github.com/sujit-baniya/fiber-boilerplate/config" +) + +func TestFirmarYVerificarState(t *testing.T) { + app.Http = &config.AppConfig{Server: config.ServerConfig{Key: "clave-de-prueba-no-real"}} + + state, err := firmarState(42) + if err != nil { + t.Fatalf("firmarState: %v", err) + } + tenantID, err := verificarState(state) + if err != nil { + t.Fatalf("verificarState de un state válido falló: %v", err) + } + if tenantID != 42 { + t.Errorf("tenantID = %d, esperaba 42", tenantID) + } + + if _, err := verificarState(state + "x"); err == nil { + t.Error("un state alterado fue aceptado") + } + if _, err := verificarState("formato.invalido"); err == nil { + t.Error("un state con formato inválido fue aceptado") + } + if _, err := verificarState("noesnumero.aabbcc.deadbeef"); err == nil { + t.Error("un tenant_id no numérico fue aceptado") + } +} diff --git a/public/orchestrator/assets/index-D6shNZ1Q.js b/public/orchestrator/assets/index-D6shNZ1Q.js new file mode 100644 index 0000000..9559059 --- /dev/null +++ b/public/orchestrator/assets/index-D6shNZ1Q.js @@ -0,0 +1,26 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();/** +* @vue/shared v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Lr(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ie={},Bt=[],it=()=>{},no=()=>!1,Kn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Gn=e=>e.startsWith("onUpdate:"),we=Object.assign,Ur=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ci=Object.prototype.hasOwnProperty,te=(e,t)=>Ci.call(e,t),$=Array.isArray,Kt=e=>wn(e)==="[object Map]",Xt=e=>wn(e)==="[object Set]",as=e=>wn(e)==="[object Date]",B=e=>typeof e=="function",ge=e=>typeof e=="string",lt=e=>typeof e=="symbol",re=e=>e!==null&&typeof e=="object",ro=e=>(re(e)||B(e))&&B(e.then)&&B(e.catch),so=Object.prototype.toString,wn=e=>so.call(e),Ai=e=>wn(e).slice(8,-1),oo=e=>wn(e)==="[object Object]",Fr=e=>ge(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ln=Lr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),qn=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Si=/-\w/g,Pe=qn(e=>e.replace(Si,t=>t.slice(1).toUpperCase())),Ri=/\B([A-Z])/g,Ut=qn(e=>e.replace(Ri,"-$1").toLowerCase()),Wn=qn(e=>e.charAt(0).toUpperCase()+e.slice(1)),ir=qn(e=>e?`on${Wn(e)}`:""),st=(e,t)=>!Object.is(e,t),Tn=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},zn=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let cs;const Jn=()=>cs||(cs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function $r(e){if($(e)){const t={};for(let n=0;n{if(n){const r=n.split(Ti);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function Ve(e){let t="";if(ge(e))t=e;else if($(e))for(let n=0;nZt(n,t))}const ao=e=>!!(e&&e.__v_isRef===!0),J=e=>ge(e)?e:e==null?"":$(e)||re(e)&&(e.toString===so||!B(e.toString))?ao(e)?J(e.value):JSON.stringify(e,co,2):String(e),co=(e,t)=>ao(t)?co(e,t.value):Kt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[lr(r,o)+" =>"]=s,n),{})}:Xt(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>lr(n))}:lt(t)?lr(t):re(t)&&!$(t)&&!oo(t)?String(t):t,lr=(e,t="")=>{var n;return lt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** +* @vue/reactivity v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let xe;class Vi{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&xe&&(xe.active?(this.parent=xe,this.index=(xe.scopes||(xe.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const r=this.scopes.slice();for(t=0,n=r.length;t0&&--this._on===0){if(xe===this)xe=this.prevScope;else{let t=xe;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n0)return;if(cn){let t=cn;for(cn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;an;){let t=an;for(an=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function go(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ho(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Gr(r),Li(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function wr(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(mo(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function mo(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===gn)||(e.globalVersion=gn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!wr(e))))return;e.flags|=2;const t=e.dep,n=ce,r=Ge;ce=e,Ge=!0;try{go(e);const s=e.fn(e._value);(t.version===0||st(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{ce=n,Ge=r,ho(e),e.flags&=-3}}function Gr(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)Gr(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Li(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ge=!0;const yo=[];function yt(){yo.push(Ge),Ge=!1}function vt(){const e=yo.pop();Ge=e===void 0?!0:e}function us(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ce;ce=void 0;try{t()}finally{ce=n}}}let gn=0;class Ui{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class qr{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ce||!Ge||ce===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ce)n=this.activeLink=new Ui(ce,this),ce.deps?(n.prevDep=ce.depsTail,ce.depsTail.nextDep=n,ce.depsTail=n):ce.deps=ce.depsTail=n,vo(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=ce.depsTail,n.nextDep=void 0,ce.depsTail.nextDep=n,ce.depsTail=n,ce.deps===n&&(ce.deps=r)}return n}trigger(t){this.version++,gn++,this.notify(t)}notify(t){Br();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Kr()}}}function vo(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)vo(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const kr=new WeakMap,Vt=Symbol(""),Er=Symbol(""),hn=Symbol("");function Ce(e,t,n){if(Ge&&ce){let r=kr.get(e);r||kr.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new qr),s.map=r,s.key=n),s.track()}}function ht(e,t,n,r,s,o){const i=kr.get(e);if(!i){gn++;return}const l=a=>{a&&a.trigger()};if(Br(),t==="clear")i.forEach(l);else{const a=$(e),p=a&&Fr(n);if(a&&n==="length"){const u=Number(r);i.forEach((g,b)=>{(b==="length"||b===hn||!lt(b)&&b>=u)&&l(g)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),p&&l(i.get(hn)),t){case"add":a?p&&l(i.get("length")):(l(i.get(Vt)),Kt(e)&&l(i.get(Er)));break;case"delete":a||(l(i.get(Vt)),Kt(e)&&l(i.get(Er)));break;case"set":Kt(e)&&l(i.get(Vt));break}}Kr()}function Ft(e){const t=ee(e);return t===e?t:(Ce(t,"iterate",hn),$e(e)?t:t.map(We))}function Qn(e){return Ce(e=ee(e),"iterate",hn),e}function nt(e,t){return bt(e)?Wt(jt(e)?We(t):t):We(t)}const Fi={__proto__:null,[Symbol.iterator](){return cr(this,Symbol.iterator,e=>nt(this,e))},concat(...e){return Ft(this).concat(...e.map(t=>$(t)?Ft(t):t))},entries(){return cr(this,"entries",e=>(e[1]=nt(this,e[1]),e))},every(e,t){return ut(this,"every",e,t,void 0,arguments)},filter(e,t){return ut(this,"filter",e,t,n=>n.map(r=>nt(this,r)),arguments)},find(e,t){return ut(this,"find",e,t,n=>nt(this,n),arguments)},findIndex(e,t){return ut(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ut(this,"findLast",e,t,n=>nt(this,n),arguments)},findLastIndex(e,t){return ut(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ut(this,"forEach",e,t,void 0,arguments)},includes(...e){return ur(this,"includes",e)},indexOf(...e){return ur(this,"indexOf",e)},join(e){return Ft(this).join(e)},lastIndexOf(...e){return ur(this,"lastIndexOf",e)},map(e,t){return ut(this,"map",e,t,void 0,arguments)},pop(){return tn(this,"pop")},push(...e){return tn(this,"push",e)},reduce(e,...t){return fs(this,"reduce",e,t)},reduceRight(e,...t){return fs(this,"reduceRight",e,t)},shift(){return tn(this,"shift")},some(e,t){return ut(this,"some",e,t,void 0,arguments)},splice(...e){return tn(this,"splice",e)},toReversed(){return Ft(this).toReversed()},toSorted(e){return Ft(this).toSorted(e)},toSpliced(...e){return Ft(this).toSpliced(...e)},unshift(...e){return tn(this,"unshift",e)},values(){return cr(this,"values",e=>nt(this,e))}};function cr(e,t,n){const r=Qn(e),s=r[t]();return r!==e&&!$e(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const $i=Array.prototype;function ut(e,t,n,r,s,o){const i=Qn(e),l=i!==e&&!$e(e),a=i[t];if(a!==$i[t]){const g=a.apply(e,o);return l?We(g):g}let p=n;i!==e&&(l?p=function(g,b){return n.call(this,nt(e,g),b,e)}:n.length>2&&(p=function(g,b){return n.call(this,g,b,e)}));const u=a.call(i,p,r);return l&&s?s(u):u}function fs(e,t,n,r){const s=Qn(e),o=s!==e&&!$e(e);let i=n,l=!1;s!==e&&(o?(l=r.length===0,i=function(p,u,g){return l&&(l=!1,p=nt(e,p)),n.call(this,p,nt(e,u),g,e)}):n.length>3&&(i=function(p,u,g){return n.call(this,p,u,g,e)}));const a=s[t](i,...r);return l?nt(e,a):a}function ur(e,t,n){const r=ee(e);Ce(r,"iterate",hn);const s=r[t](...n);return(s===-1||s===!1)&&Jr(n[0])?(n[0]=ee(n[0]),r[t](...n)):s}function tn(e,t,n=[]){yt(),Br();const r=ee(e)[t].apply(e,n);return Kr(),vt(),r}const Hi=Lr("__proto__,__v_isRef,__isVue"),bo=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(lt));function Bi(e){lt(e)||(e=String(e));const t=ee(this);return Ce(t,"has",e),t.hasOwnProperty(e)}class xo{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?Zi:Eo:o?ko:wo).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=$(t);if(!s){let a;if(i&&(a=Fi[n]))return a;if(n==="hasOwnProperty")return Bi}const l=Reflect.get(t,n,Se(t)?t:r);if((lt(n)?bo.has(n):Hi(n))||(s||Ce(t,"get",n),o))return l;if(Se(l)){const a=i&&Fr(n)?l:l.value;return s&&re(a)?Ar(a):a}return re(l)?s?Ar(l):Yn(l):l}}class _o extends xo{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=$(t)&&Fr(n);if(!this._isShallow){const p=bt(o);if(!$e(r)&&!bt(r)&&(o=ee(o),r=ee(r)),!i&&Se(o)&&!Se(r))return p||(o.value=r),!0}const l=i?Number(n)e,Cn=e=>Reflect.getPrototypeOf(e);function zi(e,t,n){return function(...r){const s=this.__v_raw,o=ee(s),i=Kt(o),l=e==="entries"||e===Symbol.iterator&&i,a=e==="keys"&&i,p=s[e](...r),u=n?Cr:t?Wt:We;return!t&&Ce(o,"iterate",a?Er:Vt),we(Object.create(p),{next(){const{value:g,done:b}=p.next();return b?{value:g,done:b}:{value:l?[u(g[0]),u(g[1])]:u(g),done:b}}})}}function An(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ji(e,t){const n={get(s){const o=this.__v_raw,i=ee(o),l=ee(s);e||(st(s,l)&&Ce(i,"get",s),Ce(i,"get",l));const{has:a}=Cn(i),p=t?Cr:e?Wt:We;if(a.call(i,s))return p(o.get(s));if(a.call(i,l))return p(o.get(l));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Ce(ee(s),"iterate",Vt),s.size},has(s){const o=this.__v_raw,i=ee(o),l=ee(s);return e||(st(s,l)&&Ce(i,"has",s),Ce(i,"has",l)),s===l?o.has(s):o.has(s)||o.has(l)},forEach(s,o){const i=this,l=i.__v_raw,a=ee(l),p=t?Cr:e?Wt:We;return!e&&Ce(a,"iterate",Vt),l.forEach((u,g)=>s.call(o,p(u),p(g),i))}};return we(n,e?{add:An("add"),set:An("set"),delete:An("delete"),clear:An("clear")}:{add(s){const o=ee(this),i=Cn(o),l=ee(s),a=!t&&!$e(s)&&!bt(s)?l:s;return i.has.call(o,a)||st(s,a)&&i.has.call(o,s)||st(l,a)&&i.has.call(o,l)||(o.add(a),ht(o,"add",a,a)),this},set(s,o){!t&&!$e(o)&&!bt(o)&&(o=ee(o));const i=ee(this),{has:l,get:a}=Cn(i);let p=l.call(i,s);p||(s=ee(s),p=l.call(i,s));const u=a.call(i,s);return i.set(s,o),p?st(o,u)&&ht(i,"set",s,o):ht(i,"add",s,o),this},delete(s){const o=ee(this),{has:i,get:l}=Cn(o);let a=i.call(o,s);a||(s=ee(s),a=i.call(o,s)),l&&l.call(o,s);const p=o.delete(s);return a&&ht(o,"delete",s,void 0),p},clear(){const s=ee(this),o=s.size!==0,i=s.clear();return o&&ht(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=zi(s,e,t)}),n}function Wr(e,t){const n=Ji(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(te(n,s)&&s in r?n:r,s,o)}const Qi={get:Wr(!1,!1)},Yi={get:Wr(!1,!0)},Xi={get:Wr(!0,!1)};const wo=new WeakMap,ko=new WeakMap,Eo=new WeakMap,Zi=new WeakMap;function el(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Yn(e){return bt(e)?e:zr(e,!1,Gi,Qi,wo)}function Co(e){return zr(e,!1,Wi,Yi,ko)}function Ar(e){return zr(e,!0,qi,Xi,Eo)}function zr(e,t,n,r,s){if(!re(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const o=s.get(e);if(o)return o;const i=el(Ai(e));if(i===0)return e;const l=new Proxy(e,i===2?r:n);return s.set(e,l),l}function jt(e){return bt(e)?jt(e.__v_raw):!!(e&&e.__v_isReactive)}function bt(e){return!!(e&&e.__v_isReadonly)}function $e(e){return!!(e&&e.__v_isShallow)}function Jr(e){return e?!!e.__v_raw:!1}function ee(e){const t=e&&e.__v_raw;return t?ee(t):e}function tl(e){return!te(e,"__v_skip")&&Object.isExtensible(e)&&io(e,"__v_skip",!0),e}const We=e=>re(e)?Yn(e):e,Wt=e=>re(e)?Ar(e):e;function Se(e){return e?e.__v_isRef===!0:!1}function ne(e){return Ao(e,!1)}function nl(e){return Ao(e,!0)}function Ao(e,t){return Se(e)?e:new rl(e,t)}class rl{constructor(t,n){this.dep=new qr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ee(t),this._value=n?t:We(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||$e(t)||bt(t);t=r?t:ee(t),st(t,n)&&(this._rawValue=t,this._value=r?t:We(t),this.dep.trigger())}}function Tt(e){return Se(e)?e.value:e}const sl={get:(e,t,n)=>t==="__v_raw"?e:Tt(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Se(s)&&!Se(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function So(e){return jt(e)?e:new Proxy(e,sl)}class ol{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new qr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=gn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ce!==this)return po(this,!0),!0}get value(){const t=this.dep.track();return mo(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function il(e,t,n=!1){let r,s;return B(e)?r=e:(r=e.get,s=e.set),new ol(r,s,n)}const Sn={},Mn=new WeakMap;let Dt;function ll(e,t=!1,n=Dt){if(n){let r=Mn.get(n);r||Mn.set(n,r=[]),r.push(e)}}function al(e,t,n=ie){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:l,call:a}=n,p=S=>s?S:$e(S)||s===!1||s===0?mt(S,1):mt(S);let u,g,b,x,N=!1,R=!1;if(Se(e)?(g=()=>e.value,N=$e(e)):jt(e)?(g=()=>p(e),N=!0):$(e)?(R=!0,N=e.some(S=>jt(S)||$e(S)),g=()=>e.map(S=>{if(Se(S))return S.value;if(jt(S))return p(S);if(B(S))return a?a(S,2):S()})):B(e)?t?g=a?()=>a(e,2):e:g=()=>{if(b){yt();try{b()}finally{vt()}}const S=Dt;Dt=u;try{return a?a(e,3,[x]):e(x)}finally{Dt=S}}:g=it,t&&s){const S=g,W=s===!0?1/0:s;g=()=>mt(S(),W)}const U=ji(),T=()=>{u.stop(),U&&U.active&&Ur(U.effects,u)};if(o&&t){const S=t;t=(...W)=>{const le=S(...W);return T(),le}}let k=R?new Array(e.length).fill(Sn):Sn;const D=S=>{if(!(!(u.flags&1)||!u.dirty&&!S))if(t){const W=u.run();if(S||s||N||(R?W.some((le,X)=>st(le,k[X])):st(W,k))){b&&b();const le=Dt;Dt=u;try{const X=[W,k===Sn?void 0:R&&k[0]===Sn?[]:k,x];k=W,a?a(t,3,X):t(...X)}finally{Dt=le}}}else u.run()};return l&&l(D),u=new uo(g),u.scheduler=i?()=>i(D,!1):D,x=S=>ll(S,!1,u),b=u.onStop=()=>{const S=Mn.get(u);if(S){if(a)a(S,4);else for(const W of S)W();Mn.delete(u)}},t?r?D(!0):k=u.run():i?i(D.bind(null,!0),!0):u.run(),T.pause=u.pause.bind(u),T.resume=u.resume.bind(u),T.stop=T,T}function mt(e,t=1/0,n){if(t<=0||!re(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Se(e))mt(e.value,t,n);else if($(e))for(let r=0;r{mt(r,t,n)});else if(oo(e)){for(const r in e)mt(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&mt(e[r],t,n)}return e}/** +* @vue/runtime-core v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function kn(e,t,n,r){try{return r?e(...r):e()}catch(s){Xn(s,t,n)}}function ze(e,t,n,r){if(B(e)){const s=kn(e,t,n,r);return s&&ro(s)&&s.catch(o=>{Xn(o,t,n)}),s}if($(e)){const s=[];for(let o=0;o>>1,s=Ie[r],o=mn(s);o=mn(n)?Ie.push(e):Ie.splice(ul(t),0,e),e.flags|=1,Oo()}}function Oo(){Vn||(Vn=Ro.then(Io))}function fl(e){if(!$(e))At&&e.id===-1?At.splice($t+1,0,e):e.flags&1||(Gt.push(e),e.flags|=1);else for(let t=0;tmn(n)-mn(r));if(Gt.length=0,At){for(let n=0;ne.id==null?e.flags&2?-1:1/0:e.id;function Io(e){try{for(tt=0;tt{r._d&&Fn(-1);const o=jn(t),i=Lt.length;let l;try{l=e(...s)}finally{for(let a=Lt.length;a>i;a--)si();jn(o),r._d&&Fn(1)}return l};return r._n=!0,r._c=!0,r._d=!0,r}function ae(e,t){if(Le===null)return e;const n=rr(Le),r=e.dirs||(e.dirs=[]);for(let s=0;s1)return n&&B(t)?t.call(r&&r.proxy):t}}const dl=Symbol.for("v-scx"),pl=()=>qe(dl);function Pn(e,t,n){return No(e,t,n)}function No(e,t,n=ie){const{immediate:r,deep:s,flush:o,once:i}=n,l=we({},n),a=t&&r||!t&&o!=="post";let p;if(bn){if(o==="sync"){const x=pl();p=x.__watcherHandles||(x.__watcherHandles=[])}else if(!a){const x=()=>{};return x.stop=it,x.resume=it,x.pause=it,x}}const u=Ae;l.call=(x,N,R)=>ze(x,u,N,R);let g=!1;o==="post"?l.scheduler=x=>{De(x,u&&u.suspense)}:o!=="sync"&&(g=!0,l.scheduler=(x,N)=>{N?x():Yr(x)}),l.augmentJob=x=>{t&&(x.flags|=4),g&&(x.flags|=2,u&&(x.id=u.uid,x.i=u))};const b=al(e,t,l);return bn&&(p?p.push(b):a&&b()),b}function gl(e,t,n){const r=this.proxy,s=ge(e)?e.includes(".")?Do(r,e):()=>r[e]:e.bind(r,r);let o;B(t)?o=t:(o=t.handler,n=t);const i=En(this),l=No(s,o.bind(r),n);return i(),l}function Do(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;se.__isTeleport,fr=Symbol("_leaveCb");function ml(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==xt){t=n;break}}return t}function Mo(e){if(!Zr(e))return Zn(e.type)&&e.children?ml(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&B(n.default))return n.default()}}function Xr(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;Xr(Zn(n.type)&&Mo(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Vo(e,t){return B(e)?we({name:e.name},t,{setup:e}):e}function jo(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ps(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ln=new WeakMap;function un(e,t,n,r,s=!1){if($(e)){e.forEach((R,U)=>un(R,t&&($(t)?t[U]:t),n,r,s));return}if(fn(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&un(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?rr(r.component):r.el,i=s?null:o,{i:l,r:a}=e,p=t&&t.r,u=l.refs===ie?l.refs={}:l.refs,g=l.setupState,b=ee(g),x=g===ie?no:R=>ps(u,R)?!1:te(b,R),N=(R,U)=>!(U&&ps(u,U));if(p!=null&&p!==a){if(gs(t),ge(p))u[p]=null,x(p)&&(g[p]=null);else if(Se(p)){const R=t;N(p,R.k)&&(p.value=null),R.k&&(u[R.k]=null)}}if(B(a))kn(a,l,12,[i,u]);else{const R=ge(a),U=Se(a);if(R||U){const T=()=>{if(e.f){const k=R?x(a)?g[a]:u[a]:N()||!e.k?a.value:u[e.k];if(s)$(k)&&Ur(k,o);else if($(k))k.includes(o)||k.push(o);else if(R)u[a]=[o],x(a)&&(g[a]=u[a]);else{const D=[o];N(a,e.k)&&(a.value=D),e.k&&(u[e.k]=D)}}else R?(u[a]=i,x(a)&&(g[a]=i)):U&&(N(a,e.k)&&(a.value=i),e.k&&(u[e.k]=i))};if(i){const k=()=>{T(),Ln.delete(e)};k.id=-1,Ln.set(e,k),De(k,n)}else gs(e),T()}}}function gs(e){const t=Ln.get(e);t&&(t.flags|=8,Ln.delete(e))}Jn().requestIdleCallback;Jn().cancelIdleCallback;const fn=e=>!!e.type.__asyncLoader,Zr=e=>e.type.__isKeepAlive;function yl(e,t){Lo(e,"a",t)}function vl(e,t){Lo(e,"da",t)}function Lo(e,t,n=Ae){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(er(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Zr(s.parent.vnode)&&bl(r,t,n,s),s=s.parent}}function bl(e,t,n,r){const s=er(t,e,r,!0);Uo(()=>{Ur(r[t],s)},n)}function er(e,t,n=Ae,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{yt();const l=En(n),a=ze(t,n,e,i);return l(),vt(),a});return r?s.unshift(o):s.push(o),o}}const _t=e=>(t,n=Ae)=>{(!bn||e==="sp")&&er(e,(...r)=>t(...r),n)},xl=_t("bm"),es=_t("m"),_l=_t("bu"),wl=_t("u"),kl=_t("bum"),Uo=_t("um"),El=_t("sp"),Cl=_t("rtg"),Al=_t("rtc");function Sl(e,t=Ae){er("ec",e,t)}const Rl="components";function Fo(e,t){return Tl(Rl,e,!0,t)||e}const Ol=Symbol.for("v-ndc");function Tl(e,t,n=!0,r=!1){const s=Le||Ae;if(s){const o=s.type;{const l=ha(o,!1);if(l&&(l===t||l===Pe(t)||l===Wn(Pe(t))))return o}const i=hs(s[e]||o[e],t)||hs(s.appContext[e],t);return!i&&r?o:i}}function hs(e,t){return e&&(e[t]||e[Pe(t)]||e[Wn(Pe(t))])}function Ke(e,t,n,r){let s;const o=n,i=$(e);if(i||ge(e)){const l=i&&jt(e);let a=!1,p=!1;l&&(a=!$e(e),p=bt(e),e=Qn(e)),s=new Array(e.length);for(let u=0,g=e.length;ut(l,a,void 0,o));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,p=l.length;ae?li(e)?rr(e):Rr(e.parent):null,dn=we(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Rr(e.parent),$root:e=>Rr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ho(e),$forceUpdate:e=>e.f||(e.f=()=>{Yr(e.update)}),$nextTick:e=>e.n||(e.n=Qr.bind(e.proxy)),$watch:e=>gl.bind(e)}),dr=(e,t)=>e!==ie&&!e.__isScriptSetup&&te(e,t),Il={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:o,accessCache:i,type:l,appContext:a}=e;if(t[0]!=="$"){const b=i[t];if(b!==void 0)switch(b){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(dr(r,t))return i[t]=1,r[t];if(s!==ie&&te(s,t))return i[t]=2,s[t];if(te(o,t))return i[t]=3,o[t];if(n!==ie&&te(n,t))return i[t]=4,n[t];Or&&(i[t]=0)}}const p=dn[t];let u,g;if(p)return t==="$attrs"&&Ce(e.attrs,"get",""),p(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==ie&&te(n,t))return i[t]=4,n[t];if(g=a.config.globalProperties,te(g,t))return g[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return dr(s,t)?(s[t]=n,!0):r!==ie&&te(r,t)?(r[t]=n,!0):te(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,props:o,type:i}},l){let a;return!!(n[l]||e!==ie&&l[0]!=="$"&&te(e,l)||dr(t,l)||te(o,l)||te(r,l)||te(dn,l)||te(s.config.globalProperties,l)||(a=i.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:te(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ms(e){return $(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Or=!0;function Pl(e){const t=Ho(e),n=e.proxy,r=e.ctx;Or=!1,t.beforeCreate&&ys(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:l,provide:a,inject:p,created:u,beforeMount:g,mounted:b,beforeUpdate:x,updated:N,activated:R,deactivated:U,beforeDestroy:T,beforeUnmount:k,destroyed:D,unmounted:S,render:W,renderTracked:le,renderTriggered:X,errorCaptured:K,serverPrefetch:He,expose:Ne,inheritAttrs:Qe,components:at,directives:Fe,filters:It}=t;if(p&&Nl(p,r,null),i)for(const Q in i){const q=i[Q];B(q)&&(r[Q]=q.bind(n))}if(s){const Q=s.call(n,n);re(Q)&&(e.data=Yn(Q))}if(Or=!0,o)for(const Q in o){const q=o[Q],Y=B(q)?q.bind(n,n):B(q.get)?q.get.bind(n,n):it,Be=!B(q)&&B(q.set)?q.set.bind(n):it,Re=je({get:Y,set:Be});Object.defineProperty(r,Q,{enumerable:!0,configurable:!0,get:()=>Re.value,set:ke=>Re.value=ke})}if(l)for(const Q in l)$o(l[Q],r,n,Q);if(a){const Q=B(a)?a.call(n):a;Reflect.ownKeys(Q).forEach(q=>{In(q,Q[q])})}u&&ys(u,e,"c");function he(Q,q){$(q)?q.forEach(Y=>Q(Y.bind(n))):q&&Q(q.bind(n))}if(he(xl,g),he(es,b),he(_l,x),he(wl,N),he(yl,R),he(vl,U),he(Sl,K),he(Al,le),he(Cl,X),he(kl,k),he(Uo,S),he(El,He),$(Ne))if(Ne.length){const Q=e.exposed||(e.exposed={});Ne.forEach(q=>{Object.defineProperty(Q,q,{get:()=>n[q],set:Y=>n[q]=Y,enumerable:!0})})}else e.exposed||(e.exposed={});W&&e.render===it&&(e.render=W),Qe!=null&&(e.inheritAttrs=Qe),at&&(e.components=at),Fe&&(e.directives=Fe),He&&jo(e)}function Nl(e,t,n=it){$(e)&&(e=Tr(e));for(const r in e){const s=e[r];let o;re(s)?"default"in s?o=qe(s.from||r,s.default,!0):o=qe(s.from||r):o=qe(s),Se(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function ys(e,t,n){ze($(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function $o(e,t,n,r){let s=r.includes(".")?Do(n,r):()=>n[r];if(ge(e)){const o=t[e];B(o)&&Pn(s,o)}else if(B(e))Pn(s,e.bind(n));else if(re(e))if($(e))e.forEach(o=>$o(o,t,n,r));else{const o=B(e.handler)?e.handler.bind(n):t[e.handler];B(o)&&Pn(s,o,e)}}function Ho(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,l=o.get(t);let a;return l?a=l:!s.length&&!n&&!r?a=t:(a={},s.length&&s.forEach(p=>Un(a,p,i,!0)),Un(a,t,i)),re(t)&&o.set(t,a),a}function Un(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Un(e,o,n,!0),s&&s.forEach(i=>Un(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const l=Dl[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const Dl={data:vs,props:bs,emits:bs,methods:sn,computed:sn,beforeCreate:Oe,created:Oe,beforeMount:Oe,mounted:Oe,beforeUpdate:Oe,updated:Oe,beforeDestroy:Oe,beforeUnmount:Oe,destroyed:Oe,unmounted:Oe,activated:Oe,deactivated:Oe,errorCaptured:Oe,serverPrefetch:Oe,components:sn,directives:sn,watch:Vl,provide:vs,inject:Ml};function vs(e,t){return t?e?function(){return we(B(e)?e.call(this,this):e,B(t)?t.call(this,this):t)}:t:e}function Ml(e,t){return sn(Tr(e),Tr(t))}function Tr(e){if($(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Pe(t)}Modifiers`]||e[`${Ut(t)}Modifiers`];function Fl(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||ie;let s=n;const o=t.startsWith("update:"),i=o&&Ul(r,t.slice(7));i&&(i.trim&&(s=n.map(u=>ge(u)?u.trim():u)),i.number&&(s=n.map(zn)));let l,a=r[l=ir(t)]||r[l=ir(Pe(t))];!a&&o&&(a=r[l=ir(Ut(t))]),a&&ze(a,e,6,s);const p=r[l+"Once"];if(p){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,ze(p,e,6,s)}}const $l=new WeakMap;function Ko(e,t,n=!1){const r=n?$l:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},l=!1;if(!B(e)){const a=p=>{const u=Ko(p,t,!0);u&&(l=!0,we(i,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!o&&!l?(re(e)&&r.set(e,null),null):($(o)?o.forEach(a=>i[a]=null):we(i,o),re(e)&&r.set(e,i),i)}function tr(e,t){return!e||!Kn(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),te(e,t[0].toLowerCase()+t.slice(1))||te(e,Ut(t))||te(e,t))}function xs(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:l,emit:a,render:p,renderCache:u,props:g,data:b,setupState:x,ctx:N,inheritAttrs:R}=e,U=jn(e);let T,k;try{if(n.shapeFlag&4){const S=s||r,W=S;T=rt(p.call(W,S,u,g,x,b,N)),k=l}else{const S=t;T=rt(S.length>1?S(g,{attrs:l,slots:i,emit:a}):S(g,null)),k=t.props?l:Hl(l)}}catch(S){Lt.length=0,Xn(S,e,1),T=_e(xt)}let D=T;if(k&&R!==!1){const S=Object.keys(k),{shapeFlag:W}=D;S.length&&W&7&&(o&&S.some(Gn)&&(k=Bl(k,o)),D=zt(D,k,!1,!0))}if(n.dirs&&(D=zt(D,null,!1,!0),D.dirs=D.dirs?D.dirs.concat(n.dirs):n.dirs),n.transition){const S=Zn(D.type)&&Mo(D)||D;Xr(S,n.transition)}return T=D,jn(U),T}const Hl=e=>{let t;for(const n in e)(n==="class"||n==="style"||Kn(n))&&((t||(t={}))[n]=e[n]);return t},Bl=(e,t)=>{const n={};for(const r in e)(!Gn(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Kl(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:l,patchFlag:a}=t,p=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return r?_s(r,i,p):!!i;if(a&8){const u=t.dynamicProps;for(let g=0;gObject.create(qo),zo=e=>Object.getPrototypeOf(e)===qo;function ql(e,t,n,r=!1){const s={},o=Wo();e.propsDefaults=Object.create(null),Jo(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Co(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Wl(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,l=ee(s),[a]=e.propsOptions;let p=!1;if((r||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let g=0;g{a=!0;const[b,x]=Qo(g,t,!0);we(i,b),x&&l.push(...x)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!o&&!a)return re(e)&&r.set(e,Bt),Bt;if($(o))for(let u=0;ue==="_"||e==="_ctx"||e==="$stable",ns=e=>$(e)?e.map(rt):[rt(e)],Jl=(e,t,n)=>{if(t._n)return t;const r=Sr((...s)=>ns(t(...s)),n);return r._c=!1,r},Yo=(e,t,n)=>{const r=e._ctx;for(const s in e){if(ts(s))continue;const o=e[s];if(B(o))t[s]=Jl(s,o,r);else if(o!=null){const i=ns(o);t[s]=()=>i}}},Xo=(e,t)=>{const n=ns(t);e.slots.default=()=>n},Zo=(e,t,n)=>{for(const r in t)(n||!ts(r))&&(e[r]=t[r])},Ql=(e,t,n)=>{const r=e.slots=Wo();if(e.vnode.shapeFlag&32){const s=t._;s?(Zo(r,t,n),n&&io(r,"_",s,!0)):Yo(t,r)}else t&&Xo(e,t)},Yl=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=ie;if(r.shapeFlag&32){const l=t._;l?n&&l===1?o=!1:Zo(s,t,n):(o=!t.$stable,Yo(t,s)),i=t}else t&&(Xo(e,t),i={default:1});if(o)for(const l in s)!ts(l)&&i[l]==null&&delete s[l]},De=na;function Xl(e){return Zl(e)}function Zl(e,t){const n=Jn();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:l,createComment:a,setText:p,setElementText:u,parentNode:g,nextSibling:b,setScopeId:x=it,insertStaticContent:N}=e,R=(c,f,m,_=null,y=null,d=null,h=void 0,C=null,A=!!f.dynamicChildren)=>{if(c===f)return;c&&!nn(c,f)&&(_=w(c),ke(c,y,d,!0),c=null),f.patchFlag===-2&&(A=!1,f.dynamicChildren=null);const{type:E,ref:F,shapeFlag:I}=f;switch(E){case nr:U(c,f,m,_);break;case xt:T(c,f,m,_);break;case gr:c==null&&k(f,m,_,h);break;case pe:at(c,f,m,_,y,d,h,C,A);break;default:I&1?W(c,f,m,_,y,d,h,C,A):I&6?Fe(c,f,m,_,y,d,h,C,A):(I&64||I&128)&&E.process(c,f,m,_,y,d,h,C,A,j)}F!=null&&y?un(F,c&&c.ref,d,f||c,!f):F==null&&c&&c.ref!=null&&un(c.ref,null,d,c,!0)},U=(c,f,m,_)=>{if(c==null)r(f.el=l(f.children),m,_);else{const y=f.el=c.el;f.children!==c.children&&p(y,f.children)}},T=(c,f,m,_)=>{c==null?r(f.el=a(f.children||""),m,_):f.el=c.el},k=(c,f,m,_)=>{[c.el,c.anchor]=N(c.children,f,m,_,c.el,c.anchor)},D=({el:c,anchor:f},m,_)=>{let y;for(;c&&c!==f;)y=b(c),r(c,m,_),c=y;r(f,m,_)},S=({el:c,anchor:f})=>{let m;for(;c&&c!==f;)m=b(c),s(c),c=m;s(f)},W=(c,f,m,_,y,d,h,C,A)=>{if(f.type==="svg"?h="svg":f.type==="math"&&(h="mathml"),c==null)le(f,m,_,y,d,h,C,A);else{const E=c.el&&c.el._isVueCE?c.el:null;try{E&&E._beginPatch(),He(c,f,y,d,h,C,A)}finally{E&&E._endPatch()}}},le=(c,f,m,_,y,d,h,C)=>{let A,E;const{props:F,shapeFlag:I,transition:L,dirs:H}=c;if(A=c.el=i(c.type,d,F&&F.is,F),I&8?u(A,c.children):I&16&&K(c.children,A,null,_,y,pr(c,d),h,C),H&&Pt(c,null,_,"created"),X(A,c,c.scopeId,h,_),F){for(const oe in F)oe!=="value"&&!ln(oe)&&o(A,oe,null,F[oe],d,_);"value"in F&&o(A,"value",null,F.value,d),(E=F.onVnodeBeforeMount)&&et(E,_,c)}H&&Pt(c,null,_,"beforeMount");const z=ea(y,L);z&&L.beforeEnter(A),r(A,f,m),((E=F&&F.onVnodeMounted)||z||H)&&De(()=>{try{E&&et(E,_,c),z&&L.enter(A),H&&Pt(c,null,_,"mounted")}finally{}},y)},X=(c,f,m,_,y)=>{if(m&&x(c,m),_)for(let d=0;d<_.length;d++)x(c,_[d]);if(y){let d=y.subTree;if(f===d||ri(d.type)&&(d.ssContent===f||d.ssFallback===f)){const h=y.vnode;X(c,h,h.scopeId,h.slotScopeIds,y.parent)}}},K=(c,f,m,_,y,d,h,C,A=0)=>{for(let E=A;E{const C=f.el=c.el;let{patchFlag:A,dynamicChildren:E,dirs:F}=f;A|=c.patchFlag&16;const I=c.props||ie,L=f.props||ie;let H;if(m&&Nt(m,!1),(H=L.onVnodeBeforeUpdate)&&et(H,m,f,c),F&&Pt(f,c,m,"beforeUpdate"),m&&Nt(m,!0),E&&(!c.dynamicChildren||c.dynamicChildren.length!==E.length)&&(A=0,h=!1,E=null),(I.innerHTML&&L.innerHTML==null||I.textContent&&L.textContent==null)&&u(C,""),E?Ne(c.dynamicChildren,E,C,m,_,pr(f,y),d):h||q(c,f,C,null,m,_,pr(f,y),d,!1),A>0){if(A&16)Qe(C,I,L,m,y);else if(A&2&&I.class!==L.class&&o(C,"class",null,L.class,y),A&4&&o(C,"style",I.style,L.style,y),A&8){const z=f.dynamicProps;for(let oe=0;oe{H&&et(H,m,f,c),F&&Pt(f,c,m,"updated")},_)},Ne=(c,f,m,_,y,d,h)=>{for(let C=0;C{if(f!==m){if(f!==ie)for(const d in f)!ln(d)&&!(d in m)&&o(c,d,f[d],null,y,_);for(const d in m){if(ln(d))continue;const h=m[d],C=f[d];h!==C&&d!=="value"&&o(c,d,C,h,y,_)}"value"in m&&o(c,"value",f.value,m.value,y)}},at=(c,f,m,_,y,d,h,C,A)=>{const E=f.el=c?c.el:l(""),F=f.anchor=c?c.anchor:l("");let{patchFlag:I,dynamicChildren:L,slotScopeIds:H}=f;H&&(C=C?C.concat(H):H),c==null?(r(E,m,_),r(F,m,_),K(f.children||[],m,F,y,d,h,C,A)):I>0&&I&64&&L&&c.dynamicChildren&&c.dynamicChildren.length===L.length?(Ne(c.dynamicChildren,L,m,y,d,h,C),(f.key!=null||y&&f===y.subTree)&&ei(c,f,!0)):q(c,f,m,F,y,d,h,C,A)},Fe=(c,f,m,_,y,d,h,C,A)=>{f.slotScopeIds=C,c==null?f.shapeFlag&512?y.ctx.activate(f,m,_,h,A):It(f,m,_,y,d,h,A):wt(c,f,A)},It=(c,f,m,_,y,d,h)=>{const C=c.component=ca(c,_,y);if(Zr(c)&&(C.ctx.renderer=j),fa(C,!1,h),C.asyncDep){if(y&&y.registerDep(C,he,h),!c.el){const A=C.subTree=_e(xt);T(null,A,f,m),c.placeholder=A.el}}else he(C,c,f,m,y,d,h)},wt=(c,f,m)=>{const _=f.component=c.component;if(Kl(c,f,m))if(_.asyncDep&&!_.asyncResolved){Q(_,f,m);return}else _.next=f,_.update();else f.el=c.el,_.vnode=f},he=(c,f,m,_,y,d,h)=>{const C=()=>{if(c.isMounted){let{next:I,bu:L,u:H,parent:z,vnode:oe}=c;{const Xe=ti(c);if(Xe){I&&(I.el=oe.el,Q(c,I,h)),Xe.asyncDep.then(()=>{De(()=>{c.isUnmounted||E()},y)});return}}let se=I,me;Nt(c,!1),I?(I.el=oe.el,Q(c,I,h)):I=oe,L&&Tn(L),(me=I.props&&I.props.onVnodeBeforeUpdate)&&et(me,z,I,oe),Nt(c,!0);const be=xs(c),Ye=c.subTree;c.subTree=be,R(Ye,be,g(Ye.el),w(Ye),c,y,d),I.el=be.el,se===null&&Gl(c,be.el),H&&De(H,y),(me=I.props&&I.props.onVnodeUpdated)&&De(()=>et(me,z,I,oe),y)}else{let I;const{el:L,props:H}=f,{bm:z,m:oe,parent:se,root:me,type:be}=c,Ye=fn(f);Nt(c,!1),z&&Tn(z),!Ye&&(I=H&&H.onVnodeBeforeMount)&&et(I,se,f),Nt(c,!0);{me.ce&&me.ce._hasShadowRoot()&&me.ce._injectChildStyle(be,c.parent?c.parent.type:void 0);const Xe=c.subTree=xs(c);R(null,Xe,m,_,c,y,d),f.el=Xe.el}if(oe&&De(oe,y),!Ye&&(I=H&&H.onVnodeMounted)){const Xe=f;De(()=>et(I,se,Xe),y)}(f.shapeFlag&256||se&&fn(se.vnode)&&se.vnode.shapeFlag&256)&&c.a&&De(c.a,y),c.isMounted=!0,f=m=_=null}};c.scope.on();const A=c.effect=new uo(C);c.scope.off();const E=c.update=A.run.bind(A),F=c.job=A.runIfDirty.bind(A);F.i=c,F.id=c.uid,A.scheduler=()=>Yr(F),Nt(c,!0),E()},Q=(c,f,m)=>{f.component=c;const _=c.vnode.props;c.vnode=f,c.next=null,Wl(c,f.props,_,m),Yl(c,f.children,m),yt(),ds(c),vt()},q=(c,f,m,_,y,d,h,C,A=!1)=>{const E=c&&c.children,F=c?c.shapeFlag:0,I=f.children,{patchFlag:L,shapeFlag:H}=f;if(L>0){if(L&128){Be(E,I,m,_,y,d,h,C,A);return}else if(L&256){Y(E,I,m,_,y,d,h,C,A);return}}H&8?(F&16&&Ee(E,y,d),I!==E&&u(m,I)):F&16?H&16?Be(E,I,m,_,y,d,h,C,A):Ee(E,y,d,!0):(F&8&&u(m,""),H&16&&K(I,m,_,y,d,h,C,A))},Y=(c,f,m,_,y,d,h,C,A)=>{c=c||Bt,f=f||Bt;const E=c.length,F=f.length,I=Math.min(E,F);let L;for(L=0;LF?Ee(c,y,d,!0,!1,I):K(f,m,_,y,d,h,C,A,I)},Be=(c,f,m,_,y,d,h,C,A)=>{let E=0;const F=f.length;let I=c.length-1,L=F-1;for(;E<=I&&E<=L;){const H=c[E],z=f[E]=A?gt(f[E]):rt(f[E]);if(nn(H,z))R(H,z,m,null,y,d,h,C,A);else break;E++}for(;E<=I&&E<=L;){const H=c[I],z=f[L]=A?gt(f[L]):rt(f[L]);if(nn(H,z))R(H,z,m,null,y,d,h,C,A);else break;I--,L--}if(E>I){if(E<=L){const H=L+1,z=HL)for(;E<=I;)ke(c[E],y,d,!0),E++;else{const H=E,z=E,oe=new Map;for(E=z;E<=L;E++){const Me=f[E]=A?gt(f[E]):rt(f[E]);Me.key!=null&&oe.set(Me.key,E)}let se,me=0;const be=L-z+1;let Ye=!1,Xe=0;const en=new Array(be);for(E=0;E=be){ke(Me,y,d,!0);continue}let Ze;if(Me.key!=null)Ze=oe.get(Me.key);else for(se=z;se<=L;se++)if(en[se-z]===0&&nn(Me,f[se])){Ze=se;break}Ze===void 0?ke(Me,y,d,!0):(en[Ze-z]=E+1,Ze>=Xe?Xe=Ze:Ye=!0,R(Me,f[Ze],m,null,y,d,h,C,A),me++)}const os=Ye?ta(en):Bt;for(se=os.length-1,E=be-1;E>=0;E--){const Me=z+E,Ze=f[Me],is=f[Me+1],ls=Me+1{const{el:d,type:h,transition:C,children:A,shapeFlag:E}=c;if(E&6){Re(c.component.subTree,f,m,_);return}if(E&128){c.suspense.move(f,m,_);return}if(E&64){h.move(c,f,m,j);return}if(h===pe){r(d,f,m);for(let I=0;IC.enter(d),y));else{const{leave:I,delayLeave:L,afterLeave:H}=C,z=()=>{c.ctx.isUnmounted?s(d):r(d,f,m)},oe=()=>{const se=d._isLeaving||!!d[fr];d._isLeaving&&d[fr](!0),C.persisted&&!se?z():I(d,()=>{z(),H&&H()})};L?L(d,z,oe):oe()}else r(d,f,m)},ke=(c,f,m,_=!1,y=!1)=>{const{type:d,props:h,ref:C,children:A,dynamicChildren:E,shapeFlag:F,patchFlag:I,dirs:L,cacheIndex:H,memo:z}=c;if(I===-2&&(y=!1),C!=null&&(yt(),un(C,null,m,c,!0),vt()),H!=null&&(f.renderCache[H]=void 0),F&256){f.ctx.deactivate(c);return}const oe=F&1&&L,se=!fn(c);let me;if(se&&(me=h&&h.onVnodeBeforeUnmount)&&et(me,f,c),F&6)ct(c.component,m,_);else{if(F&128){c.suspense.unmount(m,_);return}oe&&Pt(c,null,f,"beforeUnmount"),F&64?c.type.remove(c,f,m,j,_):E&&!E.hasOnce&&(d!==pe||I>0&&I&64)?Ee(E,f,m,!1,!0):(d===pe&&I&384||!y&&F&16)&&Ee(A,f,m),_&&kt(c)}const be=z!=null&&H==null;(se&&(me=h&&h.onVnodeUnmounted)||oe||be)&&De(()=>{me&&et(me,f,c),oe&&Pt(c,null,f,"unmounted"),be&&(c.el=null)},m)},kt=c=>{const{type:f,el:m,anchor:_,transition:y}=c;if(f===pe){Et(m,_);return}if(f===gr){S(c);return}const d=()=>{s(m),y&&!y.persisted&&y.afterLeave&&y.afterLeave()};if(c.shapeFlag&1&&y&&!y.persisted){const{leave:h,delayLeave:C}=y,A=()=>h(m,d);C?C(c.el,d,A):A()}else d()},Et=(c,f)=>{let m;for(;c!==f;)m=b(c),s(c),c=m;s(f)},ct=(c,f,m)=>{const{bum:_,scope:y,job:d,subTree:h,um:C,m:A,a:E}=c;ks(A),ks(E),_&&Tn(_),y.stop(),d&&(d.flags|=8,ke(h,c,f,m)),C&&De(C,f),De(()=>{c.isUnmounted=!0},f)},Ee=(c,f,m,_=!1,y=!1,d=0)=>{for(let h=d;h{if(c.shapeFlag&6)return w(c.component.subTree);if(c.shapeFlag&128)return c.suspense.next();const f=b(c.anchor||c.el),m=f&&f[hl];return m?b(m):f};let P=!1;const O=(c,f,m)=>{let _;c==null?f._vnode&&(ke(f._vnode,null,null,!0),_=f._vnode.component):R(f._vnode||null,c,f,null,null,null,m),f._vnode=c,P||(P=!0,ds(_),To(),P=!1)},j={p:R,um:ke,m:Re,r:kt,mt:It,mc:K,pc:q,pbc:Ne,n:w,o:e};return{render:O,hydrate:void 0,createApp:Ll(O)}}function pr({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Nt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ea(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ei(e,t,n=!1){const r=e.children,s=t.children;if($(r)&&$(s))for(let o=0;o>1,e[n[l]]0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function ti(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ti(t)}function ks(e){if(e)for(let t=0;te.__isSuspense;function na(e,t){t&&t.pendingBranch?$(e)?t.effects.push(...e):t.effects.push(e):fl(e)}const pe=Symbol.for("v-fgt"),nr=Symbol.for("v-txt"),xt=Symbol.for("v-cmt"),gr=Symbol.for("v-stc"),Lt=[];let Ue=null;function M(e=!1){Lt.push(Ue=e?null:[])}function si(){Lt.pop(),Ue=Lt[Lt.length-1]||null}let yn=1;function Fn(e,t=!1){yn+=e,e<0&&Ue&&t&&(Ue.hasOnce=!0)}function oi(e){return e.dynamicChildren=yn>0?Ue||Bt:null,si(),yn>0&&Ue&&Ue.push(e),e}function V(e,t,n,r,s,o){return oi(v(e,t,n,r,s,o,!0))}function ra(e,t,n,r,s){return oi(_e(e,t,n,r,s,!0))}function $n(e){return e?e.__v_isVNode===!0:!1}function nn(e,t){return e.type===t.type&&e.key===t.key}const ii=({key:e})=>e??null,Nn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?ge(e)||Se(e)||B(e)?{i:Le,r:e,k:t,f:!!n}:e:null);function v(e,t=null,n=null,r=0,s=null,o=e===pe?0:1,i=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ii(t),ref:t&&Nn(t),scopeId:Po,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Le};return l?(Hn(a,n),o&128&&e.normalize(a)):n&&(a.shapeFlag|=ge(n)?8:16),yn>0&&!i&&Ue&&(a.patchFlag>0||o&6)&&a.patchFlag!==32&&Ue.push(a),a}const _e=sa;function sa(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===Ol)&&(e=xt),$n(e)){const l=zt(e,t,!0);return n&&Hn(l,n),yn>0&&!o&&Ue&&(l.shapeFlag&6?Ue[Ue.indexOf(e)]=l:Ue.push(l)),l.patchFlag=-2,l}if(ma(e)&&(e=e.__vccOpts),t){t=oa(t);let{class:l,style:a}=t;l&&!ge(l)&&(t.class=Ve(l)),re(a)&&(Jr(a)&&!$(a)&&(a=we({},a)),t.style=$r(a))}const i=ge(e)?1:ri(e)?128:Zn(e)?64:re(e)?4:B(e)?2:0;return v(e,t,n,r,s,i,o,!0)}function oa(e){return e?Jr(e)||zo(e)?we({},e):e:null}function zt(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:l,transition:a}=e,p=t?ia(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:p,key:p&&ii(p),ref:t&&t.ref?n&&o?$(o)?o.concat(Nn(t)):[o,Nn(t)]:Nn(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==pe?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&zt(e.ssContent),ssFallback:e.ssFallback&&zt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&r&&Xr(u,a.clone(u)),u}function pt(e=" ",t=0){return _e(nr,null,e,t)}function ue(e="",t=!1){return t?(M(),ra(xt,null,e)):_e(xt,null,e)}function rt(e){return e==null||typeof e=="boolean"?_e(xt):$(e)?_e(pe,null,e.slice()):$n(e)?gt(e):_e(nr,null,String(e))}function gt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:zt(e)}function Hn(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if($(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),Hn(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!zo(t)?t._ctx=Le:s===3&&Le&&(Le.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(B(t)){if(r&65){Hn(e,{default:t});return}t={default:t,_ctx:Le},n=32}else t=String(t),r&64?(n=16,t=[pt(t)]):n=8;e.children=t,e.shapeFlag|=n}function ia(...e){const t={};for(let n=0;nAe||Le;let Bn,vn;{const e=Jn(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),o=>{s.length>1?s.forEach(i=>i(o)):s[0](o)}};Bn=t("__VUE_INSTANCE_SETTERS__",n=>Ae=n),vn=t("__VUE_SSR_SETTERS__",n=>bn=n)}const En=e=>{const t=Ae;return Bn(e),e.scope.on(),()=>{e.scope.off(),Bn(t)}},Es=()=>{Ae&&Ae.scope.off(),Bn(null)};function li(e){return e.vnode.shapeFlag&4}let bn=!1;function fa(e,t=!1,n=!1){t&&vn(t);const{props:r,children:s}=e.vnode,o=li(e);ql(e,r,o,t),Ql(e,s,n||t);const i=o?da(e,t):void 0;return t&&vn(!1),i}function da(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Il);const{setup:r}=n;if(r){yt();const s=e.setupContext=r.length>1?ga(e):null,o=En(e),i=kn(r,e,0,[e.props,s]),l=ro(i);if(vt(),o(),(l||e.sp)&&!fn(e)&&jo(e),l){if(i.then(Es,Es),t)return i.then(a=>{vn(!0);try{Cs(e,a,t)}finally{vn(!1)}}).catch(a=>{Xn(a,e,0)});e.asyncDep=i}else Cs(e,i)}else ai(e)}function Cs(e,t,n){B(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:re(t)&&(e.setupState=So(t)),ai(e)}function ai(e,t,n){const r=e.type;e.render||(e.render=r.render||it);{const s=En(e);yt();try{Pl(e)}finally{vt(),s()}}}const pa={get(e,t){return Ce(e,"get",""),e[t]}};function ga(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,pa),slots:e.slots,emit:e.emit,expose:t}}function rr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(So(tl(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in dn)return dn[n](e)},has(t,n){return n in t||n in dn}})):e.proxy}function ha(e,t=!0){return B(e)?e.displayName||e.name:e.name||t&&e.__name}function ma(e){return B(e)&&"__vccOpts"in e}const je=(e,t)=>il(e,t,bn);function ci(e,t,n){try{Fn(-1);const r=arguments.length;return r===2?re(t)&&!$(t)?$n(t)?_e(e,null,[t]):_e(e,t):_e(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&$n(n)&&(n=[n]),_e(e,t,n))}finally{Fn(1)}}const ya="3.5.41";/** +* @vue/runtime-dom v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Pr;const As=typeof window<"u"&&window.trustedTypes;if(As)try{Pr=As.createPolicy("vue",{createHTML:e=>e})}catch{}const ui=Pr?e=>Pr.createHTML(e):e=>e,va="http://www.w3.org/2000/svg",ba="http://www.w3.org/1998/Math/MathML",dt=typeof document<"u"?document:null,Ss=dt&&dt.createElement("template"),xa={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?dt.createElementNS(va,e):t==="mathml"?dt.createElementNS(ba,e):n?dt.createElement(e,{is:n}):dt.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>dt.createTextNode(e),createComment:e=>dt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>dt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,o){const i=n?n.previousSibling:t.lastChild;if(s&&(s===o||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===o||!(s=s.nextSibling)););else{Ss.innerHTML=ui(r==="svg"?`${e}`:r==="mathml"?`${e}`:e);const l=Ss.content;if(r==="svg"||r==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},_a=Symbol("_vtc");function wa(e,t,n){const r=e[_a];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Rs=Symbol("_vod"),ka=Symbol("_vsh"),Ea=Symbol(""),Ca=/(?:^|;)\s*display\s*:/;function Aa(e,t,n){const r=e.style,s=ge(n);let o=!1;if(n&&!s){if(t)if(ge(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&on(r,l,"")}else for(const i in t)n[i]==null&&on(r,i,"");for(const i in n){i==="display"&&(o=!0);const l=n[i];l!=null?Ra(e,i,!ge(t)&&t?t[i]:void 0,l)||on(r,i,l):on(r,i,"")}}else if(s){if(t!==n){const i=r[Ea];i&&(n+=";"+i),r.cssText=n,o=Ca.test(n)}}else t&&e.removeAttribute("style");Rs in e&&(e[Rs]=o?r.display:"",e[ka]&&(r.display="none"))}const Os=/\s*!important$/;function on(e,t,n){if($(n))n.forEach(r=>on(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Sa(e,t);Os.test(n)?e.setProperty(Ut(r),n.replace(Os,""),"important"):e[r]=n}}const Ts=["Webkit","Moz","ms"],hr={};function Sa(e,t){const n=hr[t];if(n)return n;let r=Pe(t);if(r!=="filter"&&r in e)return hr[t]=r;r=Wn(r);for(let s=0;smr||(Da.then(()=>mr=0),mr=Date.now());function Va(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;const s=n.value;if($(s)){const o=r.stopImmediatePropagation;r.stopImmediatePropagation=()=>{o.call(r),r._stopped=!0};const i=s.slice(),l=[r];for(let a=0;ae.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,ja=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?wa(e,r,i):t==="style"?Aa(e,n,r):Kn(t)?Gn(t)||Ta(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):La(e,t,r,i))?(Ns(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Ps(e,t,r,i,o,t!=="value")):e._isVueCE&&(Ua(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!ge(r)))?Ns(e,Pe(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Ps(e,t,r,i))};function La(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ms(t)&&B(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Ms(t)&&ge(n)?!1:t in e}function Ua(e,t){const n=e._def.props;if(!n)return!1;const r=Pe(t);return Array.isArray(n)?n.some(s=>Pe(s)===r):Object.keys(n).some(s=>Pe(s)===r)}const Jt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return $(t)?n=>Tn(t,n):t};function Fa(e){e.target.composing=!0}function Vs(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ot=Symbol("_assign"),Rn=Symbol("_initialValue");function yr(e,t,n){return t&&(e=e.trim()),n&&(e=zn(e)),e}const ve={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e.parentNode&&(e.type==="text"?e[Rn]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Rn]=e.defaultValue.replace(/\r\n?/g,` +`))),e[ot]=Jt(s);const o=r||s.props&&s.props.type==="number";Ot(e,t?"change":"input",i=>{i.target.composing||e[ot](yr(e.value,n,o))}),(n||o)&&Ot(e,"change",()=>{e.value=yr(e.value,n,o)}),t||(Ot(e,"compositionstart",Fa),Ot(e,"compositionend",Vs),Ot(e,"change",Vs))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){const s=t??"",o=e[Rn];delete e[Rn],o!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==o?e[ot](yr(e.value,n,r)):e.value=s},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[ot]=Jt(i),e.composing)return;const l=(o||e.type==="number")&&!/^0\d/.test(e.value)?zn(e.value):e.value,a=t??"";if(l===a)return;const p=e.getRootNode();(p instanceof Document||p instanceof ShadowRoot)&&p.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===a)||(e.value=a)}},Dn={deep:!0,created(e,t,n){e[ot]=Jt(n),Ot(e,"change",()=>{const r=e._modelValue,s=xn(e),o=e.checked,i=e[ot];if($(r)){const l=Hr(r,s),a=l!==-1;if(o&&!a)i(r.concat(s));else if(!o&&a){const p=[...r];p.splice(l,1),i(p)}}else if(Xt(r)){const l=new Set(r);o?l.add(s):l.delete(s),i(l)}else i(fi(e,o))})},mounted:js,beforeUpdate(e,t,n){e[ot]=Jt(n),js(e,t,n)}};function js(e,{value:t,oldValue:n},r){e._modelValue=t;let s;if($(t))s=Hr(t,r.props.value)>-1;else if(Xt(t))s=t.has(r.props.value);else{if(t===n)return;s=Zt(t,fi(e,!0))}e.checked!==s&&(e.checked=s)}const Nr={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Ot(e,"change",()=>{const s=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?zn(xn(o)):xn(o));e[ot](e.multiple?Xt(e._modelValue)?new Set(s):s:s[0]),e._assigning=!0,Qr(()=>{e._assigning=!1})}),e[ot]=Jt(r)},mounted(e,{value:t}){Ls(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[ot]=Jt(n)},updated(e,{value:t}){e._assigning||Ls(e,t)}};function Ls(e,t){const n=e.multiple,r=$(t);if(!(n&&!r&&!Xt(t))){for(let s=0,o=e.options.length;sString(p)===String(l)):i.selected=Hr(t,l)>-1}else i.selected=t.has(l);else if(Zt(xn(i),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function xn(e){return"_value"in e?e._value:e.value}function fi(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const $a=["ctrl","shift","alt","meta"],Ha={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>$a.some(n=>e[`${n}Key`]&&!t.includes(n))},St=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i{const t=Ka().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Wa(r);if(!s)return;const o=t._component;!B(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,qa(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function qa(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Wa(e){return ge(e)?document.querySelector(e):e}/*! + * vue-router v4.6.4 + * (c) 2025 Eduardo San Martin Morote + * @license MIT + */const Ht=typeof document<"u";function di(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function za(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&di(e.default)}const Z=Object.assign;function vr(e,t){const n={};for(const r in t){const s=t[r];n[r]=Je(s)?s.map(e):e(s)}return n}const pn=()=>{},Je=Array.isArray;function Fs(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const pi=/#/g,Ja=/&/g,Qa=/\//g,Ya=/=/g,Xa=/\?/g,gi=/\+/g,Za=/%5B/g,ec=/%5D/g,hi=/%5E/g,tc=/%60/g,mi=/%7B/g,nc=/%7C/g,yi=/%7D/g,rc=/%20/g;function rs(e){return e==null?"":encodeURI(""+e).replace(nc,"|").replace(Za,"[").replace(ec,"]")}function sc(e){return rs(e).replace(mi,"{").replace(yi,"}").replace(hi,"^")}function Dr(e){return rs(e).replace(gi,"%2B").replace(rc,"+").replace(pi,"%23").replace(Ja,"%26").replace(tc,"`").replace(mi,"{").replace(yi,"}").replace(hi,"^")}function oc(e){return Dr(e).replace(Ya,"%3D")}function ic(e){return rs(e).replace(pi,"%23").replace(Xa,"%3F")}function lc(e){return ic(e).replace(Qa,"%2F")}function _n(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const ac=/\/$/,cc=e=>e.replace(ac,"");function br(e,t,n="/"){let r,s={},o="",i="";const l=t.indexOf("#");let a=t.indexOf("?");return a=l>=0&&a>l?-1:a,a>=0&&(r=t.slice(0,a),o=t.slice(a,l>0?l:t.length),s=e(o.slice(1))),l>=0&&(r=r||t.slice(0,l),i=t.slice(l,t.length)),r=pc(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:_n(i)}}function uc(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function $s(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function fc(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&Qt(t.matched[r],n.matched[s])&&vi(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Qt(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function vi(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!dc(e[n],t[n]))return!1;return!0}function dc(e,t){return Je(e)?Hs(e,t):Je(t)?Hs(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Hs(e,t){return Je(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function pc(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let o=n.length-1,i,l;for(i=0;i1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(i).join("/")}const Ct={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Mr=(function(e){return e.pop="pop",e.push="push",e})({}),xr=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function gc(e){if(!e)if(Ht){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),cc(e)}const hc=/^[^#]+#/;function mc(e,t){return e.replace(hc,"#")+t}function yc(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const sr=()=>({left:window.scrollX,top:window.scrollY});function vc(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=yc(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Bs(e,t){return(history.state?history.state.position-t:-1)+e}const Vr=new Map;function bc(e,t){Vr.set(e,t)}function xc(e){const t=Vr.get(e);return Vr.delete(e),t}function _c(e){return typeof e=="string"||e&&typeof e=="object"}function bi(e){return typeof e=="string"||typeof e=="symbol"}let de=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const xi=Symbol("");de.MATCHER_NOT_FOUND+"",de.NAVIGATION_GUARD_REDIRECT+"",de.NAVIGATION_ABORTED+"",de.NAVIGATION_CANCELLED+"",de.NAVIGATION_DUPLICATED+"";function Yt(e,t){return Z(new Error,{type:e,[xi]:!0},t)}function ft(e,t){return e instanceof Error&&xi in e&&(t==null||!!(e.type&t))}const wc=["params","query","hash"];function kc(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of wc)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Ec(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;rs&&Dr(s)):[r&&Dr(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function Cc(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Je(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const Ac=Symbol(""),Gs=Symbol(""),or=Symbol(""),ss=Symbol(""),jr=Symbol("");function rn(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Rt(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((l,a)=>{const p=b=>{b===!1?a(Yt(de.NAVIGATION_ABORTED,{from:n,to:t})):b instanceof Error?a(b):_c(b)?a(Yt(de.NAVIGATION_GUARD_REDIRECT,{from:t,to:b})):(i&&r.enterCallbacks[s]===i&&typeof b=="function"&&i.push(b),l())},u=o(()=>e.call(r&&r.instances[s],t,n,p));let g=Promise.resolve(u);e.length<3&&(g=g.then(p)),g.catch(b=>a(b))})}function _r(e,t,n,r,s=o=>o()){const o=[];for(const i of e)for(const l in i.components){let a=i.components[l];if(!(t!=="beforeRouteEnter"&&!i.instances[l]))if(di(a)){const p=(a.__vccOpts||a)[t];p&&o.push(Rt(p,n,r,i,l,s))}else{let p=a();o.push(()=>p.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${l}" at "${i.path}"`);const g=za(u)?u.default:u;i.mods[l]=u,i.components[l]=g;const b=(g.__vccOpts||g)[t];return b&&Rt(b,n,r,i,l,s)()}))}}return o}function Sc(e,t){const n=[],r=[],s=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;iQt(p,l))?r.push(l):n.push(l));const a=e.matched[i];a&&(t.matched.find(p=>Qt(p,a))||s.push(a))}return[n,r,s]}/*! + * vue-router v4.6.4 + * (c) 2025 Eduardo San Martin Morote + * @license MIT + */let Rc=()=>location.protocol+"//"+location.host;function _i(e,t){const{pathname:n,search:r,hash:s}=t,o=e.indexOf("#");if(o>-1){let i=s.includes(e.slice(o))?e.slice(o).length:1,l=s.slice(i);return l[0]!=="/"&&(l="/"+l),$s(l,"")}return $s(n,e)+r+s}function Oc(e,t,n,r){let s=[],o=[],i=null;const l=({state:b})=>{const x=_i(e,location),N=n.value,R=t.value;let U=0;if(b){if(n.value=x,t.value=b,i&&i===N){i=null;return}U=R?b.position-R.position:0}else r(x);s.forEach(T=>{T(n.value,N,{delta:U,type:Mr.pop,direction:U?U>0?xr.forward:xr.back:xr.unknown})})};function a(){i=n.value}function p(b){s.push(b);const x=()=>{const N=s.indexOf(b);N>-1&&s.splice(N,1)};return o.push(x),x}function u(){if(document.visibilityState==="hidden"){const{history:b}=window;if(!b.state)return;b.replaceState(Z({},b.state,{scroll:sr()}),"")}}function g(){for(const b of o)b();o=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:a,listen:p,destroy:g}}function qs(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?sr():null}}function Tc(e){const{history:t,location:n}=window,r={value:_i(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(a,p,u){const g=e.indexOf("#"),b=g>-1?(n.host&&document.querySelector("base")?e:e.slice(g))+a:Rc()+e+a;try{t[u?"replaceState":"pushState"](p,"",b),s.value=p}catch(x){console.error(x),n[u?"replace":"assign"](b)}}function i(a,p){o(a,Z({},t.state,qs(s.value.back,a,s.value.forward,!0),p,{position:s.value.position}),!0),r.value=a}function l(a,p){const u=Z({},s.value,t.state,{forward:a,scroll:sr()});o(u.current,u,!0),o(a,Z({},qs(r.value,a,null),{position:u.position+1},p),!1),r.value=a}return{location:r,state:s,push:l,replace:i}}function Ic(e){e=gc(e);const t=Tc(e),n=Oc(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=Z({location:"",base:e,go:r,createHref:mc.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}let Mt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var ye=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(ye||{});const Pc={type:Mt.Static,value:""},Nc=/[a-zA-Z0-9_]/;function Dc(e){if(!e)return[[]];if(e==="/")return[[Pc]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(x){throw new Error(`ERR (${n})/"${p}": ${x}`)}let n=ye.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let l=0,a,p="",u="";function g(){p&&(n===ye.Static?o.push({type:Mt.Static,value:p}):n===ye.Param||n===ye.ParamRegExp||n===ye.ParamRegExpEnd?(o.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${p}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Mt.Param,value:p,regexp:u,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),p="")}function b(){p+=a}for(;lt.length?t.length===1&&t[0]===Te.Static+Te.Segment?1:-1:0}function wi(e,t){let n=0;const r=e.score,s=t.score;for(;n0&&t[t.length-1]<0}const Uc={strict:!1,end:!0,sensitive:!1};function Fc(e,t,n){const r=jc(Dc(e.path),n),s=Z(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function $c(e,t){const n=[],r=new Map;t=Fs(Uc,t);function s(g){return r.get(g)}function o(g,b,x){const N=!x,R=Qs(g);R.aliasOf=x&&x.record;const U=Fs(t,g),T=[R];if("alias"in g){const S=typeof g.alias=="string"?[g.alias]:g.alias;for(const W of S)T.push(Qs(Z({},R,{components:x?x.record.components:R.components,path:W,aliasOf:x?x.record:R})))}let k,D;for(const S of T){const{path:W}=S;if(b&&W[0]!=="/"){const le=b.record.path,X=le[le.length-1]==="/"?"":"/";S.path=b.record.path+(W&&X+W)}if(k=Fc(S,b,U),x?x.alias.push(k):(D=D||k,D!==k&&D.alias.push(k),N&&g.name&&!Ys(k)&&i(g.name)),ki(k)&&a(k),R.children){const le=R.children;for(let X=0;X{i(D)}:pn}function i(g){if(bi(g)){const b=r.get(g);b&&(r.delete(g),n.splice(n.indexOf(b),1),b.children.forEach(i),b.alias.forEach(i))}else{const b=n.indexOf(g);b>-1&&(n.splice(b,1),g.record.name&&r.delete(g.record.name),g.children.forEach(i),g.alias.forEach(i))}}function l(){return n}function a(g){const b=Kc(g,n);n.splice(b,0,g),g.record.name&&!Ys(g)&&r.set(g.record.name,g)}function p(g,b){let x,N={},R,U;if("name"in g&&g.name){if(x=r.get(g.name),!x)throw Yt(de.MATCHER_NOT_FOUND,{location:g});U=x.record.name,N=Z(Js(b.params,x.keys.filter(D=>!D.optional).concat(x.parent?x.parent.keys.filter(D=>D.optional):[]).map(D=>D.name)),g.params&&Js(g.params,x.keys.map(D=>D.name))),R=x.stringify(N)}else if(g.path!=null)R=g.path,x=n.find(D=>D.re.test(R)),x&&(N=x.parse(R),U=x.record.name);else{if(x=b.name?r.get(b.name):n.find(D=>D.re.test(b.path)),!x)throw Yt(de.MATCHER_NOT_FOUND,{location:g,currentLocation:b});U=x.record.name,N=Z({},b.params,g.params),R=x.stringify(N)}const T=[];let k=x;for(;k;)T.unshift(k.record),k=k.parent;return{name:U,path:R,params:N,matched:T,meta:Bc(T)}}e.forEach(g=>o(g));function u(){n.length=0,r.clear()}return{addRoute:o,resolve:p,removeRoute:i,clearRoutes:u,getRoutes:l,getRecordMatcher:s}}function Js(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Qs(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Hc(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Hc(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Ys(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Bc(e){return e.reduce((t,n)=>Z(t,n.meta),{})}function Kc(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;wi(e,t[o])<0?r=o:n=o+1}const s=Gc(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Gc(e){let t=e;for(;t=t.parent;)if(ki(t)&&wi(e,t)===0)return t}function ki({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Xs(e){const t=qe(or),n=qe(ss),r=je(()=>{const a=Tt(e.to);return t.resolve(a)}),s=je(()=>{const{matched:a}=r.value,{length:p}=a,u=a[p-1],g=n.matched;if(!u||!g.length)return-1;const b=g.findIndex(Qt.bind(null,u));if(b>-1)return b;const x=Zs(a[p-2]);return p>1&&Zs(u)===x&&g[g.length-1].path!==x?g.findIndex(Qt.bind(null,a[p-2])):b}),o=je(()=>s.value>-1&&Qc(n.params,r.value.params)),i=je(()=>s.value>-1&&s.value===n.matched.length-1&&vi(n.params,r.value.params));function l(a={}){if(Jc(a)){const p=t[Tt(e.replace)?"replace":"push"](Tt(e.to)).catch(pn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>p),p}return Promise.resolve()}return{route:r,href:je(()=>r.value.href),isActive:o,isExactActive:i,navigate:l}}function qc(e){return e.length===1?e[0]:e}const Wc=Vo({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Xs,setup(e,{slots:t}){const n=Yn(Xs(e)),{options:r}=qe(or),s=je(()=>({[eo(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[eo(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&qc(t.default(n));return e.custom?o:ci("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),zc=Wc;function Jc(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Qc(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!Je(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Zs(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const eo=(e,t,n)=>e??t??n,Yc=Vo({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=qe(jr),s=je(()=>e.route||r.value),o=qe(Gs,0),i=je(()=>{let p=Tt(o);const{matched:u}=s.value;let g;for(;(g=u[p])&&!g.components;)p++;return p}),l=je(()=>s.value.matched[i.value]);In(Gs,je(()=>i.value+1)),In(Ac,l),In(jr,s);const a=ne();return Pn(()=>[a.value,l.value,e.name],([p,u,g],[b,x,N])=>{u&&(u.instances[g]=p,x&&x!==u&&p&&p===b&&(u.leaveGuards.size||(u.leaveGuards=x.leaveGuards),u.updateGuards.size||(u.updateGuards=x.updateGuards))),p&&u&&(!x||!Qt(u,x)||!b)&&(u.enterCallbacks[g]||[]).forEach(R=>R(p))},{flush:"post"}),()=>{const p=s.value,u=e.name,g=l.value,b=g&&g.components[u];if(!b)return to(n.default,{Component:b,route:p});const x=g.props[u],N=x?x===!0?p.params:typeof x=="function"?x(p):x:null,U=ci(b,Z({},N,t,{onVnodeUnmounted:T=>{T.component.isUnmounted&&(g.instances[u]=null)},ref:a}));return to(n.default,{Component:U,route:p})||U}}});function to(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Xc=Yc;function Zc(e){const t=$c(e.routes,e),n=e.parseQuery||Ec,r=e.stringifyQuery||Ks,s=e.history,o=rn(),i=rn(),l=rn(),a=nl(Ct);let p=Ct;Ht&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=vr.bind(null,w=>""+w),g=vr.bind(null,lc),b=vr.bind(null,_n);function x(w,P){let O,j;return bi(w)?(O=t.getRecordMatcher(w),j=P):j=w,t.addRoute(j,O)}function N(w){const P=t.getRecordMatcher(w);P&&t.removeRoute(P)}function R(){return t.getRoutes().map(w=>w.record)}function U(w){return!!t.getRecordMatcher(w)}function T(w,P){if(P=Z({},P||a.value),typeof w=="string"){const m=br(n,w,P.path),_=t.resolve({path:m.path},P),y=s.createHref(m.fullPath);return Z(m,_,{params:b(_.params),hash:_n(m.hash),redirectedFrom:void 0,href:y})}let O;if(w.path!=null)O=Z({},w,{path:br(n,w.path,P.path).path});else{const m=Z({},w.params);for(const _ in m)m[_]==null&&delete m[_];O=Z({},w,{params:g(m)}),P.params=g(P.params)}const j=t.resolve(O,P),G=w.hash||"";j.params=u(b(j.params));const c=uc(r,Z({},w,{hash:sc(G),path:j.path})),f=s.createHref(c);return Z({fullPath:c,hash:G,query:r===Ks?Cc(w.query):w.query||{}},j,{redirectedFrom:void 0,href:f})}function k(w){return typeof w=="string"?br(n,w,a.value.path):Z({},w)}function D(w,P){if(p!==w)return Yt(de.NAVIGATION_CANCELLED,{from:P,to:w})}function S(w){return X(w)}function W(w){return S(Z(k(w),{replace:!0}))}function le(w,P){const O=w.matched[w.matched.length-1];if(O&&O.redirect){const{redirect:j}=O;let G=typeof j=="function"?j(w,P):j;return typeof G=="string"&&(G=G.includes("?")||G.includes("#")?G=k(G):{path:G},G.params={}),Z({query:w.query,hash:w.hash,params:G.path!=null?{}:w.params},G)}}function X(w,P){const O=p=T(w),j=a.value,G=w.state,c=w.force,f=w.replace===!0,m=le(O,j);if(m)return X(Z(k(m),{state:typeof m=="object"?Z({},G,m.state):G,force:c,replace:f}),P||O);const _=O;_.redirectedFrom=P;let y;return!c&&fc(r,j,O)&&(y=Yt(de.NAVIGATION_DUPLICATED,{to:_,from:j}),Re(j,j,!0,!1)),(y?Promise.resolve(y):Ne(_,j)).catch(d=>ft(d)?ft(d,de.NAVIGATION_GUARD_REDIRECT)?d:Be(d):q(d,_,j)).then(d=>{if(d){if(ft(d,de.NAVIGATION_GUARD_REDIRECT))return X(Z({replace:f},k(d.to),{state:typeof d.to=="object"?Z({},G,d.to.state):G,force:c}),P||_)}else d=at(_,j,!0,f,G);return Qe(_,j,d),d})}function K(w,P){const O=D(w,P);return O?Promise.reject(O):Promise.resolve()}function He(w){const P=Et.values().next().value;return P&&typeof P.runWithContext=="function"?P.runWithContext(w):w()}function Ne(w,P){let O;const[j,G,c]=Sc(w,P);O=_r(j.reverse(),"beforeRouteLeave",w,P);for(const m of j)m.leaveGuards.forEach(_=>{O.push(Rt(_,w,P))});const f=K.bind(null,w,P);return O.push(f),Ee(O).then(()=>{O=[];for(const m of o.list())O.push(Rt(m,w,P));return O.push(f),Ee(O)}).then(()=>{O=_r(G,"beforeRouteUpdate",w,P);for(const m of G)m.updateGuards.forEach(_=>{O.push(Rt(_,w,P))});return O.push(f),Ee(O)}).then(()=>{O=[];for(const m of c)if(m.beforeEnter)if(Je(m.beforeEnter))for(const _ of m.beforeEnter)O.push(Rt(_,w,P));else O.push(Rt(m.beforeEnter,w,P));return O.push(f),Ee(O)}).then(()=>(w.matched.forEach(m=>m.enterCallbacks={}),O=_r(c,"beforeRouteEnter",w,P,He),O.push(f),Ee(O))).then(()=>{O=[];for(const m of i.list())O.push(Rt(m,w,P));return O.push(f),Ee(O)}).catch(m=>ft(m,de.NAVIGATION_CANCELLED)?m:Promise.reject(m))}function Qe(w,P,O){l.list().forEach(j=>He(()=>j(w,P,O)))}function at(w,P,O,j,G){const c=D(w,P);if(c)return c;const f=P===Ct,m=Ht?history.state:{};O&&(j||f?s.replace(w.fullPath,Z({scroll:f&&m&&m.scroll},G)):s.push(w.fullPath,G)),a.value=w,Re(w,P,O,f),Be()}let Fe;function It(){Fe||(Fe=s.listen((w,P,O)=>{if(!ct.listening)return;const j=T(w),G=le(j,ct.currentRoute.value);if(G){X(Z(G,{replace:!0,force:!0}),j).catch(pn);return}p=j;const c=a.value;Ht&&bc(Bs(c.fullPath,O.delta),sr()),Ne(j,c).catch(f=>ft(f,de.NAVIGATION_ABORTED|de.NAVIGATION_CANCELLED)?f:ft(f,de.NAVIGATION_GUARD_REDIRECT)?(X(Z(k(f.to),{force:!0}),j).then(m=>{ft(m,de.NAVIGATION_ABORTED|de.NAVIGATION_DUPLICATED)&&!O.delta&&O.type===Mr.pop&&s.go(-1,!1)}).catch(pn),Promise.reject()):(O.delta&&s.go(-O.delta,!1),q(f,j,c))).then(f=>{f=f||at(j,c,!1),f&&(O.delta&&!ft(f,de.NAVIGATION_CANCELLED)?s.go(-O.delta,!1):O.type===Mr.pop&&ft(f,de.NAVIGATION_ABORTED|de.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),Qe(j,c,f)}).catch(pn)}))}let wt=rn(),he=rn(),Q;function q(w,P,O){Be(w);const j=he.list();return j.length?j.forEach(G=>G(w,P,O)):console.error(w),Promise.reject(w)}function Y(){return Q&&a.value!==Ct?Promise.resolve():new Promise((w,P)=>{wt.add([w,P])})}function Be(w){return Q||(Q=!w,It(),wt.list().forEach(([P,O])=>w?O(w):P()),wt.reset()),w}function Re(w,P,O,j){const{scrollBehavior:G}=e;if(!Ht||!G)return Promise.resolve();const c=!O&&xc(Bs(w.fullPath,0))||(j||!O)&&history.state&&history.state.scroll||null;return Qr().then(()=>G(w,P,c)).then(f=>f&&vc(f)).catch(f=>q(f,w,P))}const ke=w=>s.go(w);let kt;const Et=new Set,ct={currentRoute:a,listening:!0,addRoute:x,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:U,getRoutes:R,resolve:T,options:e,push:S,replace:W,go:ke,back:()=>ke(-1),forward:()=>ke(1),beforeEach:o.add,beforeResolve:i.add,afterEach:l.add,onError:he.add,isReady:Y,install(w){w.component("RouterLink",zc),w.component("RouterView",Xc),w.config.globalProperties.$router=ct,Object.defineProperty(w.config.globalProperties,"$route",{enumerable:!0,get:()=>Tt(a)}),Ht&&!kt&&a.value===Ct&&(kt=!0,S(s.location).catch(j=>{}));const P={};for(const j in Ct)Object.defineProperty(P,j,{get:()=>a.value[j],enumerable:!0});w.provide(or,ct),w.provide(ss,Co(P)),w.provide(jr,a);const O=w.unmount;Et.add(w),w.unmount=function(){Et.delete(w),Et.size<1&&(p=Ct,Fe&&Fe(),Fe=null,a.value=Ct,kt=!1,Q=!1),O()}}};function Ee(w){return w.reduce((P,O)=>P.then(()=>He(O)),Promise.resolve())}return ct}function eu(){return qe(or)}function Ei(e){return qe(ss)}async function On(e,t={}){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t.headers}}),r=n.headers.get("content-type")||"";if(n.redirected||!r.includes("application/json"))throw window.location.href="/login",new Error("Sesión expirada");const s=await n.json();if(!n.ok)throw new Error((s==null?void 0:s.error)||(s==null?void 0:s.message)||"Error de servidor");return s}const fe={get:e=>On(e),post:(e,t)=>On(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>On(e,{method:"PUT",body:JSON.stringify(t)}),del:e=>On(e,{method:"DELETE"})},tu={class:"w-64 shrink-0 h-screen sticky top-0 flex flex-col border-r border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900"},nu={class:"px-4 py-4 border-b border-gray-200 dark:border-gray-800"},ru={key:0,class:"px-3 pt-2 text-xs text-red-600 dark:text-red-400"},su={class:"flex-1 overflow-y-auto px-2 py-3 space-y-0.5"},ou={key:0,class:"px-2 text-xs text-gray-400"},iu={key:1,class:"px-2 text-xs text-gray-400"},lu={class:"truncate"},au={class:"flex items-center gap-1 mt-0.5"},cu={class:"text-[11px] text-gray-400 dark:text-gray-500"},uu={class:"flex opacity-0 group-hover:opacity-100 transition-opacity pr-1.5 gap-0.5"},fu=["onClick"],du=["onClick"],pu={class:"bg-white dark:bg-gray-900 rounded-xl p-6 w-full max-w-lg border border-gray-200 dark:border-gray-800"},gu={class:"font-semibold text-gray-800 dark:text-gray-100 mb-4"},hu=["value"],mu={class:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300"},yu={class:"flex justify-end gap-2 pt-2"},vu={__name:"Sidebar",setup(e,{expose:t}){const n=Ei(),r=eu(),s=ne([]),o=ne([]),i=ne(!0),l=ne(""),a=ne(!1),p=ne(null),u=ne(g());function g(){return{nombre:"",dominios_permitidos:"",ai_config_id:null,tono:"",mensaje_bienvenida:"",activo:!0}}async function b(){i.value=!0,l.value="";try{const[T,k]=await Promise.all([fe.get("/app/umind/tenants"),fe.get("/app/api/ai-config/select")]);s.value=T.items||[],o.value=k.registros||[]}catch(T){l.value=T.message}finally{i.value=!1}}function x(){p.value=null,u.value=g(),a.value=!0}function N(T){p.value=T,u.value={nombre:T.nombre,dominios_permitidos:T.dominios_permitidos,ai_config_id:T.ai_config_id,tono:T.tono,mensaje_bienvenida:T.mensaje_bienvenida,activo:T.activo},a.value=!0}async function R(){const T={...u.value,dominios_permitidos:u.value.dominios_permitidos.split(",").map(k=>k.trim()).filter(Boolean)};try{if(p.value)await fe.put(`/app/umind/tenants/${p.value.ID}`,T),a.value=!1,await b();else{const k=await fe.post("/app/umind/tenants",T);a.value=!1,await b(),r.push(`/tenants/${k.id}`)}}catch(k){l.value=k.message}}async function U(T){confirm(`¿Eliminar el tenant "${T.nombre}"? Esto no se puede deshacer.`)&&(await fe.del(`/app/umind/tenants/${T.ID}`),n.params.id===String(T.ID)&&r.push("/"),await b())}return t({recargar:b}),es(b),(T,k)=>{const D=Fo("router-link");return M(),V(pe,null,[v("aside",tu,[v("div",nu,[_e(D,{to:"/",class:"text-base font-semibold text-gray-800 dark:text-gray-100"},{default:Sr(()=>[...k[8]||(k[8]=[pt(" uMind ",-1),v("span",{class:"text-brand"},"Orquestador",-1)])]),_:1})]),v("div",{class:"px-3 pt-3"},[v("button",{class:"w-full bg-brand hover:bg-brand-dark text-white text-sm font-medium px-3 py-2 rounded-lg transition-colors",onClick:x}," + Nuevo tenant ")]),l.value?(M(),V("p",ru,J(l.value),1)):ue("",!0),v("nav",su,[i.value?(M(),V("p",ou,"Cargando...")):s.value.length===0?(M(),V("p",iu,"Sin tenants todavía.")):ue("",!0),(M(!0),V(pe,null,Ke(s.value,S=>(M(),V("div",{key:S.ID,class:Ve(["group flex items-center rounded-lg transition-colors",Tt(n).params.id===String(S.ID)?"bg-brand/10 dark:bg-brand/20":"hover:bg-gray-100 dark:hover:bg-gray-800"])},[_e(D,{to:`/tenants/${S.ID}`,class:Ve(["flex-1 min-w-0 px-2.5 py-2 text-sm",Tt(n).params.id===String(S.ID)?"text-brand-dark dark:text-brand font-medium":"text-gray-700 dark:text-gray-300"])},{default:Sr(()=>[v("div",lu,J(S.nombre),1),v("div",au,[v("span",{class:Ve(["w-1.5 h-1.5 rounded-full",S.activo?"bg-green-500":"bg-gray-300 dark:bg-gray-600"])},null,2),v("span",cu,J(S.activo?"activo":"inactivo"),1)])]),_:2},1032,["to","class"]),v("div",uu,[v("button",{class:"p-1 text-gray-400 hover:text-gray-700 dark:hover:text-gray-200",title:"Editar",onClick:W=>N(S)}," ✎ ",8,fu),v("button",{class:"p-1 text-gray-400 hover:text-red-600",title:"Eliminar",onClick:W=>U(S)}," ✕ ",8,du)])],2))),128))])]),a.value?(M(),V("div",{key:0,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:k[7]||(k[7]=St(S=>a.value=!1,["self"]))},[v("div",pu,[v("h2",gu,J(p.value?"Editar tenant":"Nuevo tenant"),1),v("form",{class:"space-y-3",onSubmit:St(R,["prevent"])},[v("div",null,[k[9]||(k[9]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"Nombre",-1)),ae(v("input",{"onUpdate:modelValue":k[0]||(k[0]=S=>u.value.nombre=S),required:"",class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512),[[ve,u.value.nombre]])]),v("div",null,[k[10]||(k[10]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"Dominios permitidos (separados por coma)",-1)),ae(v("input",{"onUpdate:modelValue":k[1]||(k[1]=S=>u.value.dominios_permitidos=S),placeholder:"ejemplo.com, www.ejemplo.com",required:"",class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512),[[ve,u.value.dominios_permitidos]])]),v("div",null,[k[12]||(k[12]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"Config de IA",-1)),ae(v("select",{"onUpdate:modelValue":k[2]||(k[2]=S=>u.value.ai_config_id=S),class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},[k[11]||(k[11]=v("option",{value:null},"— sin asignar —",-1)),(M(!0),V(pe,null,Ke(o.value,S=>(M(),V("option",{key:S.ID,value:S.ID},J(S.nombre)+" ("+J(S.provider)+") ",9,hu))),128))],512),[[Nr,u.value.ai_config_id]])]),v("div",null,[k[13]||(k[13]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"Tono / personalidad",-1)),ae(v("textarea",{"onUpdate:modelValue":k[3]||(k[3]=S=>u.value.tono=S),rows:"2",class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512),[[ve,u.value.tono]])]),v("div",null,[k[14]||(k[14]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"Mensaje de bienvenida",-1)),ae(v("input",{"onUpdate:modelValue":k[4]||(k[4]=S=>u.value.mensaje_bienvenida=S),class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512),[[ve,u.value.mensaje_bienvenida]])]),v("label",mu,[ae(v("input",{"onUpdate:modelValue":k[5]||(k[5]=S=>u.value.activo=S),type:"checkbox"},null,512),[[Dn,u.value.activo]]),k[15]||(k[15]=pt(" Activo ",-1))]),v("div",yu,[v("button",{type:"button",class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400",onClick:k[6]||(k[6]=S=>a.value=!1)}," Cancelar "),k[16]||(k[16]=v("button",{type:"submit",class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg"}," Guardar ",-1))])],32)])])):ue("",!0)],64)}}},bu={class:"min-h-screen flex bg-gray-50 dark:bg-gray-950"},xu={class:"flex-1 min-w-0"},_u={class:"max-w-4xl mx-auto px-8 py-10"},wu={__name:"App",setup(e){return(t,n)=>{const r=Fo("router-view");return M(),V("div",bu,[_e(vu),v("main",xu,[v("div",_u,[_e(r)])])])}}},ku=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Eu={},Cu={class:"flex flex-col items-center justify-center text-center py-24"};function Au(e,t){return M(),V("div",Cu,[...t[0]||(t[0]=[v("div",{class:"text-4xl mb-4"},"💬",-1),v("h1",{class:"text-lg font-medium text-gray-700 dark:text-gray-200"},"Elegí un tenant de la izquierda",-1),v("p",{class:"text-sm text-gray-400 dark:text-gray-500 mt-1"},"o creá uno nuevo para empezar a configurar su agente.",-1)])])}const Su=ku(Eu,[["render",Au]]),Ru={key:0,class:"mb-6"},Ou={class:"text-xl font-semibold text-gray-800 dark:text-gray-100"},Tu={class:"text-xs text-gray-500 dark:text-gray-500 mt-1"},Iu={class:"bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded"},Pu={key:1,class:"text-sm text-red-600 dark:text-red-400 mb-4"},Nu={class:"flex gap-1.5 mb-6 overflow-x-auto pb-1"},Du=["onClick"],Mu={key:2},Vu=["disabled"],ju={class:"bg-white dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800 divide-y divide-gray-100 dark:divide-gray-800"},Lu={key:0,class:"p-6 text-sm text-gray-500 dark:text-gray-400"},Uu={class:"text-sm text-gray-800 dark:text-gray-200"},Fu={class:"text-xs text-gray-500 dark:text-gray-500 mt-0.5"},$u={key:0},Hu={key:1,class:"text-red-600 dark:text-red-400"},Bu=["onClick"],Ku={key:3},Gu={class:"bg-white dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800 divide-y divide-gray-100 dark:divide-gray-800"},qu={key:0,class:"p-6 text-sm text-gray-500 dark:text-gray-400"},Wu={class:"text-sm text-gray-800 dark:text-gray-200 font-mono"},zu={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},Ju={class:"text-xs text-gray-400 dark:text-gray-500 mt-0.5"},Qu={key:0,class:"ml-1 text-green-600 dark:text-green-400"},Yu={key:1,class:"ml-1 text-gray-400"},Xu={class:"flex gap-3 text-sm shrink-0"},Zu=["onClick"],ef=["onClick"],tf={class:"bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-xl p-6 w-full max-w-xl max-h-[85vh] overflow-y-auto"},nf={class:"font-semibold text-gray-800 dark:text-gray-100 mb-4"},rf={class:"border border-gray-200 dark:border-gray-800 rounded-lg p-3 space-y-2"},sf=["onUpdate:modelValue"],of=["onUpdate:modelValue"],lf=["onUpdate:modelValue"],af={class:"text-xs text-gray-500 dark:text-gray-400 flex items-center gap-1"},cf=["onUpdate:modelValue"],uf=["onClick"],ff={key:0,class:"text-xs text-gray-400"},df={class:"border border-gray-200 dark:border-gray-800 rounded-lg p-3 space-y-2"},pf={class:"flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400"},gf={class:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300"},hf={class:"flex justify-end gap-2 pt-2"},mf={key:4},yf={class:"bg-white dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800 divide-y divide-gray-100 dark:divide-gray-800"},vf={key:0,class:"p-6 text-sm text-gray-500 dark:text-gray-400"},bf={class:"flex items-center justify-between"},xf={class:"font-medium text-gray-800 dark:text-gray-200 capitalize"},_f={class:"flex gap-3 text-sm"},wf=["onClick"],kf=["onClick"],Ef={class:"text-xs text-gray-500 dark:text-gray-400 mt-1 break-all"},Cf={class:"bg-gray-100 dark:bg-gray-800 px-1 rounded"},Af={key:0,class:"text-xs text-gray-400 dark:text-gray-500 mt-1"},Sf={key:1,class:"text-xs text-red-600 dark:text-red-400 mt-1"},Rf={class:"bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-xl p-6 w-full max-w-md"},Of={key:0},Tf={class:"flex justify-end gap-2 pt-2"},If={key:5},Pf={class:"flex gap-2 mb-4"},Nf={class:"bg-white dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800 divide-y divide-gray-100 dark:divide-gray-800"},Df={key:0,class:"p-6 text-sm text-gray-500 dark:text-gray-400"},Mf={class:"font-medium text-gray-800 dark:text-gray-200 capitalize"},Vf={class:"ml-2 text-sm text-gray-500 dark:text-gray-400"},jf=["onClick"],Lf={key:6,class:"bg-white dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800 p-4 flex flex-col h-[28rem]"},Uf={class:"flex-1 overflow-y-auto space-y-2 mb-3"},Ff={key:0,class:"text-sm text-gray-500 dark:text-gray-400"},$f={key:1,class:"text-xs text-gray-400 dark:text-gray-500"},Hf=["disabled"],Bf={key:7,class:"grid grid-cols-3 gap-4"},Kf={class:"col-span-1 bg-white dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800 divide-y divide-gray-100 dark:divide-gray-800 max-h-[28rem] overflow-y-auto"},Gf={key:0,class:"p-4 text-sm text-gray-500 dark:text-gray-400"},qf=["onClick"],Wf={class:"text-gray-800 dark:text-gray-200 truncate"},zf={class:"text-xs text-gray-400 dark:text-gray-500 mt-0.5"},Jf={class:"col-span-2 bg-white dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800 p-4 max-h-[28rem] overflow-y-auto space-y-2"},Qf={key:0,class:"text-sm text-gray-500 dark:text-gray-400"},Yf={__name:"TenantDetail",props:{id:{type:String,required:!0}},setup(e){const t=e,n=je(()=>Number(t.id)),r=Ei(),s=ne(null),o=ne(""),i=ne(typeof r.query.tab=="string"?r.query.tab:"conocimiento"),l=ne([]),a=ne(""),p=ne(30),u=ne(!1);async function g(){const y=await fe.get("/app/umind/tenants");s.value=(y.items||[]).find(d=>String(d.ID)===t.id)||null}async function b(){const y=await fe.get(`/app/umind/documentos?tenant_id=${t.id}`);l.value=y.items||[]}async function x(){if(a.value.trim()){u.value=!0,o.value="";try{await fe.post("/app/umind/documentos",{tenant_id:n.value,url:a.value.trim(),max_paginas:Number(p.value)||30}),a.value="",await b()}catch(y){o.value=y.message}finally{u.value=!1}}}async function N(y){confirm("¿Eliminar esta fuente y sus fragmentos indexados?")&&(await fe.del(`/app/umind/documentos/${y}`),await b())}const R=je(()=>y=>({listo:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-400",procesando:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-400",pendiente:"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400",error:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400"})[y]||"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400"),U=ne([]),T=ne([]),k=ne(null);async function D(){const y=await fe.get(`/app/umind/sesiones?tenant_id=${t.id}`);U.value=y.items||[]}async function S(y){k.value=y;const d=await fe.get(`/app/umind/historial?tenant_id=${t.id}&session_id=${y}`);T.value=d.items||[]}const W=ne([]),le=ne(!1),X=ne(null),K=ne(He());function He(){return{nombre:"",descripcion:"",url:"",auth_header_nombre:"",auth_header_valor:"",tocarAuth:!1,parametros:[],activa:!0}}async function Ne(){const y=await fe.get(`/app/umind/tools?tenant_id=${t.id}`);W.value=y.items||[]}function Qe(){X.value=null,K.value=He(),le.value=!0}function at(y){X.value=y;let d=[];try{d=JSON.parse(y.parametros_json||"[]")||[]}catch{d=[]}K.value={nombre:y.nombre,descripcion:y.descripcion,url:y.url,auth_header_nombre:y.auth_header_nombre,auth_header_valor:"",tocarAuth:!1,parametros:d,activa:y.activa},le.value=!0}function Fe(){K.value.parametros.push({nombre:"",tipo:"string",descripcion:"",requerido:!1})}function It(y){K.value.parametros.splice(y,1)}async function wt(){const y={tenant_id:n.value,nombre:K.value.nombre.trim(),descripcion:K.value.descripcion,url:K.value.url.trim(),auth_header_nombre:K.value.auth_header_nombre,parametros:K.value.parametros,activa:K.value.activa};K.value.tocarAuth&&(y.auth_header_valor=K.value.auth_header_valor);try{X.value?await fe.put(`/app/umind/tools/${X.value.ID}`,y):await fe.post("/app/umind/tools",y),le.value=!1,await Ne()}catch(d){o.value=d.message}}async function he(y){confirm(`¿Eliminar la tool "${y.nombre}"?`)&&(await fe.del(`/app/umind/tools/${y.ID}`),await Ne())}const Q=ne([]),q=ne(!1),Y=ne(Be());function Be(){return{tipo:"telegram",bot_token:"",phone_number_id:"",access_token:"",app_secret:"",verify_token:""}}async function Re(){const y=await fe.get(`/app/umind/canales?tenant_id=${t.id}`);Q.value=y.items||[]}function ke(){Y.value=Be(),q.value=!0}async function kt(){const y=Y.value.tipo==="telegram"?{bot_token:Y.value.bot_token}:{phone_number_id:Y.value.phone_number_id,access_token:Y.value.access_token,app_secret:Y.value.app_secret,verify_token:Y.value.verify_token};try{await fe.post("/app/umind/canales",{tenant_id:n.value,tipo:Y.value.tipo,credenciales:y,activo:!0}),q.value=!1,await Re()}catch(d){o.value=d.message}}async function Et(y){await fe.put(`/app/umind/canales/${y.ID}`,{activo:!y.activo,credenciales:{}}),await Re()}async function ct(y){confirm(`¿Eliminar el canal ${y.tipo}?`)&&(await fe.del(`/app/umind/canales/${y.ID}`),await Re())}const Ee=ne([]);async function w(){const y=await fe.get(`/app/umind/conexiones?tenant_id=${t.id}`);Ee.value=y.items||[]}function P(y){window.location.href=`/app/umind/conexiones/conectar?tenant_id=${n.value}&proveedor=${y}`}async function O(y){confirm(`¿Desconectar la cuenta ${y.email||y.proveedor}?`)&&(await fe.del(`/app/umind/conexiones/${y.ID}`),await w())}const j=`staff-preview-${Math.random().toString(36).slice(2)}`,G=ne([]),c=ne(""),f=ne(!1);async function m(){const y=c.value.trim();if(!(!y||f.value)){c.value="",G.value.push({role:"user",content:y}),f.value=!0;try{const d=await fe.post("/app/umind/chat",{tenant_id:n.value,session_id:j,mensaje:y});G.value.push({role:"assistant",content:d.respuesta})}catch(d){G.value.push({role:"assistant",content:`⚠️ ${d.message}`})}finally{f.value=!1}}}const _=[["conocimiento","Base de conocimiento"],["herramientas","Herramientas"],["canales","Canales"],["conexiones","Conexiones"],["chat","Chat de prueba"],["conversaciones","Conversaciones"]];return es(async()=>{try{await Promise.all([g(),b(),D(),Ne(),Re(),w()])}catch(y){o.value=y.message}}),(y,d)=>(M(),V("div",null,[s.value?(M(),V("div",Ru,[v("h1",Ou,J(s.value.nombre),1),v("p",Tu,[d[22]||(d[22]=pt(" site_key: ",-1)),v("code",Iu,J(s.value.site_key),1)])])):ue("",!0),o.value?(M(),V("p",Pu,J(o.value),1)):ue("",!0),v("div",Nu,[(M(),V(pe,null,Ke(_,([h,C])=>v("button",{key:h,class:Ve(["px-3 py-1.5 rounded-full text-sm whitespace-nowrap transition-colors",i.value===h?"bg-brand text-white font-medium":"bg-white dark:bg-gray-900 text-gray-600 dark:text-gray-400 border border-gray-200 dark:border-gray-800 hover:border-brand/50"]),onClick:A=>i.value=h},J(C),11,Du)),64))]),i.value==="conocimiento"?(M(),V("div",Mu,[v("form",{class:"flex gap-2 mb-4",onSubmit:St(x,["prevent"])},[ae(v("input",{"onUpdate:modelValue":d[0]||(d[0]=h=>a.value=h),type:"url",placeholder:"https://ejemplo.com",required:"",class:"flex-1 border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512),[[ve,a.value]]),ae(v("input",{"onUpdate:modelValue":d[1]||(d[1]=h=>p.value=h),type:"number",min:"1",max:"200",class:"w-24 border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm",title:"Máximo de páginas a crawlear"},null,512),[[ve,p.value]]),v("button",{type:"submit",disabled:u.value,class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg disabled:opacity-50 transition-colors"},J(u.value?"Agregando...":"Crawlear sitio"),9,Vu)],32),v("div",ju,[l.value.length===0?(M(),V("div",Lu,"Sin fuentes todavía.")):ue("",!0),(M(!0),V(pe,null,Ke(l.value,h=>(M(),V("div",{key:h.ID,class:"p-4 flex items-center justify-between"},[v("div",null,[v("div",Uu,J(h.origen),1),v("div",Fu,[v("span",{class:Ve(["px-1.5 py-0.5 rounded",R.value(h.estado)])},J(h.estado),3),h.total_chunks?(M(),V("span",$u," · "+J(h.total_chunks)+" fragmentos",1)):ue("",!0),h.error?(M(),V("span",Hu," · "+J(h.error),1)):ue("",!0)])]),v("button",{class:"text-red-500 hover:text-red-700 text-sm",onClick:C=>N(h.ID)},"Eliminar",8,Bu)]))),128))])])):i.value==="herramientas"?(M(),V("div",Ku,[v("div",{class:"flex justify-between items-center mb-4"},[d[23]||(d[23]=v("p",{class:"text-xs text-gray-500 dark:text-gray-400"},"Máximo 10 tools activas por tenant.",-1)),v("button",{class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg transition-colors",onClick:Qe}," + Nueva tool ")]),v("div",Gu,[W.value.length===0?(M(),V("div",qu,"Sin tools custom todavía.")):ue("",!0),(M(!0),V(pe,null,Ke(W.value,h=>(M(),V("div",{key:h.ID,class:"p-4 flex items-center justify-between"},[v("div",null,[v("div",Wu,J(h.nombre),1),v("div",zu,J(h.descripcion),1),v("div",Ju,[pt(J(h.url)+" ",1),h.auth_configurado?(M(),V("span",Qu,"· auth configurada")):ue("",!0),h.activa?ue("",!0):(M(),V("span",Yu,"· inactiva"))])]),v("div",Xu,[v("button",{class:"text-gray-500 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-100",onClick:C=>at(h)},"Editar",8,Zu),v("button",{class:"text-red-500 hover:text-red-700",onClick:C=>he(h)},"Eliminar",8,ef)])]))),128))]),le.value?(M(),V("div",{key:0,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:d[10]||(d[10]=St(h=>le.value=!1,["self"]))},[v("div",tf,[v("h2",nf,J(X.value?"Editar tool":"Nueva tool"),1),v("form",{class:"space-y-3",onSubmit:St(wt,["prevent"])},[v("div",null,[d[24]||(d[24]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"Nombre (identificador, ej: consultar_stock)",-1)),ae(v("input",{"onUpdate:modelValue":d[2]||(d[2]=h=>K.value.nombre=h),required:"",pattern:"[a-z][a-z0-9_]{2,63}",class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm font-mono"},null,512),[[ve,K.value.nombre]])]),v("div",null,[d[25]||(d[25]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"Descripción (esto lo lee el modelo para decidir cuándo usarla)",-1)),ae(v("textarea",{"onUpdate:modelValue":d[3]||(d[3]=h=>K.value.descripcion=h),rows:"2",required:"",class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512),[[ve,K.value.descripcion]])]),v("div",null,[d[26]||(d[26]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"URL del webhook (https)",-1)),ae(v("input",{"onUpdate:modelValue":d[4]||(d[4]=h=>K.value.url=h),type:"url",required:"",placeholder:"https://...",class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512),[[ve,K.value.url]])]),v("div",rf,[v("div",{class:"flex items-center justify-between"},[d[27]||(d[27]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"Parámetros que completa el modelo",-1)),v("button",{type:"button",class:"text-xs text-brand",onClick:Fe},"+ agregar")]),(M(!0),V(pe,null,Ke(K.value.parametros,(h,C)=>(M(),V("div",{key:C,class:"flex gap-2 items-center"},[ae(v("input",{"onUpdate:modelValue":A=>h.nombre=A,placeholder:"nombre",class:"flex-1 border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded px-2 py-1 text-xs font-mono"},null,8,sf),[[ve,h.nombre]]),ae(v("select",{"onUpdate:modelValue":A=>h.tipo=A,class:"border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded px-2 py-1 text-xs"},[...d[28]||(d[28]=[v("option",{value:"string"},"string",-1),v("option",{value:"number"},"number",-1),v("option",{value:"boolean"},"boolean",-1)])],8,of),[[Nr,h.tipo]]),ae(v("input",{"onUpdate:modelValue":A=>h.descripcion=A,placeholder:"descripción",class:"flex-1 border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded px-2 py-1 text-xs"},null,8,lf),[[ve,h.descripcion]]),v("label",af,[ae(v("input",{"onUpdate:modelValue":A=>h.requerido=A,type:"checkbox"},null,8,cf),[[Dn,h.requerido]]),d[29]||(d[29]=pt(" req. ",-1))]),v("button",{type:"button",class:"text-red-400 text-xs",onClick:A=>It(C)},"✕",8,uf)]))),128)),K.value.parametros.length===0?(M(),V("p",ff,"Sin parámetros.")):ue("",!0)]),v("div",df,[d[30]||(d[30]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"Autenticación saliente (opcional)",-1)),ae(v("input",{"onUpdate:modelValue":d[5]||(d[5]=h=>K.value.auth_header_nombre=h),placeholder:"Nombre del header, ej: Authorization",class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512),[[ve,K.value.auth_header_nombre]]),v("label",pf,[ae(v("input",{"onUpdate:modelValue":d[6]||(d[6]=h=>K.value.tocarAuth=h),type:"checkbox"},null,512),[[Dn,K.value.tocarAuth]]),pt(" "+J(X.value?"Cambiar el valor del secreto":"Configurar valor"),1)]),K.value.tocarAuth?ae((M(),V("input",{key:0,"onUpdate:modelValue":d[7]||(d[7]=h=>K.value.auth_header_valor=h),type:"password",placeholder:"Valor del header (ej: Bearer xxxx)",class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512)),[[ve,K.value.auth_header_valor]]):ue("",!0)]),v("label",gf,[ae(v("input",{"onUpdate:modelValue":d[8]||(d[8]=h=>K.value.activa=h),type:"checkbox"},null,512),[[Dn,K.value.activa]]),d[31]||(d[31]=pt(" Activa ",-1))]),v("div",hf,[v("button",{type:"button",class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400",onClick:d[9]||(d[9]=h=>le.value=!1)},"Cancelar"),d[32]||(d[32]=v("button",{type:"submit",class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg"},"Guardar",-1))])],32)])])):ue("",!0)])):i.value==="canales"?(M(),V("div",mf,[v("div",{class:"flex justify-end mb-4"},[v("button",{class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg transition-colors",onClick:ke}," + Nuevo canal ")]),v("div",yf,[Q.value.length===0?(M(),V("div",vf,"Sin canales configurados.")):ue("",!0),(M(!0),V(pe,null,Ke(Q.value,h=>(M(),V("div",{key:h.ID,class:"p-4"},[v("div",bf,[v("div",null,[v("span",xf,J(h.tipo),1),v("span",{class:Ve(["ml-2 px-1.5 py-0.5 rounded text-xs",h.activo?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400"])},J(h.activo?"activo":"inactivo"),3)]),v("div",_f,[v("button",{class:"text-gray-500 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-100",onClick:C=>Et(h)},J(h.activo?"Desactivar":"Activar"),9,wf),v("button",{class:"text-red-500 hover:text-red-700",onClick:C=>ct(h)},"Eliminar",8,kf)])]),v("p",Ef,[d[33]||(d[33]=pt(" Webhook: ",-1)),v("code",Cf,J(h.webhook_url),1)]),h.tipo==="whatsapp"?(M(),V("p",Af,' Registrá esta URL como "Callback URL" en Meta for Developers → WhatsApp → Configuration, con el mismo verify_token que pusiste acá. ')):ue("",!0),h.ultimo_error?(M(),V("p",Sf,J(h.ultimo_error),1)):ue("",!0)]))),128))]),q.value?(M(),V("div",{key:0,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:d[18]||(d[18]=St(h=>q.value=!1,["self"]))},[v("div",Rf,[d[42]||(d[42]=v("h2",{class:"font-semibold text-gray-800 dark:text-gray-100 mb-4"},"Nuevo canal",-1)),v("form",{class:"space-y-3",onSubmit:St(kt,["prevent"])},[v("div",null,[d[35]||(d[35]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"Tipo",-1)),ae(v("select",{"onUpdate:modelValue":d[11]||(d[11]=h=>Y.value.tipo=h),class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},[...d[34]||(d[34]=[v("option",{value:"telegram"},"Telegram",-1),v("option",{value:"whatsapp"},"WhatsApp Business",-1)])],512),[[Nr,Y.value.tipo]])]),Y.value.tipo==="telegram"?(M(),V("div",Of,[d[36]||(d[36]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"Bot token (de @BotFather)",-1)),ae(v("input",{"onUpdate:modelValue":d[12]||(d[12]=h=>Y.value.bot_token=h),type:"password",required:"",class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512),[[ve,Y.value.bot_token]])])):(M(),V(pe,{key:1},[v("div",null,[d[37]||(d[37]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"Phone Number ID",-1)),ae(v("input",{"onUpdate:modelValue":d[13]||(d[13]=h=>Y.value.phone_number_id=h),required:"",class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512),[[ve,Y.value.phone_number_id]])]),v("div",null,[d[38]||(d[38]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"Access Token",-1)),ae(v("input",{"onUpdate:modelValue":d[14]||(d[14]=h=>Y.value.access_token=h),type:"password",required:"",class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512),[[ve,Y.value.access_token]])]),v("div",null,[d[39]||(d[39]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"App Secret",-1)),ae(v("input",{"onUpdate:modelValue":d[15]||(d[15]=h=>Y.value.app_secret=h),type:"password",required:"",class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512),[[ve,Y.value.app_secret]])]),v("div",null,[d[40]||(d[40]=v("label",{class:"text-xs text-gray-500 dark:text-gray-400"},"Verify Token (lo inventás vos, lo vas a usar en Meta)",-1)),ae(v("input",{"onUpdate:modelValue":d[16]||(d[16]=h=>Y.value.verify_token=h),required:"",class:"w-full border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512),[[ve,Y.value.verify_token]])])],64)),v("div",Tf,[v("button",{type:"button",class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400",onClick:d[17]||(d[17]=h=>q.value=!1)},"Cancelar"),d[41]||(d[41]=v("button",{type:"submit",class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg"},"Guardar",-1))])],32)])])):ue("",!0)])):i.value==="conexiones"?(M(),V("div",If,[d[43]||(d[43]=v("p",{class:"text-xs text-gray-500 dark:text-gray-400 mb-4"}," Conectá una cuenta de correo para que el agente pueda enviar y leer correo en nombre del negocio. Se soporta una cuenta activa a la vez. ",-1)),v("div",Pf,[v("button",{class:"border border-gray-300 dark:border-gray-700 hover:border-brand text-sm font-medium px-4 py-2 rounded-lg text-gray-700 dark:text-gray-200 transition-colors",onClick:d[19]||(d[19]=h=>P("google"))}," Conectar Google "),v("button",{class:"border border-gray-300 dark:border-gray-700 hover:border-brand text-sm font-medium px-4 py-2 rounded-lg text-gray-700 dark:text-gray-200 transition-colors",onClick:d[20]||(d[20]=h=>P("microsoft"))}," Conectar Outlook ")]),v("div",Nf,[Ee.value.length===0?(M(),V("div",Df,"Sin cuentas conectadas.")):ue("",!0),(M(!0),V(pe,null,Ke(Ee.value,h=>(M(),V("div",{key:h.ID,class:"p-4 flex items-center justify-between"},[v("div",null,[v("span",Mf,J(h.proveedor),1),v("span",Vf,J(h.email),1),v("span",{class:Ve(["ml-2 px-1.5 py-0.5 rounded text-xs",h.activo?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400"])},J(h.activo?"activa":"inactiva"),3)]),v("button",{class:"text-red-500 hover:text-red-700 text-sm",onClick:C=>O(h)},"Desconectar",8,jf)]))),128))])])):i.value==="chat"?(M(),V("div",Lf,[v("div",Uf,[G.value.length===0?(M(),V("p",Ff," Probá el agente tal cual lo va a ver un visitante — usa la misma config de IA y las mismas tools/base de conocimiento del tenant. ")):ue("",!0),(M(!0),V(pe,null,Ke(G.value,(h,C)=>(M(),V("div",{key:C,class:Ve(["max-w-[80%] px-3 py-2 rounded-lg text-sm whitespace-pre-wrap",h.role==="user"?"bg-brand text-white ml-auto":"bg-gray-100 dark:bg-gray-800 text-gray-800 dark:text-gray-100"])},J(h.content),3))),128)),f.value?(M(),V("p",$f,"Pensando...")):ue("",!0)]),v("form",{class:"flex gap-2",onSubmit:St(m,["prevent"])},[ae(v("input",{"onUpdate:modelValue":d[21]||(d[21]=h=>c.value=h),placeholder:"Escribí un mensaje de prueba...",class:"flex-1 border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm"},null,512),[[ve,c.value]]),v("button",{type:"submit",disabled:f.value,class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg disabled:opacity-50 transition-colors"}," Enviar ",8,Hf)],32)])):(M(),V("div",Bf,[v("div",Kf,[U.value.length===0?(M(),V("div",Gf,"Sin conversaciones.")):ue("",!0),(M(!0),V(pe,null,Ke(U.value,h=>(M(),V("button",{key:h.session_id,class:Ve(["w-full text-left p-3 hover:bg-gray-50 dark:hover:bg-gray-800 text-sm",k.value===h.session_id?"bg-gray-50 dark:bg-gray-800":""]),onClick:C=>S(h.session_id)},[v("div",Wf,J(h.content),1),v("div",zf,J(h.session_id),1)],10,qf))),128))]),v("div",Jf,[k.value?ue("",!0):(M(),V("p",Qf,"Elegí una conversación de la izquierda.")),(M(!0),V(pe,null,Ke(T.value,h=>(M(),V("div",{key:h.ID,class:Ve(["max-w-[80%] px-3 py-2 rounded-lg text-sm",h.role==="user"?"bg-brand text-white ml-auto":"bg-gray-100 dark:bg-gray-800 text-gray-800 dark:text-gray-100"])},J(h.content),3))),128))])]))]))}},Xf=Zc({history:Ic("/orchestrator/"),routes:[{path:"/",name:"home",component:Su},{path:"/tenants/:id",name:"tenant-detail",component:Yf,props:!0}]});Ga(wu).use(Xf).mount("#app"); diff --git a/public/orchestrator/assets/index-DniozBCm.css b/public/orchestrator/assets/index-DniozBCm.css deleted file mode 100644 index c14316e..0000000 --- a/public/orchestrator/assets/index-DniozBCm.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.inset-0{top:0;right:0;bottom:0;left:0}.z-50{z-index:50}.col-span-1{grid-column:span 1 / span 1}.col-span-2{grid-column:span 2 / span 2}.mx-auto{margin-left:auto;margin-right:auto}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.flex{display:flex}.grid{display:grid}.h-\[28rem\]{height:28rem}.max-h-\[28rem\]{max-height:28rem}.max-h-\[85vh\]{max-height:85vh}.min-h-screen{min-height:100vh}.w-24{width:6rem}.w-full{width:100%}.max-w-6xl{max-width:72rem}.max-w-\[80\%\]{max-width:80%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(243 244 246 / var(--tw-divide-opacity, 1))}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-brand{--tw-border-opacity: 1;border-color:rgb(142 176 47 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-black\/30{background-color:#0000004d}.bg-brand{--tw-bg-opacity: 1;background-color:rgb(142 176 47 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pt-2{padding-top:.5rem}.text-left{text-align:left}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.capitalize{text-transform:capitalize}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-brand{--tw-text-opacity: 1;color:rgb(142 176 47 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\:bg-brand-dark:hover{--tw-bg-opacity: 1;background-color:rgb(113 144 38 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.disabled\:opacity-50:disabled{opacity:.5} diff --git a/public/orchestrator/assets/index-DopCJrBT.js b/public/orchestrator/assets/index-DopCJrBT.js deleted file mode 100644 index 32c70cb..0000000 --- a/public/orchestrator/assets/index-DopCJrBT.js +++ /dev/null @@ -1,26 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();/** -* @vue/shared v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function Ls(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const re={},$t=[],lt=()=>{},no=()=>!1,Kn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Gn=e=>e.startsWith("onUpdate:"),_e=Object.assign,Us=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ci=Object.prototype.hasOwnProperty,Z=(e,t)=>Ci.call(e,t),K=Array.isArray,Kt=e=>wn(e)==="[object Map]",Xt=e=>wn(e)==="[object Set]",ar=e=>wn(e)==="[object Date]",W=e=>typeof e=="function",fe=e=>typeof e=="string",ut=e=>typeof e=="symbol",ee=e=>e!==null&&typeof e=="object",so=e=>(ee(e)||W(e))&&W(e.then)&&W(e.catch),ro=Object.prototype.toString,wn=e=>ro.call(e),Ai=e=>wn(e).slice(8,-1),oo=e=>wn(e)==="[object Object]",Fs=e=>fe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ln=Ls(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Wn=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Si=/-\w/g,Te=Wn(e=>e.replace(Si,t=>t.slice(1).toUpperCase())),Ri=/\B([A-Z])/g,Ut=Wn(e=>e.replace(Ri,"-$1").toLowerCase()),qn=Wn(e=>e.charAt(0).toUpperCase()+e.slice(1)),is=Wn(e=>e?`on${qn(e)}`:""),ot=(e,t)=>!Object.is(e,t),Pn=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},zn=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let ur;const Jn=()=>ur||(ur=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Hs(e){if(K(e)){const t={};for(let n=0;n{if(n){const s=n.split(Ti);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function tt(e){let t="";if(fe(e))t=e;else if(K(e))for(let n=0;nZt(n,t))}const ao=e=>!!(e&&e.__v_isRef===!0),Q=e=>fe(e)?e:e==null?"":K(e)||ee(e)&&(e.toString===ro||!W(e.toString))?ao(e)?Q(e.value):JSON.stringify(e,uo,2):String(e),uo=(e,t)=>ao(t)?uo(e,t.value):Kt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],o)=>(n[ls(s,o)+" =>"]=r,n),{})}:Xt(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ls(n))}:ut(t)?ls(t):ee(t)&&!K(t)&&!oo(t)?String(t):t,ls=(e,t="")=>{var n;return ut(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** -* @vue/reactivity v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let be;class Mi{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&be&&(be.active?(this.parent=be,this.index=(be.scopes||(be.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const s=this.scopes.slice();for(t=0,n=s.length;t0&&--this._on===0){if(be===this)be=this.prevScope;else{let t=be;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n0)return;if(un){let t=un;for(un=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;an;){let t=an;for(an=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function ho(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function go(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),Gs(s),ji(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function ws(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(mo(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function mo(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===hn)||(e.globalVersion=hn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ws(e))))return;e.flags|=2;const t=e.dep,n=le,s=Ke;le=e,Ke=!0;try{ho(e);const r=e.fn(e._value);(t.version===0||ot(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{le=n,Ke=s,go(e),e.flags&=-3}}function Gs(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)Gs(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ji(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ke=!0;const vo=[];function yt(){vo.push(Ke),Ke=!1}function bt(){const e=vo.pop();Ke=e===void 0?!0:e}function cr(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=le;le=void 0;try{t()}finally{le=n}}}let hn=0;class Li{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ws{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!le||!Ke||le===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==le)n=this.activeLink=new Li(le,this),le.deps?(n.prevDep=le.depsTail,le.depsTail.nextDep=n,le.depsTail=n):le.deps=le.depsTail=n,yo(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=le.depsTail,n.nextDep=void 0,le.depsTail.nextDep=n,le.depsTail=n,le.deps===n&&(le.deps=s)}return n}trigger(t){this.version++,hn++,this.notify(t)}notify(t){$s();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ks()}}}function yo(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)yo(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Es=new WeakMap,Mt=Symbol(""),Cs=Symbol(""),gn=Symbol("");function we(e,t,n){if(Ke&&le){let s=Es.get(e);s||Es.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new Ws),r.map=s,r.key=n),r.track()}}function mt(e,t,n,s,r,o){const i=Es.get(e);if(!i){hn++;return}const a=u=>{u&&u.trigger()};if($s(),t==="clear")i.forEach(a);else{const u=K(e),p=u&&Fs(n);if(u&&n==="length"){const f=Number(s);i.forEach((h,g)=>{(g==="length"||g===gn||!ut(g)&&g>=f)&&a(h)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),p&&a(i.get(gn)),t){case"add":u?p&&a(i.get("length")):(a(i.get(Mt)),Kt(e)&&a(i.get(Cs)));break;case"delete":u||(a(i.get(Mt)),Kt(e)&&a(i.get(Cs)));break;case"set":Kt(e)&&a(i.get(Mt));break}}Ks()}function Ft(e){const t=X(e);return t===e?t:(we(t,"iterate",gn),Be(e)?t:t.map(Ge))}function Qn(e){return we(e=X(e),"iterate",gn),e}function nt(e,t){return _t(e)?qt(Vt(e)?Ge(t):t):Ge(t)}const Ui={__proto__:null,[Symbol.iterator](){return us(this,Symbol.iterator,e=>nt(this,e))},concat(...e){return Ft(this).concat(...e.map(t=>K(t)?Ft(t):t))},entries(){return us(this,"entries",e=>(e[1]=nt(this,e[1]),e))},every(e,t){return dt(this,"every",e,t,void 0,arguments)},filter(e,t){return dt(this,"filter",e,t,n=>n.map(s=>nt(this,s)),arguments)},find(e,t){return dt(this,"find",e,t,n=>nt(this,n),arguments)},findIndex(e,t){return dt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return dt(this,"findLast",e,t,n=>nt(this,n),arguments)},findLastIndex(e,t){return dt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return dt(this,"forEach",e,t,void 0,arguments)},includes(...e){return cs(this,"includes",e)},indexOf(...e){return cs(this,"indexOf",e)},join(e){return Ft(this).join(e)},lastIndexOf(...e){return cs(this,"lastIndexOf",e)},map(e,t){return dt(this,"map",e,t,void 0,arguments)},pop(){return tn(this,"pop")},push(...e){return tn(this,"push",e)},reduce(e,...t){return fr(this,"reduce",e,t)},reduceRight(e,...t){return fr(this,"reduceRight",e,t)},shift(){return tn(this,"shift")},some(e,t){return dt(this,"some",e,t,void 0,arguments)},splice(...e){return tn(this,"splice",e)},toReversed(){return Ft(this).toReversed()},toSorted(e){return Ft(this).toSorted(e)},toSpliced(...e){return Ft(this).toSpliced(...e)},unshift(...e){return tn(this,"unshift",e)},values(){return us(this,"values",e=>nt(this,e))}};function us(e,t,n){const s=Qn(e),r=s[t]();return s!==e&&!Be(e)&&(r._next=r.next,r.next=()=>{const o=r._next();return o.done||(o.value=n(o.value)),o}),r}const Fi=Array.prototype;function dt(e,t,n,s,r,o){const i=Qn(e),a=i!==e&&!Be(e),u=i[t];if(u!==Fi[t]){const h=u.apply(e,o);return a?Ge(h):h}let p=n;i!==e&&(a?p=function(h,g){return n.call(this,nt(e,h),g,e)}:n.length>2&&(p=function(h,g){return n.call(this,h,g,e)}));const f=u.call(i,p,s);return a&&r?r(f):f}function fr(e,t,n,s){const r=Qn(e),o=r!==e&&!Be(e);let i=n,a=!1;r!==e&&(o?(a=s.length===0,i=function(p,f,h){return a&&(a=!1,p=nt(e,p)),n.call(this,p,nt(e,f),h,e)}):n.length>3&&(i=function(p,f,h){return n.call(this,p,f,h,e)}));const u=r[t](i,...s);return a?nt(e,u):u}function cs(e,t,n){const s=X(e);we(s,"iterate",gn);const r=s[t](...n);return(r===-1||r===!1)&&Js(n[0])?(n[0]=X(n[0]),s[t](...n)):r}function tn(e,t,n=[]){yt(),$s();const s=X(e)[t].apply(e,n);return Ks(),bt(),s}const Hi=Ls("__proto__,__v_isRef,__isVue"),bo=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ut));function Bi(e){ut(e)||(e=String(e));const t=X(this);return we(t,"has",e),t.hasOwnProperty(e)}class _o{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return o;if(n==="__v_raw")return s===(r?o?Xi:Co:o?Eo:wo).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const i=K(t);if(!r){let u;if(i&&(u=Ui[n]))return u;if(n==="hasOwnProperty")return Bi}const a=Reflect.get(t,n,Ae(t)?t:s);if((ut(n)?bo.has(n):Hi(n))||(r||we(t,"get",n),o))return a;if(Ae(a)){const u=i&&Fs(n)?a:a.value;return r&&ee(u)?Ss(u):u}return ee(a)?r?Ss(a):Yn(a):a}}class xo extends _o{constructor(t=!1){super(!1,t)}set(t,n,s,r){let o=t[n];const i=K(t)&&Fs(n);if(!this._isShallow){const p=_t(o);if(!Be(s)&&!_t(s)&&(o=X(o),s=X(s)),!i&&Ae(o)&&!Ae(s))return p||(o.value=s),!0}const a=i?Number(n)e,An=e=>Reflect.getPrototypeOf(e);function qi(e,t,n){return function(...s){const r=this.__v_raw,o=X(r),i=Kt(o),a=e==="entries"||e===Symbol.iterator&&i,u=e==="keys"&&i,p=r[e](...s),f=n?As:t?qt:Ge;return!t&&we(o,"iterate",u?Cs:Mt),_e(Object.create(p),{next(){const{value:h,done:g}=p.next();return g?{value:h,done:g}:{value:a?[f(h[0]),f(h[1])]:f(h),done:g}}})}}function Sn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function zi(e,t){const n={get(r){const o=this.__v_raw,i=X(o),a=X(r);e||(ot(r,a)&&we(i,"get",r),we(i,"get",a));const{has:u}=An(i),p=t?As:e?qt:Ge;if(u.call(i,r))return p(o.get(r));if(u.call(i,a))return p(o.get(a));o!==i&&o.get(r)},get size(){const r=this.__v_raw;return!e&&we(X(r),"iterate",Mt),r.size},has(r){const o=this.__v_raw,i=X(o),a=X(r);return e||(ot(r,a)&&we(i,"has",r),we(i,"has",a)),r===a?o.has(r):o.has(r)||o.has(a)},forEach(r,o){const i=this,a=i.__v_raw,u=X(a),p=t?As:e?qt:Ge;return!e&&we(u,"iterate",Mt),a.forEach((f,h)=>r.call(o,p(f),p(h),i))}};return _e(n,e?{add:Sn("add"),set:Sn("set"),delete:Sn("delete"),clear:Sn("clear")}:{add(r){const o=X(this),i=An(o),a=X(r),u=!t&&!Be(r)&&!_t(r)?a:r;return i.has.call(o,u)||ot(r,u)&&i.has.call(o,r)||ot(a,u)&&i.has.call(o,a)||(o.add(u),mt(o,"add",u,u)),this},set(r,o){!t&&!Be(o)&&!_t(o)&&(o=X(o));const i=X(this),{has:a,get:u}=An(i);let p=a.call(i,r);p||(r=X(r),p=a.call(i,r));const f=u.call(i,r);return i.set(r,o),p?ot(o,f)&&mt(i,"set",r,o):mt(i,"add",r,o),this},delete(r){const o=X(this),{has:i,get:a}=An(o);let u=i.call(o,r);u||(r=X(r),u=i.call(o,r)),a&&a.call(o,r);const p=o.delete(r);return u&&mt(o,"delete",r,void 0),p},clear(){const r=X(this),o=r.size!==0,i=r.clear();return o&&mt(r,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=qi(r,e,t)}),n}function qs(e,t){const n=zi(e,t);return(s,r,o)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(Z(n,r)&&r in s?n:s,r,o)}const Ji={get:qs(!1,!1)},Qi={get:qs(!1,!0)},Yi={get:qs(!0,!1)};const wo=new WeakMap,Eo=new WeakMap,Co=new WeakMap,Xi=new WeakMap;function Zi(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Yn(e){return _t(e)?e:zs(e,!1,Ki,Ji,wo)}function Ao(e){return zs(e,!1,Wi,Qi,Eo)}function Ss(e){return zs(e,!0,Gi,Yi,Co)}function zs(e,t,n,s,r){if(!ee(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const o=r.get(e);if(o)return o;const i=Zi(Ai(e));if(i===0)return e;const a=new Proxy(e,i===2?s:n);return r.set(e,a),a}function Vt(e){return _t(e)?Vt(e.__v_raw):!!(e&&e.__v_isReactive)}function _t(e){return!!(e&&e.__v_isReadonly)}function Be(e){return!!(e&&e.__v_isShallow)}function Js(e){return e?!!e.__v_raw:!1}function X(e){const t=e&&e.__v_raw;return t?X(t):e}function el(e){return!Z(e,"__v_skip")&&Object.isExtensible(e)&&io(e,"__v_skip",!0),e}const Ge=e=>ee(e)?Yn(e):e,qt=e=>ee(e)?Ss(e):e;function Ae(e){return e?e.__v_isRef===!0:!1}function ne(e){return So(e,!1)}function tl(e){return So(e,!0)}function So(e,t){return Ae(e)?e:new nl(e,t)}class nl{constructor(t,n){this.dep=new Ws,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:X(t),this._value=n?t:Ge(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Be(t)||_t(t);t=s?t:X(t),ot(t,n)&&(this._rawValue=t,this._value=s?t:Ge(t),this.dep.trigger())}}function jt(e){return Ae(e)?e.value:e}const sl={get:(e,t,n)=>t==="__v_raw"?e:jt(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return Ae(r)&&!Ae(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function Ro(e){return Vt(e)?e:new Proxy(e,sl)}class rl{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ws(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=hn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&le!==this)return po(this,!0),!0}get value(){const t=this.dep.track();return mo(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function ol(e,t,n=!1){let s,r;return W(e)?s=e:(s=e.get,r=e.set),new rl(s,r,n)}const Rn={},Mn=new WeakMap;let kt;function il(e,t=!1,n=kt){if(n){let s=Mn.get(n);s||Mn.set(n,s=[]),s.push(e)}}function ll(e,t,n=re){const{immediate:s,deep:r,once:o,scheduler:i,augmentJob:a,call:u}=n,p=D=>r?D:Be(D)||r===!1||r===0?vt(D,1):vt(D);let f,h,g,v,M=!1,E=!1;if(Ae(e)?(h=()=>e.value,M=Be(e)):Vt(e)?(h=()=>p(e),M=!0):K(e)?(E=!0,M=e.some(D=>Vt(D)||Be(D)),h=()=>e.map(D=>{if(Ae(D))return D.value;if(Vt(D))return p(D);if(W(D))return u?u(D,2):D()})):W(e)?t?h=u?()=>u(e,2):e:h=()=>{if(g){yt();try{g()}finally{bt()}}const D=kt;kt=f;try{return u?u(e,3,[v]):e(v)}finally{kt=D}}:h=lt,t&&r){const D=h,q=r===!0?1/0:r;h=()=>vt(D(),q)}const C=Vi(),R=()=>{f.stop(),C&&C.active&&Us(C.effects,f)};if(o&&t){const D=t;t=(...q)=>{const oe=D(...q);return R(),oe}}let I=E?new Array(e.length).fill(Rn):Rn;const V=D=>{if(!(!(f.flags&1)||!f.dirty&&!D))if(t){const q=f.run();if(D||r||M||(E?q.some((oe,U)=>ot(oe,I[U])):ot(q,I))){g&&g();const oe=kt;kt=f;try{const U=[q,I===Rn?void 0:E&&I[0]===Rn?[]:I,v];I=q,u?u(t,3,U):t(...U)}finally{kt=oe}}}else f.run()};return a&&a(V),f=new co(h),f.scheduler=i?()=>i(V,!1):V,v=D=>il(D,!1,f),g=f.onStop=()=>{const D=Mn.get(f);if(D){if(u)u(D,4);else for(const q of D)q();Mn.delete(f)}},t?s?V(!0):I=f.run():i?i(V.bind(null,!0),!0):f.run(),R.pause=f.pause.bind(f),R.resume=f.resume.bind(f),R.stop=R,R}function vt(e,t=1/0,n){if(t<=0||!ee(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ae(e))vt(e.value,t,n);else if(K(e))for(let s=0;s{vt(s,t,n)});else if(oo(e)){for(const s in e)vt(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&vt(e[s],t,n)}return e}/** -* @vue/runtime-core v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function En(e,t,n,s){try{return s?e(...s):e()}catch(r){Xn(r,t,n)}}function We(e,t,n,s){if(W(e)){const r=En(e,t,n,s);return r&&so(r)&&r.catch(o=>{Xn(o,t,n)}),r}if(K(e)){const r=[];for(let o=0;o>>1,r=Oe[s],o=mn(r);o=mn(n)?Oe.push(e):Oe.splice(ul(t),0,e),e.flags|=1,To()}}function To(){Vn||(Vn=Oo.then(Io))}function cl(e){if(!K(e))Rt&&e.id===-1?Rt.splice(Ht+1,0,e):e.flags&1||(Gt.push(e),e.flags|=1);else for(let t=0;tmn(n)-mn(s));if(Gt.length=0,Rt){for(let n=0;ne.id==null?e.flags&2?-1:1/0:e.id;function Io(e){try{for(Ze=0;Ze{s._d&&Fn(-1);const o=jn(t),i=Lt.length;let a;try{a=e(...r)}finally{for(let u=Lt.length;u>i;u--)si();jn(o),s._d&&Fn(1)}return a};return s._n=!0,s._c=!0,s._d=!0,s}function ie(e,t){if(Me===null)return e;const n=ss(Me),s=e.dirs||(e.dirs=[]);for(let r=0;r1)return n&&W(t)?t.call(s&&s.proxy):t}}const fl=Symbol.for("v-scx"),dl=()=>at(fl);function Nn(e,t,n){return ko(e,t,n)}function ko(e,t,n=re){const{immediate:s,deep:r,flush:o,once:i}=n,a=_e({},n),u=t&&s||!t&&o!=="post";let p;if(bn){if(o==="sync"){const v=dl();p=v.__watcherHandles||(v.__watcherHandles=[])}else if(!u){const v=()=>{};return v.stop=lt,v.resume=lt,v.pause=lt,v}}const f=Ee;a.call=(v,M,E)=>We(v,f,M,E);let h=!1;o==="post"?a.scheduler=v=>{Pe(v,f&&f.suspense)}:o!=="sync"&&(h=!0,a.scheduler=(v,M)=>{M?v():Ys(v)}),a.augmentJob=v=>{t&&(v.flags|=4),h&&(v.flags|=2,f&&(v.id=f.uid,v.i=f))};const g=ll(e,t,a);return bn&&(p?p.push(g):u&&g()),g}function pl(e,t,n){const s=this.proxy,r=fe(e)?e.includes(".")?Do(s,e):()=>s[e]:e.bind(s,s);let o;W(t)?o=t:(o=t.handler,n=t);const i=Cn(this),a=ko(r,o.bind(s),n);return i(),a}function Do(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;re.__isTeleport,fs=Symbol("_leaveCb");function gl(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==xt){t=n;break}}return t}function Mo(e){if(!er(e))return Zn(e.type)&&e.children?gl(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&W(n.default))return n.default()}}function Zs(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;Zs(Zn(n.type)&&Mo(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Vo(e,t){return W(e)?_e({name:e.name},t,{setup:e}):e}function jo(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function pr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ln=new WeakMap;function cn(e,t,n,s,r=!1){if(K(e)){e.forEach((E,C)=>cn(E,t&&(K(t)?t[C]:t),n,s,r));return}if(fn(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&cn(e,t,n,s.component.subTree);return}const o=s.shapeFlag&4?ss(s.component):s.el,i=r?null:o,{i:a,r:u}=e,p=t&&t.r,f=a.refs===re?a.refs={}:a.refs,h=a.setupState,g=X(h),v=h===re?no:E=>pr(f,E)?!1:Z(g,E),M=(E,C)=>!(C&&pr(f,C));if(p!=null&&p!==u){if(hr(t),fe(p))f[p]=null,v(p)&&(h[p]=null);else if(Ae(p)){const E=t;M(p,E.k)&&(p.value=null),E.k&&(f[E.k]=null)}}if(W(u))En(u,a,12,[i,f]);else{const E=fe(u),C=Ae(u);if(E||C){const R=()=>{if(e.f){const I=E?v(u)?h[u]:f[u]:M()||!e.k?u.value:f[e.k];if(r)K(I)&&Us(I,o);else if(K(I))I.includes(o)||I.push(o);else if(E)f[u]=[o],v(u)&&(h[u]=f[u]);else{const V=[o];M(u,e.k)&&(u.value=V),e.k&&(f[e.k]=V)}}else E?(f[u]=i,v(u)&&(h[u]=i)):C&&(M(u,e.k)&&(u.value=i),e.k&&(f[e.k]=i))};if(i){const I=()=>{R(),Ln.delete(e)};I.id=-1,Ln.set(e,I),Pe(I,n)}else hr(e),R()}}}function hr(e){const t=Ln.get(e);t&&(t.flags|=8,Ln.delete(e))}Jn().requestIdleCallback;Jn().cancelIdleCallback;const fn=e=>!!e.type.__asyncLoader,er=e=>e.type.__isKeepAlive;function ml(e,t){Lo(e,"a",t)}function vl(e,t){Lo(e,"da",t)}function Lo(e,t,n=Ee){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(es(t,s,n),n){let r=n.parent;for(;r&&r.parent;)er(r.parent.vnode)&&yl(s,t,n,r),r=r.parent}}function yl(e,t,n,s){const r=es(t,e,s,!0);Uo(()=>{Us(s[t],r)},n)}function es(e,t,n=Ee,s=!1){if(n){const r=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{yt();const a=Cn(n),u=We(t,n,e,i);return a(),bt(),u});return s?r.unshift(o):r.push(o),o}}const wt=e=>(t,n=Ee)=>{(!bn||e==="sp")&&es(e,(...s)=>t(...s),n)},bl=wt("bm"),tr=wt("m"),_l=wt("bu"),xl=wt("u"),wl=wt("bum"),Uo=wt("um"),El=wt("sp"),Cl=wt("rtg"),Al=wt("rtc");function Sl(e,t=Ee){es("ec",e,t)}const Rl="components";function Rs(e,t){return Tl(Rl,e,!0,t)||e}const Ol=Symbol.for("v-ndc");function Tl(e,t,n=!0,s=!1){const r=Me||Ee;if(r){const o=r.type;{const a=ha(o,!1);if(a&&(a===t||a===Te(t)||a===qn(Te(t))))return o}const i=gr(r[e]||o[e],t)||gr(r.appContext[e],t);return!i&&s?o:i}}function gr(e,t){return e&&(e[t]||e[Te(t)]||e[qn(Te(t))])}function et(e,t,n,s){let r;const o=n,i=K(e);if(i||fe(e)){const a=i&&Vt(e);let u=!1,p=!1;a&&(u=!Be(e),p=_t(e),e=Qn(e)),r=new Array(e.length);for(let f=0,h=e.length;ft(a,u,void 0,o));else{const a=Object.keys(e);r=new Array(a.length);for(let u=0,p=a.length;ue?ii(e)?ss(e):Os(e.parent):null,dn=_e(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Os(e.parent),$root:e=>Os(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ho(e),$forceUpdate:e=>e.f||(e.f=()=>{Ys(e.update)}),$nextTick:e=>e.n||(e.n=Qs.bind(e.proxy)),$watch:e=>pl.bind(e)}),ds=(e,t)=>e!==re&&!e.__isScriptSetup&&Z(e,t),Pl={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:o,accessCache:i,type:a,appContext:u}=e;if(t[0]!=="$"){const g=i[t];if(g!==void 0)switch(g){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return o[t]}else{if(ds(s,t))return i[t]=1,s[t];if(r!==re&&Z(r,t))return i[t]=2,r[t];if(Z(o,t))return i[t]=3,o[t];if(n!==re&&Z(n,t))return i[t]=4,n[t];Ts&&(i[t]=0)}}const p=dn[t];let f,h;if(p)return t==="$attrs"&&we(e.attrs,"get",""),p(e);if((f=a.__cssModules)&&(f=f[t]))return f;if(n!==re&&Z(n,t))return i[t]=4,n[t];if(h=u.config.globalProperties,Z(h,t))return h[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:o}=e;return ds(r,t)?(r[t]=n,!0):s!==re&&Z(s,t)?(s[t]=n,!0):Z(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,props:o,type:i}},a){let u;return!!(n[a]||e!==re&&a[0]!=="$"&&Z(e,a)||ds(t,a)||Z(o,a)||Z(s,a)||Z(dn,a)||Z(r.config.globalProperties,a)||(u=i.__cssModules)&&u[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Z(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function mr(e){return K(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ts=!0;function Il(e){const t=Ho(e),n=e.proxy,s=e.ctx;Ts=!1,t.beforeCreate&&vr(t.beforeCreate,e,"bc");const{data:r,computed:o,methods:i,watch:a,provide:u,inject:p,created:f,beforeMount:h,mounted:g,beforeUpdate:v,updated:M,activated:E,deactivated:C,beforeDestroy:R,beforeUnmount:I,destroyed:V,unmounted:D,render:q,renderTracked:oe,renderTriggered:U,errorCaptured:Ie,serverPrefetch:je,expose:Le,inheritAttrs:ze,components:ct,directives:Ue,filters:Pt}=t;if(p&&Nl(p,s,null),i)for(const z in i){const B=i[z];W(B)&&(s[z]=B.bind(n))}if(r){const z=r.call(n,n);ee(z)&&(e.data=Yn(z))}if(Ts=!0,o)for(const z in o){const B=o[z],Fe=W(B)?B.bind(n,n):W(B.get)?B.get.bind(n,n):lt,Ne=!W(B)&&W(B.set)?B.set.bind(n):lt,He=De({get:Fe,set:Ne});Object.defineProperty(s,z,{enumerable:!0,configurable:!0,get:()=>He.value,set:xe=>He.value=xe})}if(a)for(const z in a)Fo(a[z],s,n,z);if(u){const z=W(u)?u.call(n):u;Reflect.ownKeys(z).forEach(B=>{In(B,z[B])})}f&&vr(f,e,"c");function ae(z,B){K(B)?B.forEach(Fe=>z(Fe.bind(n))):B&&z(B.bind(n))}if(ae(bl,h),ae(tr,g),ae(_l,v),ae(xl,M),ae(ml,E),ae(vl,C),ae(Sl,Ie),ae(Al,oe),ae(Cl,U),ae(wl,I),ae(Uo,D),ae(El,je),K(Le))if(Le.length){const z=e.exposed||(e.exposed={});Le.forEach(B=>{Object.defineProperty(z,B,{get:()=>n[B],set:Fe=>n[B]=Fe,enumerable:!0})})}else e.exposed||(e.exposed={});q&&e.render===lt&&(e.render=q),ze!=null&&(e.inheritAttrs=ze),ct&&(e.components=ct),Ue&&(e.directives=Ue),je&&jo(e)}function Nl(e,t,n=lt){K(e)&&(e=Ps(e));for(const s in e){const r=e[s];let o;ee(r)?"default"in r?o=at(r.from||s,r.default,!0):o=at(r.from||s):o=at(r),Ae(o)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[s]=o}}function vr(e,t,n){We(K(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Fo(e,t,n,s){let r=s.includes(".")?Do(n,s):()=>n[s];if(fe(e)){const o=t[e];W(o)&&Nn(r,o)}else if(W(e))Nn(r,e.bind(n));else if(ee(e))if(K(e))e.forEach(o=>Fo(o,t,n,s));else{const o=W(e.handler)?e.handler.bind(n):t[e.handler];W(o)&&Nn(r,o,e)}}function Ho(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,a=o.get(t);let u;return a?u=a:!r.length&&!n&&!s?u=t:(u={},r.length&&r.forEach(p=>Un(u,p,i,!0)),Un(u,t,i)),ee(t)&&o.set(t,u),u}function Un(e,t,n,s=!1){const{mixins:r,extends:o}=t;o&&Un(e,o,n,!0),r&&r.forEach(i=>Un(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const a=kl[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const kl={data:yr,props:br,emits:br,methods:rn,computed:rn,beforeCreate:Se,created:Se,beforeMount:Se,mounted:Se,beforeUpdate:Se,updated:Se,beforeDestroy:Se,beforeUnmount:Se,destroyed:Se,unmounted:Se,activated:Se,deactivated:Se,errorCaptured:Se,serverPrefetch:Se,components:rn,directives:rn,watch:Ml,provide:yr,inject:Dl};function yr(e,t){return t?e?function(){return _e(W(e)?e.call(this,this):e,W(t)?t.call(this,this):t)}:t:e}function Dl(e,t){return rn(Ps(e),Ps(t))}function Ps(e){if(K(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Te(t)}Modifiers`]||e[`${Ut(t)}Modifiers`];function Ul(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||re;let r=n;const o=t.startsWith("update:"),i=o&&Ll(s,t.slice(7));i&&(i.trim&&(r=n.map(f=>fe(f)?f.trim():f)),i.number&&(r=n.map(zn)));let a,u=s[a=is(t)]||s[a=is(Te(t))];!u&&o&&(u=s[a=is(Ut(t))]),u&&We(u,e,6,r);const p=s[a+"Once"];if(p){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,We(p,e,6,r)}}const Fl=new WeakMap;function $o(e,t,n=!1){const s=n?Fl:t.emitsCache,r=s.get(e);if(r!==void 0)return r;const o=e.emits;let i={},a=!1;if(!W(e)){const u=p=>{const f=$o(p,t,!0);f&&(a=!0,_e(i,f))};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!o&&!a?(ee(e)&&s.set(e,null),null):(K(o)?o.forEach(u=>i[u]=null):_e(i,o),ee(e)&&s.set(e,i),i)}function ts(e,t){return!e||!Kn(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Z(e,t[0].toLowerCase()+t.slice(1))||Z(e,Ut(t))||Z(e,t))}function _r(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[o],slots:i,attrs:a,emit:u,render:p,renderCache:f,props:h,data:g,setupState:v,ctx:M,inheritAttrs:E}=e,C=jn(e);let R,I;try{if(n.shapeFlag&4){const D=r||s,q=D;R=st(p.call(q,D,f,h,v,g,M)),I=a}else{const D=t;R=st(D.length>1?D(h,{attrs:a,slots:i,emit:u}):D(h,null)),I=t.props?a:Hl(a)}}catch(D){Lt.length=0,Xn(D,e,1),R=Ce(xt)}let V=R;if(I&&E!==!1){const D=Object.keys(I),{shapeFlag:q}=V;D.length&&q&7&&(o&&D.some(Gn)&&(I=Bl(I,o)),V=zt(V,I,!1,!0))}if(n.dirs&&(V=zt(V,null,!1,!0),V.dirs=V.dirs?V.dirs.concat(n.dirs):n.dirs),n.transition){const D=Zn(V.type)&&Mo(V)||V;Zs(D,n.transition)}return R=V,jn(C),R}const Hl=e=>{let t;for(const n in e)(n==="class"||n==="style"||Kn(n))&&((t||(t={}))[n]=e[n]);return t},Bl=(e,t)=>{const n={};for(const s in e)(!Gn(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function $l(e,t,n){const{props:s,children:r,component:o}=e,{props:i,children:a,patchFlag:u}=t,p=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&u>=0){if(u&1024)return!0;if(u&16)return s?xr(s,i,p):!!i;if(u&8){const f=t.dynamicProps;for(let h=0;hObject.create(Go),qo=e=>Object.getPrototypeOf(e)===Go;function Gl(e,t,n,s=!1){const r={},o=Wo();e.propsDefaults=Object.create(null),zo(e,t,r,o);for(const i in e.propsOptions[0])i in r||(r[i]=void 0);n?e.props=s?r:Ao(r):e.type.props?e.props=r:e.props=o,e.attrs=o}function Wl(e,t,n,s){const{props:r,attrs:o,vnode:{patchFlag:i}}=e,a=X(r),[u]=e.propsOptions;let p=!1;if((s||i>0)&&!(i&16)){if(i&8){const f=e.vnode.dynamicProps;for(let h=0;h{u=!0;const[g,v]=Jo(h,t,!0);_e(i,g),v&&a.push(...v)};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!o&&!u)return ee(e)&&s.set(e,$t),$t;if(K(o))for(let f=0;fe==="_"||e==="_ctx"||e==="$stable",sr=e=>K(e)?e.map(st):[st(e)],zl=(e,t,n)=>{if(t._n)return t;const s=Xs((...r)=>sr(t(...r)),n);return s._c=!1,s},Qo=(e,t,n)=>{const s=e._ctx;for(const r in e){if(nr(r))continue;const o=e[r];if(W(o))t[r]=zl(r,o,s);else if(o!=null){const i=sr(o);t[r]=()=>i}}},Yo=(e,t)=>{const n=sr(t);e.slots.default=()=>n},Xo=(e,t,n)=>{for(const s in t)(n||!nr(s))&&(e[s]=t[s])},Jl=(e,t,n)=>{const s=e.slots=Wo();if(e.vnode.shapeFlag&32){const r=t._;r?(Xo(s,t,n),n&&io(s,"_",r,!0)):Qo(t,s)}else t&&Yo(e,t)},Ql=(e,t,n)=>{const{vnode:s,slots:r}=e;let o=!0,i=re;if(s.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:Xo(r,t,n):(o=!t.$stable,Qo(t,r)),i=t}else t&&(Yo(e,t),i={default:1});if(o)for(const a in r)!nr(a)&&i[a]==null&&delete r[a]},Pe=ta;function Yl(e){return Xl(e)}function Xl(e,t){const n=Jn();n.__VUE__=!0;const{insert:s,remove:r,patchProp:o,createElement:i,createText:a,createComment:u,setText:p,setElementText:f,parentNode:h,nextSibling:g,setScopeId:v=lt,insertStaticContent:M}=e,E=(l,d,c,y=null,x=null,b=null,T=void 0,O=null,S=!!d.dynamicChildren)=>{if(l===d)return;l&&!nn(l,d)&&(y=_(l),xe(l,x,b,!0),l=null),d.patchFlag===-2&&(S=!1,d.dynamicChildren=null);const{type:w,ref:$,shapeFlag:k}=d;switch(w){case ns:C(l,d,c,y);break;case xt:R(l,d,c,y);break;case hs:l==null&&I(d,c,y,T);break;case he:ct(l,d,c,y,x,b,T,O,S);break;default:k&1?q(l,d,c,y,x,b,T,O,S):k&6?Ue(l,d,c,y,x,b,T,O,S):(k&64||k&128)&&w.process(l,d,c,y,x,b,T,O,S,j)}$!=null&&x?cn($,l&&l.ref,b,d||l,!d):$==null&&l&&l.ref!=null&&cn(l.ref,null,b,l,!0)},C=(l,d,c,y)=>{if(l==null)s(d.el=a(d.children),c,y);else{const x=d.el=l.el;d.children!==l.children&&p(x,d.children)}},R=(l,d,c,y)=>{l==null?s(d.el=u(d.children||""),c,y):d.el=l.el},I=(l,d,c,y)=>{[l.el,l.anchor]=M(l.children,d,c,y,l.el,l.anchor)},V=({el:l,anchor:d},c,y)=>{let x;for(;l&&l!==d;)x=g(l),s(l,c,y),l=x;s(d,c,y)},D=({el:l,anchor:d})=>{let c;for(;l&&l!==d;)c=g(l),r(l),l=c;r(d)},q=(l,d,c,y,x,b,T,O,S)=>{if(d.type==="svg"?T="svg":d.type==="math"&&(T="mathml"),l==null)oe(d,c,y,x,b,T,O,S);else{const w=l.el&&l.el._isVueCE?l.el:null;try{w&&w._beginPatch(),je(l,d,x,b,T,O,S)}finally{w&&w._endPatch()}}},oe=(l,d,c,y,x,b,T,O)=>{let S,w;const{props:$,shapeFlag:k,transition:F,dirs:G}=l;if(S=l.el=i(l.type,b,$&&$.is,$),k&8?f(S,l.children):k&16&&Ie(l.children,S,null,y,x,ps(l,b),T,O),G&&It(l,null,y,"created"),U(S,l,l.scopeId,T,y),$){for(const se in $)se!=="value"&&!ln(se)&&o(S,se,null,$[se],b,y);"value"in $&&o(S,"value",null,$.value,b),(w=$.onVnodeBeforeMount)&&Xe(w,y,l)}G&&It(l,null,y,"beforeMount");const J=Zl(x,F);J&&F.beforeEnter(S),s(S,d,c),((w=$&&$.onVnodeMounted)||J||G)&&Pe(()=>{try{w&&Xe(w,y,l),J&&F.enter(S),G&&It(l,null,y,"mounted")}finally{}},x)},U=(l,d,c,y,x)=>{if(c&&v(l,c),y)for(let b=0;b{for(let w=S;w{const O=d.el=l.el;let{patchFlag:S,dynamicChildren:w,dirs:$}=d;S|=l.patchFlag&16;const k=l.props||re,F=d.props||re;let G;if(c&&Nt(c,!1),(G=F.onVnodeBeforeUpdate)&&Xe(G,c,d,l),$&&It(d,l,c,"beforeUpdate"),c&&Nt(c,!0),w&&(!l.dynamicChildren||l.dynamicChildren.length!==w.length)&&(S=0,T=!1,w=null),(k.innerHTML&&F.innerHTML==null||k.textContent&&F.textContent==null)&&f(O,""),w?Le(l.dynamicChildren,w,O,c,y,ps(d,x),b):T||B(l,d,O,null,c,y,ps(d,x),b,!1),S>0){if(S&16)ze(O,k,F,c,x);else if(S&2&&k.class!==F.class&&o(O,"class",null,F.class,x),S&4&&o(O,"style",k.style,F.style,x),S&8){const J=d.dynamicProps;for(let se=0;se{G&&Xe(G,c,d,l),$&&It(d,l,c,"updated")},y)},Le=(l,d,c,y,x,b,T)=>{for(let O=0;O{if(d!==c){if(d!==re)for(const b in d)!ln(b)&&!(b in c)&&o(l,b,d[b],null,x,y);for(const b in c){if(ln(b))continue;const T=c[b],O=d[b];T!==O&&b!=="value"&&o(l,b,O,T,x,y)}"value"in c&&o(l,"value",d.value,c.value,x)}},ct=(l,d,c,y,x,b,T,O,S)=>{const w=d.el=l?l.el:a(""),$=d.anchor=l?l.anchor:a("");let{patchFlag:k,dynamicChildren:F,slotScopeIds:G}=d;G&&(O=O?O.concat(G):G),l==null?(s(w,c,y),s($,c,y),Ie(d.children||[],c,$,x,b,T,O,S)):k>0&&k&64&&F&&l.dynamicChildren&&l.dynamicChildren.length===F.length?(Le(l.dynamicChildren,F,c,x,b,T,O),(d.key!=null||x&&d===x.subTree)&&Zo(l,d,!0)):B(l,d,c,$,x,b,T,O,S)},Ue=(l,d,c,y,x,b,T,O,S)=>{d.slotScopeIds=O,l==null?d.shapeFlag&512?x.ctx.activate(d,c,y,T,S):Pt(d,c,y,x,b,T,S):Et(l,d,S)},Pt=(l,d,c,y,x,b,T)=>{const O=l.component=aa(l,y,x);if(er(l)&&(O.ctx.renderer=j),ca(O,!1,T),O.asyncDep){if(x&&x.registerDep(O,ae,T),!l.el){const S=O.subTree=Ce(xt);R(null,S,d,c),l.placeholder=S.el}}else ae(O,l,d,c,x,b,T)},Et=(l,d,c)=>{const y=d.component=l.component;if($l(l,d,c))if(y.asyncDep&&!y.asyncResolved){z(y,d,c);return}else y.next=d,y.update();else d.el=l.el,y.vnode=d},ae=(l,d,c,y,x,b,T)=>{const O=()=>{if(l.isMounted){let{next:k,bu:F,u:G,parent:J,vnode:se}=l;{const Qe=ei(l);if(Qe){k&&(k.el=se.el,z(l,k,T)),Qe.asyncDep.then(()=>{Pe(()=>{l.isUnmounted||w()},x)});return}}let te=k,de;Nt(l,!1),k?(k.el=se.el,z(l,k,T)):k=se,F&&Pn(F),(de=k.props&&k.props.onVnodeBeforeUpdate)&&Xe(de,J,k,se),Nt(l,!0);const ye=_r(l),Je=l.subTree;l.subTree=ye,E(Je,ye,h(Je.el),_(Je),l,x,b),k.el=ye.el,te===null&&Kl(l,ye.el),G&&Pe(G,x),(de=k.props&&k.props.onVnodeUpdated)&&Pe(()=>Xe(de,J,k,se),x)}else{let k;const{el:F,props:G}=d,{bm:J,m:se,parent:te,root:de,type:ye}=l,Je=fn(d);Nt(l,!1),J&&Pn(J),!Je&&(k=G&&G.onVnodeBeforeMount)&&Xe(k,te,d),Nt(l,!0);{de.ce&&de.ce._hasShadowRoot()&&de.ce._injectChildStyle(ye,l.parent?l.parent.type:void 0);const Qe=l.subTree=_r(l);E(null,Qe,c,y,l,x,b),d.el=Qe.el}if(se&&Pe(se,x),!Je&&(k=G&&G.onVnodeMounted)){const Qe=d;Pe(()=>Xe(k,te,Qe),x)}(d.shapeFlag&256||te&&fn(te.vnode)&&te.vnode.shapeFlag&256)&&l.a&&Pe(l.a,x),l.isMounted=!0,d=c=y=null}};l.scope.on();const S=l.effect=new co(O);l.scope.off();const w=l.update=S.run.bind(S),$=l.job=S.runIfDirty.bind(S);$.i=l,$.id=l.uid,S.scheduler=()=>Ys($),Nt(l,!0),w()},z=(l,d,c)=>{d.component=l;const y=l.vnode.props;l.vnode=d,l.next=null,Wl(l,d.props,y,c),Ql(l,d.children,c),yt(),dr(l),bt()},B=(l,d,c,y,x,b,T,O,S=!1)=>{const w=l&&l.children,$=l?l.shapeFlag:0,k=d.children,{patchFlag:F,shapeFlag:G}=d;if(F>0){if(F&128){Ne(w,k,c,y,x,b,T,O,S);return}else if(F&256){Fe(w,k,c,y,x,b,T,O,S);return}}G&8?($&16&&ve(w,x,b),k!==w&&f(c,k)):$&16?G&16?Ne(w,k,c,y,x,b,T,O,S):ve(w,x,b,!0):($&8&&f(c,""),G&16&&Ie(k,c,y,x,b,T,O,S))},Fe=(l,d,c,y,x,b,T,O,S)=>{l=l||$t,d=d||$t;const w=l.length,$=d.length,k=Math.min(w,$);let F;for(F=0;F$?ve(l,x,b,!0,!1,k):Ie(d,c,y,x,b,T,O,S,k)},Ne=(l,d,c,y,x,b,T,O,S)=>{let w=0;const $=d.length;let k=l.length-1,F=$-1;for(;w<=k&&w<=F;){const G=l[w],J=d[w]=S?gt(d[w]):st(d[w]);if(nn(G,J))E(G,J,c,null,x,b,T,O,S);else break;w++}for(;w<=k&&w<=F;){const G=l[k],J=d[F]=S?gt(d[F]):st(d[F]);if(nn(G,J))E(G,J,c,null,x,b,T,O,S);else break;k--,F--}if(w>k){if(w<=F){const G=F+1,J=G<$?d[G].el:y;for(;w<=F;)E(null,d[w]=S?gt(d[w]):st(d[w]),c,J,x,b,T,O,S),w++}}else if(w>F)for(;w<=k;)xe(l[w],x,b,!0),w++;else{const G=w,J=w,se=new Map;for(w=J;w<=F;w++){const ke=d[w]=S?gt(d[w]):st(d[w]);ke.key!=null&&se.set(ke.key,w)}let te,de=0;const ye=F-J+1;let Je=!1,Qe=0;const en=new Array(ye);for(w=0;w=ye){xe(ke,x,b,!0);continue}let Ye;if(ke.key!=null)Ye=se.get(ke.key);else for(te=J;te<=F;te++)if(en[te-J]===0&&nn(ke,d[te])){Ye=te;break}Ye===void 0?xe(ke,x,b,!0):(en[Ye-J]=w+1,Ye>=Qe?Qe=Ye:Je=!0,E(ke,d[Ye],c,null,x,b,T,O,S),de++)}const or=Je?ea(en):$t;for(te=or.length-1,w=ye-1;w>=0;w--){const ke=J+w,Ye=d[ke],ir=d[ke+1],lr=ke+1<$?ir.el||ti(ir):y;en[w]===0?E(null,Ye,c,lr,x,b,T,O,S):Je&&(te<0||w!==or[te]?He(Ye,c,lr,2):te--)}}},He=(l,d,c,y,x=null)=>{const{el:b,type:T,transition:O,children:S,shapeFlag:w}=l;if(w&6){He(l.component.subTree,d,c,y);return}if(w&128){l.suspense.move(d,c,y);return}if(w&64){T.move(l,d,c,j);return}if(T===he){s(b,d,c);for(let k=0;kO.enter(b),x));else{const{leave:k,delayLeave:F,afterLeave:G}=O,J=()=>{l.ctx.isUnmounted?r(b):s(b,d,c)},se=()=>{const te=b._isLeaving||!!b[fs];b._isLeaving&&b[fs](!0),O.persisted&&!te?J():k(b,()=>{J(),G&&G()})};F?F(b,J,se):se()}else s(b,d,c)},xe=(l,d,c,y=!1,x=!1)=>{const{type:b,props:T,ref:O,children:S,dynamicChildren:w,shapeFlag:$,patchFlag:k,dirs:F,cacheIndex:G,memo:J}=l;if(k===-2&&(x=!1),O!=null&&(yt(),cn(O,null,c,l,!0),bt()),G!=null&&(d.renderCache[G]=void 0),$&256){d.ctx.deactivate(l);return}const se=$&1&&F,te=!fn(l);let de;if(te&&(de=T&&T.onVnodeBeforeUnmount)&&Xe(de,d,l),$&6)ft(l.component,c,y);else{if($&128){l.suspense.unmount(c,y);return}se&&It(l,null,d,"beforeUnmount"),$&64?l.type.remove(l,d,c,j,y):w&&!w.hasOnce&&(b!==he||k>0&&k&64)?ve(w,d,c,!1,!0):(b===he&&k&384||!x&&$&16)&&ve(S,d,c),y&&Ct(l)}const ye=J!=null&&G==null;(te&&(de=T&&T.onVnodeUnmounted)||se||ye)&&Pe(()=>{de&&Xe(de,d,l),se&&It(l,null,d,"unmounted"),ye&&(l.el=null)},c)},Ct=l=>{const{type:d,el:c,anchor:y,transition:x}=l;if(d===he){At(c,y);return}if(d===hs){D(l);return}const b=()=>{r(c),x&&!x.persisted&&x.afterLeave&&x.afterLeave()};if(l.shapeFlag&1&&x&&!x.persisted){const{leave:T,delayLeave:O}=x,S=()=>T(c,b);O?O(l.el,b,S):S()}else b()},At=(l,d)=>{let c;for(;l!==d;)c=g(l),r(l),l=c;r(d)},ft=(l,d,c)=>{const{bum:y,scope:x,job:b,subTree:T,um:O,m:S,a:w}=l;Er(S),Er(w),y&&Pn(y),x.stop(),b&&(b.flags|=8,xe(T,l,d,c)),O&&Pe(O,d),Pe(()=>{l.isUnmounted=!0},d)},ve=(l,d,c,y=!1,x=!1,b=0)=>{for(let T=b;T{if(l.shapeFlag&6)return _(l.component.subTree);if(l.shapeFlag&128)return l.suspense.next();const d=g(l.anchor||l.el),c=d&&d[hl];return c?g(c):d};let N=!1;const P=(l,d,c)=>{let y;l==null?d._vnode&&(xe(d._vnode,null,null,!0),y=d._vnode.component):E(d._vnode||null,l,d,null,null,null,c),d._vnode=l,N||(N=!0,dr(y),Po(),N=!1)},j={p:E,um:xe,m:He,r:Ct,mt:Pt,mc:Ie,pc:B,pbc:Le,n:_,o:e};return{render:P,hydrate:void 0,createApp:jl(P)}}function ps({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Nt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Zl(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Zo(e,t,n=!1){const s=e.children,r=t.children;if(K(s)&&K(r))for(let o=0;o>1,e[n[a]]0&&(t[s]=n[o-1]),n[o]=s)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function ei(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ei(t)}function Er(e){if(e)for(let t=0;te.__isSuspense;function ta(e,t){t&&t.pendingBranch?K(e)?t.effects.push(...e):t.effects.push(e):cl(e)}const he=Symbol.for("v-fgt"),ns=Symbol.for("v-txt"),xt=Symbol.for("v-cmt"),hs=Symbol.for("v-stc"),Lt=[];let Ve=null;function L(e=!1){Lt.push(Ve=e?null:[])}function si(){Lt.pop(),Ve=Lt[Lt.length-1]||null}let vn=1;function Fn(e,t=!1){vn+=e,e<0&&Ve&&t&&(Ve.hasOnce=!0)}function ri(e){return e.dynamicChildren=vn>0?Ve||$t:null,si(),vn>0&&Ve&&Ve.push(e),e}function H(e,t,n,s,r,o){return ri(m(e,t,n,s,r,o,!0))}function na(e,t,n,s,r){return ri(Ce(e,t,n,s,r,!0))}function Hn(e){return e?e.__v_isVNode===!0:!1}function nn(e,t){return e.type===t.type&&e.key===t.key}const oi=({key:e})=>e??null,kn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?fe(e)||Ae(e)||W(e)?{i:Me,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,s=0,r=null,o=e===he?0:1,i=!1,a=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&oi(t),ref:t&&kn(t),scopeId:No,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Me};return a?(Bn(u,n),o&128&&e.normalize(u)):n&&(u.shapeFlag|=fe(n)?8:16),vn>0&&!i&&Ve&&(u.patchFlag>0||o&6)&&u.patchFlag!==32&&Ve.push(u),u}const Ce=sa;function sa(e,t=null,n=null,s=0,r=null,o=!1){if((!e||e===Ol)&&(e=xt),Hn(e)){const a=zt(e,t,!0);return n&&Bn(a,n),vn>0&&!o&&Ve&&(a.shapeFlag&6?Ve[Ve.indexOf(e)]=a:Ve.push(a)),a.patchFlag=-2,a}if(ga(e)&&(e=e.__vccOpts),t){t=ra(t);let{class:a,style:u}=t;a&&!fe(a)&&(t.class=tt(a)),ee(u)&&(Js(u)&&!K(u)&&(u=_e({},u)),t.style=Hs(u))}const i=fe(e)?1:ni(e)?128:Zn(e)?64:ee(e)?4:W(e)?2:0;return m(e,t,n,s,r,i,o,!0)}function ra(e){return e?Js(e)||qo(e)?_e({},e):e:null}function zt(e,t,n=!1,s=!1){const{props:r,ref:o,patchFlag:i,children:a,transition:u}=e,p=t?oa(r||{},t):r,f={__v_isVNode:!0,__v_skip:!0,type:e.type,props:p,key:p&&oi(p),ref:t&&t.ref?n&&o?K(o)?o.concat(kn(t)):[o,kn(t)]:kn(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==he?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&zt(e.ssContent),ssFallback:e.ssFallback&&zt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&s&&Zs(f,u.clone(f)),f}function $e(e=" ",t=0){return Ce(ns,null,e,t)}function ue(e="",t=!1){return t?(L(),na(xt,null,e)):Ce(xt,null,e)}function st(e){return e==null||typeof e=="boolean"?Ce(xt):K(e)?Ce(he,null,e.slice()):Hn(e)?gt(e):Ce(ns,null,String(e))}function gt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:zt(e)}function Bn(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(K(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),Bn(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!qo(t)?t._ctx=Me:r===3&&Me&&(Me.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(W(t)){if(s&65){Bn(e,{default:t});return}t={default:t,_ctx:Me},n=32}else t=String(t),s&64?(n=16,t=[$e(t)]):n=8;e.children=t,e.shapeFlag|=n}function oa(...e){const t={};for(let n=0;nEe||Me;let $n,yn;{const e=Jn(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),o=>{r.length>1?r.forEach(i=>i(o)):r[0](o)}};$n=t("__VUE_INSTANCE_SETTERS__",n=>Ee=n),yn=t("__VUE_SSR_SETTERS__",n=>bn=n)}const Cn=e=>{const t=Ee;return $n(e),e.scope.on(),()=>{e.scope.off(),$n(t)}},Cr=()=>{Ee&&Ee.scope.off(),$n(null)};function ii(e){return e.vnode.shapeFlag&4}let bn=!1;function ca(e,t=!1,n=!1){t&&yn(t);const{props:s,children:r}=e.vnode,o=ii(e);Gl(e,s,o,t),Jl(e,r,n||t);const i=o?fa(e,t):void 0;return t&&yn(!1),i}function fa(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Pl);const{setup:s}=n;if(s){yt();const r=e.setupContext=s.length>1?pa(e):null,o=Cn(e),i=En(s,e,0,[e.props,r]),a=so(i);if(bt(),o(),(a||e.sp)&&!fn(e)&&jo(e),a){if(i.then(Cr,Cr),t)return i.then(u=>{yn(!0);try{Ar(e,u,t)}finally{yn(!1)}}).catch(u=>{Xn(u,e,0)});e.asyncDep=i}else Ar(e,i)}else li(e)}function Ar(e,t,n){W(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ee(t)&&(e.setupState=Ro(t)),li(e)}function li(e,t,n){const s=e.type;e.render||(e.render=s.render||lt);{const r=Cn(e);yt();try{Il(e)}finally{bt(),r()}}}const da={get(e,t){return we(e,"get",""),e[t]}};function pa(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,da),slots:e.slots,emit:e.emit,expose:t}}function ss(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ro(el(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in dn)return dn[n](e)},has(t,n){return n in t||n in dn}})):e.proxy}function ha(e,t=!0){return W(e)?e.displayName||e.name:e.name||t&&e.__name}function ga(e){return W(e)&&"__vccOpts"in e}const De=(e,t)=>ol(e,t,bn);function ai(e,t,n){try{Fn(-1);const s=arguments.length;return s===2?ee(t)&&!K(t)?Hn(t)?Ce(e,null,[t]):Ce(e,t):Ce(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Hn(n)&&(n=[n]),Ce(e,t,n))}finally{Fn(1)}}const ma="3.5.41";/** -* @vue/runtime-dom v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Ns;const Sr=typeof window<"u"&&window.trustedTypes;if(Sr)try{Ns=Sr.createPolicy("vue",{createHTML:e=>e})}catch{}const ui=Ns?e=>Ns.createHTML(e):e=>e,va="http://www.w3.org/2000/svg",ya="http://www.w3.org/1998/Math/MathML",ht=typeof document<"u"?document:null,Rr=ht&&ht.createElement("template"),ba={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?ht.createElementNS(va,e):t==="mathml"?ht.createElementNS(ya,e):n?ht.createElement(e,{is:n}):ht.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>ht.createTextNode(e),createComment:e=>ht.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ht.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,o){const i=n?n.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===o||!(r=r.nextSibling)););else{Rr.innerHTML=ui(s==="svg"?`${e}`:s==="mathml"?`${e}`:e);const a=Rr.content;if(s==="svg"||s==="mathml"){const u=a.firstChild;for(;u.firstChild;)a.appendChild(u.firstChild);a.removeChild(u)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},_a=Symbol("_vtc");function xa(e,t,n){const s=e[_a];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Or=Symbol("_vod"),wa=Symbol("_vsh"),Ea=Symbol(""),Ca=/(?:^|;)\s*display\s*:/;function Aa(e,t,n){const s=e.style,r=fe(n);let o=!1;if(n&&!r){if(t)if(fe(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&on(s,a,"")}else for(const i in t)n[i]==null&&on(s,i,"");for(const i in n){i==="display"&&(o=!0);const a=n[i];a!=null?Ra(e,i,!fe(t)&&t?t[i]:void 0,a)||on(s,i,a):on(s,i,"")}}else if(r){if(t!==n){const i=s[Ea];i&&(n+=";"+i),s.cssText=n,o=Ca.test(n)}}else t&&e.removeAttribute("style");Or in e&&(e[Or]=o?s.display:"",e[wa]&&(s.display="none"))}const Tr=/\s*!important$/;function on(e,t,n){if(K(n))n.forEach(s=>on(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Sa(e,t);Tr.test(n)?e.setProperty(Ut(s),n.replace(Tr,""),"important"):e[s]=n}}const Pr=["Webkit","Moz","ms"],gs={};function Sa(e,t){const n=gs[t];if(n)return n;let s=Te(t);if(s!=="filter"&&s in e)return gs[t]=s;s=qn(s);for(let r=0;rms||(ka.then(()=>ms=0),ms=Date.now());function Ma(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const r=n.value;if(K(r)){const o=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{o.call(s),s._stopped=!0};const i=r.slice(),a=[s];for(let u=0;ue.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Va=(e,t,n,s,r,o)=>{const i=r==="svg";t==="class"?xa(e,s,i):t==="style"?Aa(e,n,s):Kn(t)?Gn(t)||Ta(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ja(e,t,s,i))?(kr(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Nr(e,t,s,i,o,t!=="value")):e._isVueCE&&(La(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!fe(s)))?kr(e,Te(t),s,o,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Nr(e,t,s,i))};function ja(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Mr(t)&&W(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Mr(t)&&fe(n)?!1:t in e}function La(e,t){const n=e._def.props;if(!n)return!1;const s=Te(t);return Array.isArray(n)?n.some(r=>Te(r)===s):Object.keys(n).some(r=>Te(r)===s)}const Jt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return K(t)?n=>Pn(t,n):t};function Ua(e){e.target.composing=!0}function Vr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const it=Symbol("_assign"),On=Symbol("_initialValue");function vs(e,t,n){return t&&(e=e.trim()),n&&(e=zn(e)),e}const me={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e.parentNode&&(e.type==="text"?e[On]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[On]=e.defaultValue.replace(/\r\n?/g,` -`))),e[it]=Jt(r);const o=s||r.props&&r.props.type==="number";Tt(e,t?"change":"input",i=>{i.target.composing||e[it](vs(e.value,n,o))}),(n||o)&&Tt(e,"change",()=>{e.value=vs(e.value,n,o)}),t||(Tt(e,"compositionstart",Ua),Tt(e,"compositionend",Vr),Tt(e,"change",Vr))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const r=t??"",o=e[On];delete e[On],o!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==o?e[it](vs(e.value,n,s)):e.value=r},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:o}},i){if(e[it]=Jt(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?zn(e.value):e.value,u=t??"";if(a===u)return;const p=e.getRootNode();(p instanceof Document||p instanceof ShadowRoot)&&p.activeElement===e&&e.type!=="range"&&(s&&t===n||r&&e.value.trim()===u)||(e.value=u)}},Dn={deep:!0,created(e,t,n){e[it]=Jt(n),Tt(e,"change",()=>{const s=e._modelValue,r=_n(e),o=e.checked,i=e[it];if(K(s)){const a=Bs(s,r),u=a!==-1;if(o&&!u)i(s.concat(r));else if(!o&&u){const p=[...s];p.splice(a,1),i(p)}}else if(Xt(s)){const a=new Set(s);o?a.add(r):a.delete(r),i(a)}else i(ci(e,o))})},mounted:jr,beforeUpdate(e,t,n){e[it]=Jt(n),jr(e,t,n)}};function jr(e,{value:t,oldValue:n},s){e._modelValue=t;let r;if(K(t))r=Bs(t,s.props.value)>-1;else if(Xt(t))r=t.has(s.props.value);else{if(t===n)return;r=Zt(t,ci(e,!0))}e.checked!==r&&(e.checked=r)}const ks={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,Tt(e,"change",()=>{const r=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?zn(_n(o)):_n(o));e[it](e.multiple?Xt(e._modelValue)?new Set(r):r:r[0]),e._assigning=!0,Qs(()=>{e._assigning=!1})}),e[it]=Jt(s)},mounted(e,{value:t}){Lr(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[it]=Jt(n)},updated(e,{value:t}){e._assigning||Lr(e,t)}};function Lr(e,t){const n=e.multiple,s=K(t);if(!(n&&!s&&!Xt(t))){for(let r=0,o=e.options.length;rString(p)===String(a)):i.selected=Bs(t,a)>-1}else i.selected=t.has(a);else if(Zt(_n(i),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function _n(e){return"_value"in e?e._value:e.value}function ci(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Fa=["ctrl","shift","alt","meta"],Ha={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Fa.some(n=>e[`${n}Key`]&&!t.includes(n))},rt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((r,...o)=>{for(let i=0;i{const t=$a().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=Wa(s);if(!r)return;const o=t._component;!W(o)&&!o.render&&!o.template&&(o.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const i=n(r,!1,Ga(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),i},t});function Ga(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Wa(e){return fe(e)?document.querySelector(e):e}const qa=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},za={},Ja={class:"min-h-screen"},Qa={class:"bg-white border-b border-gray-200"},Ya={class:"max-w-6xl mx-auto px-6 py-4 flex items-center justify-between"},Xa={class:"max-w-6xl mx-auto px-6 py-8"};function Za(e,t){const n=Rs("router-link"),s=Rs("router-view");return L(),H("div",Ja,[m("header",Qa,[m("div",Ya,[Ce(n,{to:"/",class:"text-lg font-semibold text-gray-800"},{default:Xs(()=>[...t[0]||(t[0]=[$e(" uMind ",-1),m("span",{class:"text-brand"},"Orquestador",-1)])]),_:1}),t[1]||(t[1]=m("a",{href:"/app/dashboard",class:"text-sm text-gray-500 hover:text-gray-700"}," ← Volver al panel ",-1))])]),m("main",Xa,[Ce(s)])])}const eu=qa(za,[["render",Za]]);/*! - * vue-router v4.6.4 - * (c) 2025 Eduardo San Martin Morote - * @license MIT - */const Bt=typeof document<"u";function fi(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function tu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&fi(e.default)}const Y=Object.assign;function ys(e,t){const n={};for(const s in t){const r=t[s];n[s]=qe(r)?r.map(e):e(r)}return n}const pn=()=>{},qe=Array.isArray;function Fr(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const di=/#/g,nu=/&/g,su=/\//g,ru=/=/g,ou=/\?/g,pi=/\+/g,iu=/%5B/g,lu=/%5D/g,hi=/%5E/g,au=/%60/g,gi=/%7B/g,uu=/%7C/g,mi=/%7D/g,cu=/%20/g;function rr(e){return e==null?"":encodeURI(""+e).replace(uu,"|").replace(iu,"[").replace(lu,"]")}function fu(e){return rr(e).replace(gi,"{").replace(mi,"}").replace(hi,"^")}function Ds(e){return rr(e).replace(pi,"%2B").replace(cu,"+").replace(di,"%23").replace(nu,"%26").replace(au,"`").replace(gi,"{").replace(mi,"}").replace(hi,"^")}function du(e){return Ds(e).replace(ru,"%3D")}function pu(e){return rr(e).replace(di,"%23").replace(ou,"%3F")}function hu(e){return pu(e).replace(su,"%2F")}function xn(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const gu=/\/$/,mu=e=>e.replace(gu,"");function bs(e,t,n="/"){let s,r={},o="",i="";const a=t.indexOf("#");let u=t.indexOf("?");return u=a>=0&&u>a?-1:u,u>=0&&(s=t.slice(0,u),o=t.slice(u,a>0?a:t.length),r=e(o.slice(1))),a>=0&&(s=s||t.slice(0,a),i=t.slice(a,t.length)),s=_u(s??t,n),{fullPath:s+o+i,path:s,query:r,hash:xn(i)}}function vu(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Hr(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function yu(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&Qt(t.matched[s],n.matched[r])&&vi(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Qt(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function vi(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!bu(e[n],t[n]))return!1;return!0}function bu(e,t){return qe(e)?Br(e,t):qe(t)?Br(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Br(e,t){return qe(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function _u(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),r=s[s.length-1];(r===".."||r===".")&&s.push("");let o=n.length-1,i,a;for(i=0;i1&&o--;else break;return n.slice(0,o).join("/")+"/"+s.slice(i).join("/")}const St={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Ms=(function(e){return e.pop="pop",e.push="push",e})({}),_s=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function xu(e){if(!e)if(Bt){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),mu(e)}const wu=/^[^#]+#/;function Eu(e,t){return e.replace(wu,"#")+t}function Cu(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const rs=()=>({left:window.scrollX,top:window.scrollY});function Au(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=Cu(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function $r(e,t){return(history.state?history.state.position-t:-1)+e}const Vs=new Map;function Su(e,t){Vs.set(e,t)}function Ru(e){const t=Vs.get(e);return Vs.delete(e),t}function Ou(e){return typeof e=="string"||e&&typeof e=="object"}function yi(e){return typeof e=="string"||typeof e=="symbol"}let ce=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const bi=Symbol("");ce.MATCHER_NOT_FOUND+"",ce.NAVIGATION_GUARD_REDIRECT+"",ce.NAVIGATION_ABORTED+"",ce.NAVIGATION_CANCELLED+"",ce.NAVIGATION_DUPLICATED+"";function Yt(e,t){return Y(new Error,{type:e,[bi]:!0},t)}function pt(e,t){return e instanceof Error&&bi in e&&(t==null||!!(e.type&t))}const Tu=["params","query","hash"];function Pu(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Tu)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Iu(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;sr&&Ds(r)):[s&&Ds(s)]).forEach(r=>{r!==void 0&&(t+=(t.length?"&":"")+n,r!=null&&(t+="="+r))})}return t}function Nu(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=qe(s)?s.map(r=>r==null?null:""+r):s==null?s:""+s)}return t}const ku=Symbol(""),Gr=Symbol(""),os=Symbol(""),_i=Symbol(""),js=Symbol("");function sn(){let e=[];function t(s){return e.push(s),()=>{const r=e.indexOf(s);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Ot(e,t,n,s,r,o=i=>i()){const i=s&&(s.enterCallbacks[r]=s.enterCallbacks[r]||[]);return()=>new Promise((a,u)=>{const p=g=>{g===!1?u(Yt(ce.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?u(g):Ou(g)?u(Yt(ce.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(i&&s.enterCallbacks[r]===i&&typeof g=="function"&&i.push(g),a())},f=o(()=>e.call(s&&s.instances[r],t,n,p));let h=Promise.resolve(f);e.length<3&&(h=h.then(p)),h.catch(g=>u(g))})}function xs(e,t,n,s,r=o=>o()){const o=[];for(const i of e)for(const a in i.components){let u=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(fi(u)){const p=(u.__vccOpts||u)[t];p&&o.push(Ot(p,n,s,i,a,r))}else{let p=u();o.push(()=>p.then(f=>{if(!f)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const h=tu(f)?f.default:f;i.mods[a]=f,i.components[a]=h;const g=(h.__vccOpts||h)[t];return g&&Ot(g,n,s,i,a,r)()}))}}return o}function Du(e,t){const n=[],s=[],r=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;iQt(p,a))?s.push(a):n.push(a));const u=e.matched[i];u&&(t.matched.find(p=>Qt(p,u))||r.push(u))}return[n,s,r]}/*! - * vue-router v4.6.4 - * (c) 2025 Eduardo San Martin Morote - * @license MIT - */let Mu=()=>location.protocol+"//"+location.host;function xi(e,t){const{pathname:n,search:s,hash:r}=t,o=e.indexOf("#");if(o>-1){let i=r.includes(e.slice(o))?e.slice(o).length:1,a=r.slice(i);return a[0]!=="/"&&(a="/"+a),Hr(a,"")}return Hr(n,e)+s+r}function Vu(e,t,n,s){let r=[],o=[],i=null;const a=({state:g})=>{const v=xi(e,location),M=n.value,E=t.value;let C=0;if(g){if(n.value=v,t.value=g,i&&i===M){i=null;return}C=E?g.position-E.position:0}else s(v);r.forEach(R=>{R(n.value,M,{delta:C,type:Ms.pop,direction:C?C>0?_s.forward:_s.back:_s.unknown})})};function u(){i=n.value}function p(g){r.push(g);const v=()=>{const M=r.indexOf(g);M>-1&&r.splice(M,1)};return o.push(v),v}function f(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(Y({},g.state,{scroll:rs()}),"")}}function h(){for(const g of o)g();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",f),document.removeEventListener("visibilitychange",f)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",f),document.addEventListener("visibilitychange",f),{pauseListeners:u,listen:p,destroy:h}}function Wr(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?rs():null}}function ju(e){const{history:t,location:n}=window,s={value:xi(e,n)},r={value:t.state};r.value||o(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(u,p,f){const h=e.indexOf("#"),g=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+u:Mu()+e+u;try{t[f?"replaceState":"pushState"](p,"",g),r.value=p}catch(v){console.error(v),n[f?"replace":"assign"](g)}}function i(u,p){o(u,Y({},t.state,Wr(r.value.back,u,r.value.forward,!0),p,{position:r.value.position}),!0),s.value=u}function a(u,p){const f=Y({},r.value,t.state,{forward:u,scroll:rs()});o(f.current,f,!0),o(u,Y({},Wr(s.value,u,null),{position:f.position+1},p),!1),s.value=u}return{location:s,state:r,push:a,replace:i}}function Lu(e){e=xu(e);const t=ju(e),n=Vu(e,t.state,t.location,t.replace);function s(o,i=!0){i||n.pauseListeners(),history.go(o)}const r=Y({location:"",base:e,go:s,createHref:Eu.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let Dt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var ge=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(ge||{});const Uu={type:Dt.Static,value:""},Fu=/[a-zA-Z0-9_]/;function Hu(e){if(!e)return[[]];if(e==="/")return[[Uu]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(v){throw new Error(`ERR (${n})/"${p}": ${v}`)}let n=ge.Static,s=n;const r=[];let o;function i(){o&&r.push(o),o=[]}let a=0,u,p="",f="";function h(){p&&(n===ge.Static?o.push({type:Dt.Static,value:p}):n===ge.Param||n===ge.ParamRegExp||n===ge.ParamRegExpEnd?(o.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${p}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Dt.Param,value:p,regexp:f,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),p="")}function g(){p+=u}for(;at.length?t.length===1&&t[0]===Re.Static+Re.Segment?1:-1:0}function wi(e,t){let n=0;const s=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const Wu={strict:!1,end:!0,sensitive:!1};function qu(e,t,n){const s=Ku(Hu(e.path),n),r=Y(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function zu(e,t){const n=[],s=new Map;t=Fr(Wu,t);function r(h){return s.get(h)}function o(h,g,v){const M=!v,E=Qr(h);E.aliasOf=v&&v.record;const C=Fr(t,h),R=[E];if("alias"in h){const D=typeof h.alias=="string"?[h.alias]:h.alias;for(const q of D)R.push(Qr(Y({},E,{components:v?v.record.components:E.components,path:q,aliasOf:v?v.record:E})))}let I,V;for(const D of R){const{path:q}=D;if(g&&q[0]!=="/"){const oe=g.record.path,U=oe[oe.length-1]==="/"?"":"/";D.path=g.record.path+(q&&U+q)}if(I=qu(D,g,C),v?v.alias.push(I):(V=V||I,V!==I&&V.alias.push(I),M&&h.name&&!Yr(I)&&i(h.name)),Ei(I)&&u(I),E.children){const oe=E.children;for(let U=0;U{i(V)}:pn}function i(h){if(yi(h)){const g=s.get(h);g&&(s.delete(h),n.splice(n.indexOf(g),1),g.children.forEach(i),g.alias.forEach(i))}else{const g=n.indexOf(h);g>-1&&(n.splice(g,1),h.record.name&&s.delete(h.record.name),h.children.forEach(i),h.alias.forEach(i))}}function a(){return n}function u(h){const g=Yu(h,n);n.splice(g,0,h),h.record.name&&!Yr(h)&&s.set(h.record.name,h)}function p(h,g){let v,M={},E,C;if("name"in h&&h.name){if(v=s.get(h.name),!v)throw Yt(ce.MATCHER_NOT_FOUND,{location:h});C=v.record.name,M=Y(Jr(g.params,v.keys.filter(V=>!V.optional).concat(v.parent?v.parent.keys.filter(V=>V.optional):[]).map(V=>V.name)),h.params&&Jr(h.params,v.keys.map(V=>V.name))),E=v.stringify(M)}else if(h.path!=null)E=h.path,v=n.find(V=>V.re.test(E)),v&&(M=v.parse(E),C=v.record.name);else{if(v=g.name?s.get(g.name):n.find(V=>V.re.test(g.path)),!v)throw Yt(ce.MATCHER_NOT_FOUND,{location:h,currentLocation:g});C=v.record.name,M=Y({},g.params,h.params),E=v.stringify(M)}const R=[];let I=v;for(;I;)R.unshift(I.record),I=I.parent;return{name:C,path:E,params:M,matched:R,meta:Qu(R)}}e.forEach(h=>o(h));function f(){n.length=0,s.clear()}return{addRoute:o,resolve:p,removeRoute:i,clearRoutes:f,getRoutes:a,getRecordMatcher:r}}function Jr(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Qr(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Ju(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Ju(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Yr(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Qu(e){return e.reduce((t,n)=>Y(t,n.meta),{})}function Yu(e,t){let n=0,s=t.length;for(;n!==s;){const o=n+s>>1;wi(e,t[o])<0?s=o:n=o+1}const r=Xu(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function Xu(e){let t=e;for(;t=t.parent;)if(Ei(t)&&wi(e,t)===0)return t}function Ei({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Xr(e){const t=at(os),n=at(_i),s=De(()=>{const u=jt(e.to);return t.resolve(u)}),r=De(()=>{const{matched:u}=s.value,{length:p}=u,f=u[p-1],h=n.matched;if(!f||!h.length)return-1;const g=h.findIndex(Qt.bind(null,f));if(g>-1)return g;const v=Zr(u[p-2]);return p>1&&Zr(f)===v&&h[h.length-1].path!==v?h.findIndex(Qt.bind(null,u[p-2])):g}),o=De(()=>r.value>-1&&sc(n.params,s.value.params)),i=De(()=>r.value>-1&&r.value===n.matched.length-1&&vi(n.params,s.value.params));function a(u={}){if(nc(u)){const p=t[jt(e.replace)?"replace":"push"](jt(e.to)).catch(pn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>p),p}return Promise.resolve()}return{route:s,href:De(()=>s.value.href),isActive:o,isExactActive:i,navigate:a}}function Zu(e){return e.length===1?e[0]:e}const ec=Vo({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Xr,setup(e,{slots:t}){const n=Yn(Xr(e)),{options:s}=at(os),r=De(()=>({[eo(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[eo(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Zu(t.default(n));return e.custom?o:ai("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},o)}}}),tc=ec;function nc(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function sc(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!qe(r)||r.length!==s.length||s.some((o,i)=>o.valueOf()!==r[i].valueOf()))return!1}return!0}function Zr(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const eo=(e,t,n)=>e??t??n,rc=Vo({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=at(js),r=De(()=>e.route||s.value),o=at(Gr,0),i=De(()=>{let p=jt(o);const{matched:f}=r.value;let h;for(;(h=f[p])&&!h.components;)p++;return p}),a=De(()=>r.value.matched[i.value]);In(Gr,De(()=>i.value+1)),In(ku,a),In(js,r);const u=ne();return Nn(()=>[u.value,a.value,e.name],([p,f,h],[g,v,M])=>{f&&(f.instances[h]=p,v&&v!==f&&p&&p===g&&(f.leaveGuards.size||(f.leaveGuards=v.leaveGuards),f.updateGuards.size||(f.updateGuards=v.updateGuards))),p&&f&&(!v||!Qt(f,v)||!g)&&(f.enterCallbacks[h]||[]).forEach(E=>E(p))},{flush:"post"}),()=>{const p=r.value,f=e.name,h=a.value,g=h&&h.components[f];if(!g)return to(n.default,{Component:g,route:p});const v=h.props[f],M=v?v===!0?p.params:typeof v=="function"?v(p):v:null,C=ai(g,Y({},M,t,{onVnodeUnmounted:R=>{R.component.isUnmounted&&(h.instances[f]=null)},ref:u}));return to(n.default,{Component:C,route:p})||C}}});function to(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const oc=rc;function ic(e){const t=zu(e.routes,e),n=e.parseQuery||Iu,s=e.stringifyQuery||Kr,r=e.history,o=sn(),i=sn(),a=sn(),u=tl(St);let p=St;Bt&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const f=ys.bind(null,_=>""+_),h=ys.bind(null,hu),g=ys.bind(null,xn);function v(_,N){let P,j;return yi(_)?(P=t.getRecordMatcher(_),j=N):j=_,t.addRoute(j,P)}function M(_){const N=t.getRecordMatcher(_);N&&t.removeRoute(N)}function E(){return t.getRoutes().map(_=>_.record)}function C(_){return!!t.getRecordMatcher(_)}function R(_,N){if(N=Y({},N||u.value),typeof _=="string"){const c=bs(n,_,N.path),y=t.resolve({path:c.path},N),x=r.createHref(c.fullPath);return Y(c,y,{params:g(y.params),hash:xn(c.hash),redirectedFrom:void 0,href:x})}let P;if(_.path!=null)P=Y({},_,{path:bs(n,_.path,N.path).path});else{const c=Y({},_.params);for(const y in c)c[y]==null&&delete c[y];P=Y({},_,{params:h(c)}),N.params=h(N.params)}const j=t.resolve(P,N),A=_.hash||"";j.params=f(g(j.params));const l=vu(s,Y({},_,{hash:fu(A),path:j.path})),d=r.createHref(l);return Y({fullPath:l,hash:A,query:s===Kr?Nu(_.query):_.query||{}},j,{redirectedFrom:void 0,href:d})}function I(_){return typeof _=="string"?bs(n,_,u.value.path):Y({},_)}function V(_,N){if(p!==_)return Yt(ce.NAVIGATION_CANCELLED,{from:N,to:_})}function D(_){return U(_)}function q(_){return D(Y(I(_),{replace:!0}))}function oe(_,N){const P=_.matched[_.matched.length-1];if(P&&P.redirect){const{redirect:j}=P;let A=typeof j=="function"?j(_,N):j;return typeof A=="string"&&(A=A.includes("?")||A.includes("#")?A=I(A):{path:A},A.params={}),Y({query:_.query,hash:_.hash,params:A.path!=null?{}:_.params},A)}}function U(_,N){const P=p=R(_),j=u.value,A=_.state,l=_.force,d=_.replace===!0,c=oe(P,j);if(c)return U(Y(I(c),{state:typeof c=="object"?Y({},A,c.state):A,force:l,replace:d}),N||P);const y=P;y.redirectedFrom=N;let x;return!l&&yu(s,j,P)&&(x=Yt(ce.NAVIGATION_DUPLICATED,{to:y,from:j}),He(j,j,!0,!1)),(x?Promise.resolve(x):Le(y,j)).catch(b=>pt(b)?pt(b,ce.NAVIGATION_GUARD_REDIRECT)?b:Ne(b):B(b,y,j)).then(b=>{if(b){if(pt(b,ce.NAVIGATION_GUARD_REDIRECT))return U(Y({replace:d},I(b.to),{state:typeof b.to=="object"?Y({},A,b.to.state):A,force:l}),N||y)}else b=ct(y,j,!0,d,A);return ze(y,j,b),b})}function Ie(_,N){const P=V(_,N);return P?Promise.reject(P):Promise.resolve()}function je(_){const N=At.values().next().value;return N&&typeof N.runWithContext=="function"?N.runWithContext(_):_()}function Le(_,N){let P;const[j,A,l]=Du(_,N);P=xs(j.reverse(),"beforeRouteLeave",_,N);for(const c of j)c.leaveGuards.forEach(y=>{P.push(Ot(y,_,N))});const d=Ie.bind(null,_,N);return P.push(d),ve(P).then(()=>{P=[];for(const c of o.list())P.push(Ot(c,_,N));return P.push(d),ve(P)}).then(()=>{P=xs(A,"beforeRouteUpdate",_,N);for(const c of A)c.updateGuards.forEach(y=>{P.push(Ot(y,_,N))});return P.push(d),ve(P)}).then(()=>{P=[];for(const c of l)if(c.beforeEnter)if(qe(c.beforeEnter))for(const y of c.beforeEnter)P.push(Ot(y,_,N));else P.push(Ot(c.beforeEnter,_,N));return P.push(d),ve(P)}).then(()=>(_.matched.forEach(c=>c.enterCallbacks={}),P=xs(l,"beforeRouteEnter",_,N,je),P.push(d),ve(P))).then(()=>{P=[];for(const c of i.list())P.push(Ot(c,_,N));return P.push(d),ve(P)}).catch(c=>pt(c,ce.NAVIGATION_CANCELLED)?c:Promise.reject(c))}function ze(_,N,P){a.list().forEach(j=>je(()=>j(_,N,P)))}function ct(_,N,P,j,A){const l=V(_,N);if(l)return l;const d=N===St,c=Bt?history.state:{};P&&(j||d?r.replace(_.fullPath,Y({scroll:d&&c&&c.scroll},A)):r.push(_.fullPath,A)),u.value=_,He(_,N,P,d),Ne()}let Ue;function Pt(){Ue||(Ue=r.listen((_,N,P)=>{if(!ft.listening)return;const j=R(_),A=oe(j,ft.currentRoute.value);if(A){U(Y(A,{replace:!0,force:!0}),j).catch(pn);return}p=j;const l=u.value;Bt&&Su($r(l.fullPath,P.delta),rs()),Le(j,l).catch(d=>pt(d,ce.NAVIGATION_ABORTED|ce.NAVIGATION_CANCELLED)?d:pt(d,ce.NAVIGATION_GUARD_REDIRECT)?(U(Y(I(d.to),{force:!0}),j).then(c=>{pt(c,ce.NAVIGATION_ABORTED|ce.NAVIGATION_DUPLICATED)&&!P.delta&&P.type===Ms.pop&&r.go(-1,!1)}).catch(pn),Promise.reject()):(P.delta&&r.go(-P.delta,!1),B(d,j,l))).then(d=>{d=d||ct(j,l,!1),d&&(P.delta&&!pt(d,ce.NAVIGATION_CANCELLED)?r.go(-P.delta,!1):P.type===Ms.pop&&pt(d,ce.NAVIGATION_ABORTED|ce.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),ze(j,l,d)}).catch(pn)}))}let Et=sn(),ae=sn(),z;function B(_,N,P){Ne(_);const j=ae.list();return j.length?j.forEach(A=>A(_,N,P)):console.error(_),Promise.reject(_)}function Fe(){return z&&u.value!==St?Promise.resolve():new Promise((_,N)=>{Et.add([_,N])})}function Ne(_){return z||(z=!_,Pt(),Et.list().forEach(([N,P])=>_?P(_):N()),Et.reset()),_}function He(_,N,P,j){const{scrollBehavior:A}=e;if(!Bt||!A)return Promise.resolve();const l=!P&&Ru($r(_.fullPath,0))||(j||!P)&&history.state&&history.state.scroll||null;return Qs().then(()=>A(_,N,l)).then(d=>d&&Au(d)).catch(d=>B(d,_,N))}const xe=_=>r.go(_);let Ct;const At=new Set,ft={currentRoute:u,listening:!0,addRoute:v,removeRoute:M,clearRoutes:t.clearRoutes,hasRoute:C,getRoutes:E,resolve:R,options:e,push:D,replace:q,go:xe,back:()=>xe(-1),forward:()=>xe(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:ae.add,isReady:Fe,install(_){_.component("RouterLink",tc),_.component("RouterView",oc),_.config.globalProperties.$router=ft,Object.defineProperty(_.config.globalProperties,"$route",{enumerable:!0,get:()=>jt(u)}),Bt&&!Ct&&u.value===St&&(Ct=!0,D(r.location).catch(j=>{}));const N={};for(const j in St)Object.defineProperty(N,j,{get:()=>u.value[j],enumerable:!0});_.provide(os,ft),_.provide(_i,Ao(N)),_.provide(js,u);const P=_.unmount;At.add(_),_.unmount=function(){At.delete(_),At.size<1&&(p=St,Ue&&Ue(),Ue=null,u.value=St,Ct=!1,z=!1),P()}}};function ve(_){return _.reduce((N,P)=>N.then(()=>je(P)),Promise.resolve())}return ft}function lc(){return at(os)}async function Tn(e,t={}){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t.headers}}),s=n.headers.get("content-type")||"";if(n.redirected||!s.includes("application/json"))throw window.location.href="/login",new Error("Sesión expirada");const r=await n.json();if(!n.ok)throw new Error((r==null?void 0:r.error)||(r==null?void 0:r.message)||"Error de servidor");return r}const pe={get:e=>Tn(e),post:(e,t)=>Tn(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>Tn(e,{method:"PUT",body:JSON.stringify(t)}),del:e=>Tn(e,{method:"DELETE"})},ac={key:0,class:"text-sm text-red-600 mb-4"},uc={key:1,class:"text-sm text-gray-500"},cc={key:2,class:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100"},fc={key:0,class:"p-6 text-sm text-gray-500"},dc=["onClick"],pc={class:"font-medium text-gray-800"},hc={class:"text-xs text-gray-500 mt-0.5"},gc={class:"flex items-center gap-3 text-sm"},mc=["onClick"],vc=["onClick"],yc={class:"bg-white rounded-xl p-6 w-full max-w-lg"},bc={class:"font-semibold text-gray-800 mb-4"},_c=["value"],xc={class:"flex items-center gap-2 text-sm text-gray-600"},wc={class:"flex justify-end gap-2 pt-2"},Ec={__name:"TenantsList",setup(e){const t=lc(),n=ne([]),s=ne([]),r=ne(!0),o=ne(""),i=ne(!1),a=ne(null),u=ne(p());function p(){return{nombre:"",dominios_permitidos:"",ai_config_id:null,tono:"",mensaje_bienvenida:"",activo:!0}}async function f(){r.value=!0,o.value="";try{const[E,C]=await Promise.all([pe.get("/app/umind/tenants"),pe.get("/app/api/ai-config/select")]);n.value=E.items||[],s.value=C.registros||[]}catch(E){o.value=E.message}finally{r.value=!1}}function h(){a.value=null,u.value=p(),i.value=!0}function g(E){a.value=E,u.value={nombre:E.nombre,dominios_permitidos:E.dominios_permitidos,ai_config_id:E.ai_config_id,tono:E.tono,mensaje_bienvenida:E.mensaje_bienvenida,activo:E.activo},i.value=!0}async function v(){const E={...u.value,dominios_permitidos:u.value.dominios_permitidos.split(",").map(C=>C.trim()).filter(Boolean)};try{if(a.value)await pe.put(`/app/umind/tenants/${a.value.ID}`,E),i.value=!1,await f();else{const C=await pe.post("/app/umind/tenants",E);i.value=!1,t.push(`/tenants/${C.id}`)}}catch(C){o.value=C.message}}async function M(E){if(confirm(`¿Eliminar el tenant "${E.nombre}"? Esto no se puede deshacer.`))try{await pe.del(`/app/umind/tenants/${E.ID}`),await f()}catch(C){o.value=C.message}}return tr(f),(E,C)=>(L(),H("div",null,[m("div",{class:"flex items-center justify-between mb-6"},[C[8]||(C[8]=m("h1",{class:"text-xl font-semibold text-gray-800"},"Tenants",-1)),m("button",{class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg",onClick:h}," + Nuevo tenant ")]),o.value?(L(),H("p",ac,Q(o.value),1)):ue("",!0),r.value?(L(),H("p",uc,"Cargando...")):(L(),H("div",cc,[n.value.length===0?(L(),H("div",fc," Todavía no hay tenants. Creá el primero. ")):ue("",!0),(L(!0),H(he,null,et(n.value,R=>(L(),H("div",{key:R.ID,class:"p-4 flex items-center justify-between hover:bg-gray-50 cursor-pointer",onClick:I=>jt(t).push(`/tenants/${R.ID}`)},[m("div",null,[m("span",pc,Q(R.nombre),1),m("div",hc,[$e(Q(R.dominios_permitidos||"sin dominios configurados")+" ",1),m("span",{class:tt(["ml-2 px-1.5 py-0.5 rounded",R.activo?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"])},Q(R.activo?"activo":"inactivo"),3)])]),m("div",gc,[C[9]||(C[9]=m("span",{class:"text-brand font-medium"},"Configurar →",-1)),m("button",{class:"text-gray-500 hover:text-gray-800",onClick:rt(I=>g(R),["stop"])},"Editar",8,mc),m("button",{class:"text-red-500 hover:text-red-700",onClick:rt(I=>M(R),["stop"])},"Eliminar",8,vc)])],8,dc))),128))])),i.value?(L(),H("div",{key:3,class:"fixed inset-0 bg-black/30 flex items-center justify-center p-4 z-50",onClick:C[7]||(C[7]=rt(R=>i.value=!1,["self"]))},[m("div",yc,[m("h2",bc,Q(a.value?"Editar tenant":"Nuevo tenant"),1),m("form",{class:"space-y-3",onSubmit:rt(v,["prevent"])},[m("div",null,[C[10]||(C[10]=m("label",{class:"text-xs text-gray-500"},"Nombre",-1)),ie(m("input",{"onUpdate:modelValue":C[0]||(C[0]=R=>u.value.nombre=R),required:"",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512),[[me,u.value.nombre]])]),m("div",null,[C[11]||(C[11]=m("label",{class:"text-xs text-gray-500"},"Dominios permitidos (separados por coma)",-1)),ie(m("input",{"onUpdate:modelValue":C[1]||(C[1]=R=>u.value.dominios_permitidos=R),placeholder:"ejemplo.com, www.ejemplo.com",required:"",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512),[[me,u.value.dominios_permitidos]])]),m("div",null,[C[13]||(C[13]=m("label",{class:"text-xs text-gray-500"},"Config de IA",-1)),ie(m("select",{"onUpdate:modelValue":C[2]||(C[2]=R=>u.value.ai_config_id=R),class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},[C[12]||(C[12]=m("option",{value:null},"— sin asignar —",-1)),(L(!0),H(he,null,et(s.value,R=>(L(),H("option",{key:R.ID,value:R.ID},Q(R.nombre)+" ("+Q(R.provider)+") ",9,_c))),128))],512),[[ks,u.value.ai_config_id]])]),m("div",null,[C[14]||(C[14]=m("label",{class:"text-xs text-gray-500"},"Tono / personalidad",-1)),ie(m("textarea",{"onUpdate:modelValue":C[3]||(C[3]=R=>u.value.tono=R),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512),[[me,u.value.tono]])]),m("div",null,[C[15]||(C[15]=m("label",{class:"text-xs text-gray-500"},"Mensaje de bienvenida",-1)),ie(m("input",{"onUpdate:modelValue":C[4]||(C[4]=R=>u.value.mensaje_bienvenida=R),class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512),[[me,u.value.mensaje_bienvenida]])]),m("label",xc,[ie(m("input",{"onUpdate:modelValue":C[5]||(C[5]=R=>u.value.activo=R),type:"checkbox"},null,512),[[Dn,u.value.activo]]),C[16]||(C[16]=$e(" Activo ",-1))]),m("div",wc,[m("button",{type:"button",class:"px-4 py-2 text-sm text-gray-500",onClick:C[6]||(C[6]=R=>i.value=!1)}," Cancelar "),C[17]||(C[17]=m("button",{type:"submit",class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg"}," Guardar ",-1))])],32)])])):ue("",!0)]))}},Cc={key:0,class:"mt-2 mb-6"},Ac={class:"text-xl font-semibold text-gray-800"},Sc={class:"text-xs text-gray-500 mt-1"},Rc={class:"bg-gray-100 px-1.5 py-0.5 rounded"},Oc={key:1,class:"text-sm text-red-600 mb-4"},Tc={class:"border-b border-gray-200 mb-6 flex gap-6 text-sm overflow-x-auto"},Pc=["onClick"],Ic={key:2},Nc=["disabled"],kc={class:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100"},Dc={key:0,class:"p-6 text-sm text-gray-500"},Mc={class:"text-sm text-gray-800"},Vc={class:"text-xs text-gray-500 mt-0.5"},jc={key:0},Lc={key:1,class:"text-red-600"},Uc=["onClick"],Fc={key:3},Hc={class:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100"},Bc={key:0,class:"p-6 text-sm text-gray-500"},$c={class:"text-sm text-gray-800 font-mono"},Kc={class:"text-xs text-gray-500 mt-0.5"},Gc={class:"text-xs text-gray-400 mt-0.5"},Wc={key:0,class:"ml-1 text-green-600"},qc={key:1,class:"ml-1 text-gray-400"},zc={class:"flex gap-3 text-sm shrink-0"},Jc=["onClick"],Qc=["onClick"],Yc={class:"bg-white rounded-xl p-6 w-full max-w-xl max-h-[85vh] overflow-y-auto"},Xc={class:"font-semibold text-gray-800 mb-4"},Zc={class:"border border-gray-200 rounded-lg p-3 space-y-2"},ef=["onUpdate:modelValue"],tf=["onUpdate:modelValue"],nf=["onUpdate:modelValue"],sf={class:"text-xs text-gray-500 flex items-center gap-1"},rf=["onUpdate:modelValue"],of=["onClick"],lf={key:0,class:"text-xs text-gray-400"},af={class:"border border-gray-200 rounded-lg p-3 space-y-2"},uf={class:"flex items-center gap-2 text-xs text-gray-500"},cf={class:"flex items-center gap-2 text-sm text-gray-600"},ff={class:"flex justify-end gap-2 pt-2"},df={key:4},pf={class:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100"},hf={key:0,class:"p-6 text-sm text-gray-500"},gf={class:"flex items-center justify-between"},mf={class:"font-medium text-gray-800 capitalize"},vf={class:"flex gap-3 text-sm"},yf=["onClick"],bf=["onClick"],_f={class:"text-xs text-gray-500 mt-1 break-all"},xf={class:"bg-gray-100 px-1 rounded"},wf={key:0,class:"text-xs text-gray-400 mt-1"},Ef={key:1,class:"text-xs text-red-600 mt-1"},Cf={class:"bg-white rounded-xl p-6 w-full max-w-md"},Af={key:0},Sf={class:"flex justify-end gap-2 pt-2"},Rf={key:5,class:"bg-white rounded-xl border border-gray-200 p-4 flex flex-col h-[28rem]"},Of={class:"flex-1 overflow-y-auto space-y-2 mb-3"},Tf={key:0,class:"text-sm text-gray-500"},Pf={key:1,class:"text-xs text-gray-400"},If=["disabled"],Nf={key:6,class:"grid grid-cols-3 gap-4"},kf={class:"col-span-1 bg-white rounded-xl border border-gray-200 divide-y divide-gray-100 max-h-[28rem] overflow-y-auto"},Df={key:0,class:"p-4 text-sm text-gray-500"},Mf=["onClick"],Vf={class:"text-gray-800 truncate"},jf={class:"text-xs text-gray-400 mt-0.5"},Lf={class:"col-span-2 bg-white rounded-xl border border-gray-200 p-4 max-h-[28rem] overflow-y-auto space-y-2"},Uf={key:0,class:"text-sm text-gray-500"},Ff={__name:"TenantDetail",props:{id:{type:String,required:!0}},setup(e){const t=e,n=De(()=>Number(t.id)),s=ne(null),r=ne(""),o=ne("conocimiento"),i=ne([]),a=ne(""),u=ne(30),p=ne(!1);async function f(){const A=await pe.get("/app/umind/tenants");s.value=(A.items||[]).find(l=>String(l.ID)===t.id)||null}async function h(){const A=await pe.get(`/app/umind/documentos?tenant_id=${t.id}`);i.value=A.items||[]}async function g(){if(a.value.trim()){p.value=!0,r.value="";try{await pe.post("/app/umind/documentos",{tenant_id:n.value,url:a.value.trim(),max_paginas:Number(u.value)||30}),a.value="",await h()}catch(A){r.value=A.message}finally{p.value=!1}}}async function v(A){confirm("¿Eliminar esta fuente y sus fragmentos indexados?")&&(await pe.del(`/app/umind/documentos/${A}`),await h())}const M=De(()=>A=>({listo:"bg-green-100 text-green-700",procesando:"bg-amber-100 text-amber-700",pendiente:"bg-gray-100 text-gray-500",error:"bg-red-100 text-red-700"})[A]||"bg-gray-100 text-gray-500"),E=ne([]),C=ne([]),R=ne(null);async function I(){const A=await pe.get(`/app/umind/sesiones?tenant_id=${t.id}`);E.value=A.items||[]}async function V(A){R.value=A;const l=await pe.get(`/app/umind/historial?tenant_id=${t.id}&session_id=${A}`);C.value=l.items||[]}const D=ne([]),q=ne(!1),oe=ne(null),U=ne(Ie());function Ie(){return{nombre:"",descripcion:"",url:"",auth_header_nombre:"",auth_header_valor:"",tocarAuth:!1,parametros:[],activa:!0}}async function je(){const A=await pe.get(`/app/umind/tools?tenant_id=${t.id}`);D.value=A.items||[]}function Le(){oe.value=null,U.value=Ie(),q.value=!0}function ze(A){oe.value=A;let l=[];try{l=JSON.parse(A.parametros_json||"[]")||[]}catch{l=[]}U.value={nombre:A.nombre,descripcion:A.descripcion,url:A.url,auth_header_nombre:A.auth_header_nombre,auth_header_valor:"",tocarAuth:!1,parametros:l,activa:A.activa},q.value=!0}function ct(){U.value.parametros.push({nombre:"",tipo:"string",descripcion:"",requerido:!1})}function Ue(A){U.value.parametros.splice(A,1)}async function Pt(){const A={tenant_id:n.value,nombre:U.value.nombre.trim(),descripcion:U.value.descripcion,url:U.value.url.trim(),auth_header_nombre:U.value.auth_header_nombre,parametros:U.value.parametros,activa:U.value.activa};U.value.tocarAuth&&(A.auth_header_valor=U.value.auth_header_valor);try{oe.value?await pe.put(`/app/umind/tools/${oe.value.ID}`,A):await pe.post("/app/umind/tools",A),q.value=!1,await je()}catch(l){r.value=l.message}}async function Et(A){confirm(`¿Eliminar la tool "${A.nombre}"?`)&&(await pe.del(`/app/umind/tools/${A.ID}`),await je())}const ae=ne([]),z=ne(!1),B=ne(Fe());function Fe(){return{tipo:"telegram",bot_token:"",phone_number_id:"",access_token:"",app_secret:"",verify_token:""}}async function Ne(){const A=await pe.get(`/app/umind/canales?tenant_id=${t.id}`);ae.value=A.items||[]}function He(){B.value=Fe(),z.value=!0}async function xe(){const A=B.value.tipo==="telegram"?{bot_token:B.value.bot_token}:{phone_number_id:B.value.phone_number_id,access_token:B.value.access_token,app_secret:B.value.app_secret,verify_token:B.value.verify_token};try{await pe.post("/app/umind/canales",{tenant_id:n.value,tipo:B.value.tipo,credenciales:A,activo:!0}),z.value=!1,await Ne()}catch(l){r.value=l.message}}async function Ct(A){await pe.put(`/app/umind/canales/${A.ID}`,{activo:!A.activo,credenciales:{}}),await Ne()}async function At(A){confirm(`¿Eliminar el canal ${A.tipo}?`)&&(await pe.del(`/app/umind/canales/${A.ID}`),await Ne())}const ft=`staff-preview-${Math.random().toString(36).slice(2)}`,ve=ne([]),_=ne(""),N=ne(!1);async function P(){const A=_.value.trim();if(!(!A||N.value)){_.value="",ve.value.push({role:"user",content:A}),N.value=!0;try{const l=await pe.post("/app/umind/chat",{tenant_id:n.value,session_id:ft,mensaje:A});ve.value.push({role:"assistant",content:l.respuesta})}catch(l){ve.value.push({role:"assistant",content:`⚠️ ${l.message}`})}finally{N.value=!1}}}const j=[["conocimiento","Base de conocimiento"],["herramientas","Herramientas"],["canales","Canales"],["chat","Chat de prueba"],["conversaciones","Conversaciones"]];return tr(async()=>{try{await Promise.all([f(),h(),I(),je(),Ne()])}catch(A){r.value=A.message}}),(A,l)=>{const d=Rs("router-link");return L(),H("div",null,[Ce(d,{to:"/",class:"text-sm text-gray-500 hover:text-gray-700"},{default:Xs(()=>[...l[20]||(l[20]=[$e("← Tenants",-1)])]),_:1}),s.value?(L(),H("div",Cc,[m("h1",Ac,Q(s.value.nombre),1),m("p",Sc,[l[21]||(l[21]=$e(" site_key: ",-1)),m("code",Rc,Q(s.value.site_key),1)])])):ue("",!0),r.value?(L(),H("p",Oc,Q(r.value),1)):ue("",!0),m("div",Tc,[(L(),H(he,null,et(j,([c,y])=>m("button",{key:c,class:tt(["pb-2 border-b-2 whitespace-nowrap",o.value===c?"border-brand text-brand font-medium":"border-transparent text-gray-500"]),onClick:x=>o.value=c},Q(y),11,Pc)),64))]),o.value==="conocimiento"?(L(),H("div",Ic,[m("form",{class:"flex gap-2 mb-4",onSubmit:rt(g,["prevent"])},[ie(m("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>a.value=c),type:"url",placeholder:"https://ejemplo.com",required:"",class:"flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512),[[me,a.value]]),ie(m("input",{"onUpdate:modelValue":l[1]||(l[1]=c=>u.value=c),type:"number",min:"1",max:"200",class:"w-24 border border-gray-300 rounded-lg px-3 py-2 text-sm",title:"Máximo de páginas a crawlear"},null,512),[[me,u.value]]),m("button",{type:"submit",disabled:p.value,class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg disabled:opacity-50"},Q(p.value?"Agregando...":"Crawlear sitio"),9,Nc)],32),m("div",kc,[i.value.length===0?(L(),H("div",Dc,"Sin fuentes todavía.")):ue("",!0),(L(!0),H(he,null,et(i.value,c=>(L(),H("div",{key:c.ID,class:"p-4 flex items-center justify-between"},[m("div",null,[m("div",Mc,Q(c.origen),1),m("div",Vc,[m("span",{class:tt(["px-1.5 py-0.5 rounded",M.value(c.estado)])},Q(c.estado),3),c.total_chunks?(L(),H("span",jc," · "+Q(c.total_chunks)+" fragmentos",1)):ue("",!0),c.error?(L(),H("span",Lc," · "+Q(c.error),1)):ue("",!0)])]),m("button",{class:"text-red-500 hover:text-red-700 text-sm",onClick:y=>v(c.ID)},"Eliminar",8,Uc)]))),128))])])):o.value==="herramientas"?(L(),H("div",Fc,[m("div",{class:"flex justify-between items-center mb-4"},[l[22]||(l[22]=m("p",{class:"text-xs text-gray-500"},"Máximo 10 tools activas por tenant.",-1)),m("button",{class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg",onClick:Le}," + Nueva tool ")]),m("div",Hc,[D.value.length===0?(L(),H("div",Bc,"Sin tools custom todavía.")):ue("",!0),(L(!0),H(he,null,et(D.value,c=>(L(),H("div",{key:c.ID,class:"p-4 flex items-center justify-between"},[m("div",null,[m("div",$c,Q(c.nombre),1),m("div",Kc,Q(c.descripcion),1),m("div",Gc,[$e(Q(c.url)+" ",1),c.auth_configurado?(L(),H("span",Wc,"· auth configurada")):ue("",!0),c.activa?ue("",!0):(L(),H("span",qc,"· inactiva"))])]),m("div",zc,[m("button",{class:"text-gray-500 hover:text-gray-800",onClick:y=>ze(c)},"Editar",8,Jc),m("button",{class:"text-red-500 hover:text-red-700",onClick:y=>Et(c)},"Eliminar",8,Qc)])]))),128))]),q.value?(L(),H("div",{key:0,class:"fixed inset-0 bg-black/30 flex items-center justify-center p-4 z-50",onClick:l[10]||(l[10]=rt(c=>q.value=!1,["self"]))},[m("div",Yc,[m("h2",Xc,Q(oe.value?"Editar tool":"Nueva tool"),1),m("form",{class:"space-y-3",onSubmit:rt(Pt,["prevent"])},[m("div",null,[l[23]||(l[23]=m("label",{class:"text-xs text-gray-500"},"Nombre (identificador, ej: consultar_stock)",-1)),ie(m("input",{"onUpdate:modelValue":l[2]||(l[2]=c=>U.value.nombre=c),required:"",pattern:"[a-z][a-z0-9_]{2,63}",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono"},null,512),[[me,U.value.nombre]])]),m("div",null,[l[24]||(l[24]=m("label",{class:"text-xs text-gray-500"},"Descripción (esto lo lee el modelo para decidir cuándo usarla)",-1)),ie(m("textarea",{"onUpdate:modelValue":l[3]||(l[3]=c=>U.value.descripcion=c),rows:"2",required:"",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512),[[me,U.value.descripcion]])]),m("div",null,[l[25]||(l[25]=m("label",{class:"text-xs text-gray-500"},"URL del webhook (https)",-1)),ie(m("input",{"onUpdate:modelValue":l[4]||(l[4]=c=>U.value.url=c),type:"url",required:"",placeholder:"https://...",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512),[[me,U.value.url]])]),m("div",Zc,[m("div",{class:"flex items-center justify-between"},[l[26]||(l[26]=m("label",{class:"text-xs text-gray-500"},"Parámetros que completa el modelo",-1)),m("button",{type:"button",class:"text-xs text-brand",onClick:ct},"+ agregar")]),(L(!0),H(he,null,et(U.value.parametros,(c,y)=>(L(),H("div",{key:y,class:"flex gap-2 items-center"},[ie(m("input",{"onUpdate:modelValue":x=>c.nombre=x,placeholder:"nombre",class:"flex-1 border border-gray-300 rounded px-2 py-1 text-xs font-mono"},null,8,ef),[[me,c.nombre]]),ie(m("select",{"onUpdate:modelValue":x=>c.tipo=x,class:"border border-gray-300 rounded px-2 py-1 text-xs"},[...l[27]||(l[27]=[m("option",{value:"string"},"string",-1),m("option",{value:"number"},"number",-1),m("option",{value:"boolean"},"boolean",-1)])],8,tf),[[ks,c.tipo]]),ie(m("input",{"onUpdate:modelValue":x=>c.descripcion=x,placeholder:"descripción",class:"flex-1 border border-gray-300 rounded px-2 py-1 text-xs"},null,8,nf),[[me,c.descripcion]]),m("label",sf,[ie(m("input",{"onUpdate:modelValue":x=>c.requerido=x,type:"checkbox"},null,8,rf),[[Dn,c.requerido]]),l[28]||(l[28]=$e(" req. ",-1))]),m("button",{type:"button",class:"text-red-400 text-xs",onClick:x=>Ue(y)},"✕",8,of)]))),128)),U.value.parametros.length===0?(L(),H("p",lf,"Sin parámetros.")):ue("",!0)]),m("div",af,[l[29]||(l[29]=m("label",{class:"text-xs text-gray-500"},"Autenticación saliente (opcional)",-1)),ie(m("input",{"onUpdate:modelValue":l[5]||(l[5]=c=>U.value.auth_header_nombre=c),placeholder:"Nombre del header, ej: Authorization",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512),[[me,U.value.auth_header_nombre]]),m("label",uf,[ie(m("input",{"onUpdate:modelValue":l[6]||(l[6]=c=>U.value.tocarAuth=c),type:"checkbox"},null,512),[[Dn,U.value.tocarAuth]]),$e(" "+Q(oe.value?"Cambiar el valor del secreto":"Configurar valor"),1)]),U.value.tocarAuth?ie((L(),H("input",{key:0,"onUpdate:modelValue":l[7]||(l[7]=c=>U.value.auth_header_valor=c),type:"password",placeholder:"Valor del header (ej: Bearer xxxx)",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512)),[[me,U.value.auth_header_valor]]):ue("",!0)]),m("label",cf,[ie(m("input",{"onUpdate:modelValue":l[8]||(l[8]=c=>U.value.activa=c),type:"checkbox"},null,512),[[Dn,U.value.activa]]),l[30]||(l[30]=$e(" Activa ",-1))]),m("div",ff,[m("button",{type:"button",class:"px-4 py-2 text-sm text-gray-500",onClick:l[9]||(l[9]=c=>q.value=!1)},"Cancelar"),l[31]||(l[31]=m("button",{type:"submit",class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg"},"Guardar",-1))])],32)])])):ue("",!0)])):o.value==="canales"?(L(),H("div",df,[m("div",{class:"flex justify-end mb-4"},[m("button",{class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg",onClick:He}," + Nuevo canal ")]),m("div",pf,[ae.value.length===0?(L(),H("div",hf,"Sin canales configurados.")):ue("",!0),(L(!0),H(he,null,et(ae.value,c=>(L(),H("div",{key:c.ID,class:"p-4"},[m("div",gf,[m("div",null,[m("span",mf,Q(c.tipo),1),m("span",{class:tt(["ml-2 px-1.5 py-0.5 rounded text-xs",c.activo?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"])},Q(c.activo?"activo":"inactivo"),3)]),m("div",vf,[m("button",{class:"text-gray-500 hover:text-gray-800",onClick:y=>Ct(c)},Q(c.activo?"Desactivar":"Activar"),9,yf),m("button",{class:"text-red-500 hover:text-red-700",onClick:y=>At(c)},"Eliminar",8,bf)])]),m("p",_f,[l[32]||(l[32]=$e(" Webhook: ",-1)),m("code",xf,Q(c.webhook_url),1)]),c.tipo==="whatsapp"?(L(),H("p",wf,' Registrá esta URL como "Callback URL" en Meta for Developers → WhatsApp → Configuration, con el mismo verify_token que pusiste acá. ')):ue("",!0),c.ultimo_error?(L(),H("p",Ef,Q(c.ultimo_error),1)):ue("",!0)]))),128))]),z.value?(L(),H("div",{key:0,class:"fixed inset-0 bg-black/30 flex items-center justify-center p-4 z-50",onClick:l[18]||(l[18]=rt(c=>z.value=!1,["self"]))},[m("div",Cf,[l[41]||(l[41]=m("h2",{class:"font-semibold text-gray-800 mb-4"},"Nuevo canal",-1)),m("form",{class:"space-y-3",onSubmit:rt(xe,["prevent"])},[m("div",null,[l[34]||(l[34]=m("label",{class:"text-xs text-gray-500"},"Tipo",-1)),ie(m("select",{"onUpdate:modelValue":l[11]||(l[11]=c=>B.value.tipo=c),class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},[...l[33]||(l[33]=[m("option",{value:"telegram"},"Telegram",-1),m("option",{value:"whatsapp"},"WhatsApp Business",-1)])],512),[[ks,B.value.tipo]])]),B.value.tipo==="telegram"?(L(),H("div",Af,[l[35]||(l[35]=m("label",{class:"text-xs text-gray-500"},"Bot token (de @BotFather)",-1)),ie(m("input",{"onUpdate:modelValue":l[12]||(l[12]=c=>B.value.bot_token=c),type:"password",required:"",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512),[[me,B.value.bot_token]])])):(L(),H(he,{key:1},[m("div",null,[l[36]||(l[36]=m("label",{class:"text-xs text-gray-500"},"Phone Number ID",-1)),ie(m("input",{"onUpdate:modelValue":l[13]||(l[13]=c=>B.value.phone_number_id=c),required:"",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512),[[me,B.value.phone_number_id]])]),m("div",null,[l[37]||(l[37]=m("label",{class:"text-xs text-gray-500"},"Access Token",-1)),ie(m("input",{"onUpdate:modelValue":l[14]||(l[14]=c=>B.value.access_token=c),type:"password",required:"",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512),[[me,B.value.access_token]])]),m("div",null,[l[38]||(l[38]=m("label",{class:"text-xs text-gray-500"},"App Secret",-1)),ie(m("input",{"onUpdate:modelValue":l[15]||(l[15]=c=>B.value.app_secret=c),type:"password",required:"",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512),[[me,B.value.app_secret]])]),m("div",null,[l[39]||(l[39]=m("label",{class:"text-xs text-gray-500"},"Verify Token (lo inventás vos, lo vas a usar en Meta)",-1)),ie(m("input",{"onUpdate:modelValue":l[16]||(l[16]=c=>B.value.verify_token=c),required:"",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512),[[me,B.value.verify_token]])])],64)),m("div",Sf,[m("button",{type:"button",class:"px-4 py-2 text-sm text-gray-500",onClick:l[17]||(l[17]=c=>z.value=!1)},"Cancelar"),l[40]||(l[40]=m("button",{type:"submit",class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg"},"Guardar",-1))])],32)])])):ue("",!0)])):o.value==="chat"?(L(),H("div",Rf,[m("div",Of,[ve.value.length===0?(L(),H("p",Tf," Probá el agente tal cual lo va a ver un visitante — usa la misma config de IA y las mismas tools/base de conocimiento del tenant. ")):ue("",!0),(L(!0),H(he,null,et(ve.value,(c,y)=>(L(),H("div",{key:y,class:tt(["max-w-[80%] px-3 py-2 rounded-lg text-sm whitespace-pre-wrap",c.role==="user"?"bg-brand text-white ml-auto":"bg-gray-100 text-gray-800"])},Q(c.content),3))),128)),N.value?(L(),H("p",Pf,"Pensando...")):ue("",!0)]),m("form",{class:"flex gap-2",onSubmit:rt(P,["prevent"])},[ie(m("input",{"onUpdate:modelValue":l[19]||(l[19]=c=>_.value=c),placeholder:"Escribí un mensaje de prueba...",class:"flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm"},null,512),[[me,_.value]]),m("button",{type:"submit",disabled:N.value,class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg disabled:opacity-50"}," Enviar ",8,If)],32)])):(L(),H("div",Nf,[m("div",kf,[E.value.length===0?(L(),H("div",Df,"Sin conversaciones.")):ue("",!0),(L(!0),H(he,null,et(E.value,c=>(L(),H("button",{key:c.session_id,class:tt(["w-full text-left p-3 hover:bg-gray-50 text-sm",R.value===c.session_id?"bg-gray-50":""]),onClick:y=>V(c.session_id)},[m("div",Vf,Q(c.content),1),m("div",jf,Q(c.session_id),1)],10,Mf))),128))]),m("div",Lf,[R.value?ue("",!0):(L(),H("p",Uf,"Elegí una conversación de la izquierda.")),(L(!0),H(he,null,et(C.value,c=>(L(),H("div",{key:c.ID,class:tt(["max-w-[80%] px-3 py-2 rounded-lg text-sm",c.role==="user"?"bg-brand text-white ml-auto":"bg-gray-100 text-gray-800"])},Q(c.content),3))),128))])]))])}}},Hf=ic({history:Lu("/orchestrator/"),routes:[{path:"/",name:"tenants",component:Ec},{path:"/tenants/:id",name:"tenant-detail",component:Ff,props:!0}]});Ka(eu).use(Hf).mount("#app"); diff --git a/public/orchestrator/assets/index-N2c9c8FD.css b/public/orchestrator/assets/index-N2c9c8FD.css new file mode 100644 index 0000000..2881075 --- /dev/null +++ b/public/orchestrator/assets/index-N2c9c8FD.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.top-0{top:0}.z-50{z-index:50}.col-span-1{grid-column:span 1 / span 1}.col-span-2{grid-column:span 2 / span 2}.mx-auto{margin-left:auto;margin-right:auto}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.flex{display:flex}.grid{display:grid}.h-1\.5{height:.375rem}.h-\[28rem\]{height:28rem}.h-screen{height:100vh}.max-h-\[28rem\]{max-height:28rem}.max-h-\[85vh\]{max-height:85vh}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-24{width:6rem}.w-64{width:16rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-4xl{max-width:56rem}.max-w-\[80\%\]{max-width:80%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(243 244 246 / var(--tw-divide-opacity, 1))}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-black\/40{background-color:#0006}.bg-brand{--tw-bg-opacity: 1;background-color:rgb(142 176 47 / var(--tw-bg-opacity, 1))}.bg-brand\/10{background-color:#8eb02f1a}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-1{padding:.25rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-1{padding-bottom:.25rem}.pr-1\.5{padding-right:.375rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[11px\]{font-size:11px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.capitalize{text-transform:capitalize}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-brand{--tw-text-opacity: 1;color:rgb(142 176 47 / var(--tw-text-opacity, 1))}.text-brand-dark{--tw-text-opacity: 1;color:rgb(113 144 38 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:border-brand:hover{--tw-border-opacity: 1;border-color:rgb(142 176 47 / var(--tw-border-opacity, 1))}.hover\:border-brand\/50:hover{border-color:#8eb02f80}.hover\:bg-brand-dark:hover{--tw-bg-opacity: 1;background-color:rgb(113 144 38 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}@media(prefers-color-scheme:dark){.dark\:divide-gray-800>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(31 41 55 / var(--tw-divide-opacity, 1))}.dark\:border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.dark\:bg-amber-900\/40{background-color:#78350f66}.dark\:bg-brand\/20{background-color:#8eb02f33}.dark\:bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950{--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/40{background-color:#14532d66}.dark\:bg-red-900\/40{background-color:#7f1d1d66}.dark\:text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\:text-brand{--tw-text-opacity: 1;color:rgb(142 176 47 / var(--tw-text-opacity, 1))}.dark\:text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-gray-100:hover{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:hover\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}} diff --git a/public/orchestrator/index.html b/public/orchestrator/index.html index bb293a1..e93a8e7 100644 --- a/public/orchestrator/index.html +++ b/public/orchestrator/index.html @@ -4,8 +4,8 @@ uMind — Orquestador - - + +
diff --git a/rest/controllers/umind_oauth_controller.go b/rest/controllers/umind_oauth_controller.go new file mode 100644 index 0000000..bb1f45a --- /dev/null +++ b/rest/controllers/umind_oauth_controller.go @@ -0,0 +1,84 @@ +package controllers + +import ( + "fmt" + "log" + "strconv" + + "github.com/gofiber/fiber/v2" + "github.com/sujit-baniya/fiber-boilerplate/pkg/models" + "github.com/sujit-baniya/fiber-boilerplate/pkg/services" +) + +// GetUmindConexionesHandler lista las cuentas de correo conectadas de un +// tenant, sin exponer los tokens (ni cifrados ni en claro). +func GetUmindConexionesHandler(c *fiber.Ctx) error { + tenantID, err := strconv.ParseUint(c.Query("tenant_id"), 10, 64) + if err != nil || tenantID == 0 { + return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": "tenant_id requerido"}) + } + items, err := models.GetUmindConexionesByTenant(uint(tenantID)) + if err != nil { + return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{"error": err.Error()}) + } + out := make([]fiber.Map, len(items)) + for i, cx := range items { + out[i] = fiber.Map{ + "ID": cx.ID, "tenant_id": cx.TenantID, "proveedor": cx.Proveedor, + "email": cx.Email, "activo": cx.Activo, "expira_en": cx.ExpiraEn, + } + } + return c.JSON(fiber.Map{"items": out}) +} + +// UmindConectarHandler redirige al staff a la pantalla de consentimiento de +// Google/Microsoft. Ruta: GET /app/umind/conexiones/conectar?tenant_id=&proveedor= +func UmindConectarHandler(c *fiber.Ctx) error { + tenantID, err := strconv.ParseUint(c.Query("tenant_id"), 10, 64) + if err != nil || tenantID == 0 { + return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": "tenant_id requerido"}) + } + proveedor := c.Query("proveedor") + if _, err := models.GetUmindTenantByID(uint(tenantID)); err != nil { + return c.Status(fiber.StatusNotFound).JSON(fiber.Map{"error": "tenant no encontrado"}) + } + + url, err := services.IniciarConexionOAuth(proveedor, uint(tenantID)) + if err != nil { + return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": err.Error()}) + } + return c.Redirect(url, fiber.StatusFound) +} + +// UmindOAuthCallbackHandler recibe la vuelta de Google/Microsoft, intercambia +// el code y redirige al staff de vuelta a la SPA. +// Ruta: GET /app/umind/conexiones/callback/:proveedor +func UmindOAuthCallbackHandler(c *fiber.Ctx) error { + proveedor := c.Params("proveedor") + if errParam := c.Query("error"); errParam != "" { + return c.Redirect(fmt.Sprintf("/orchestrator/?oauth_error=%s", errParam), fiber.StatusFound) + } + code := c.Query("code") + state := c.Query("state") + if code == "" || state == "" { + return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": "callback inválido"}) + } + + conexion, err := services.CompletarConexionOAuth(proveedor, code, state) + if err != nil { + log.Printf("[UMIND_OAUTH] error completando conexión (%s): %v", proveedor, err) + return c.Redirect("/orchestrator/?oauth_error=1", fiber.StatusFound) + } + return c.Redirect(fmt.Sprintf("/orchestrator/tenants/%d?tab=conexiones", conexion.TenantID), fiber.StatusFound) +} + +func DeleteUmindConexionHandler(c *fiber.Ctx) error { + id, err := strconv.ParseUint(c.Params("id"), 10, 64) + if err != nil { + return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": "id inválido"}) + } + if err := models.DeleteUmindConexion(uint(id)); err != nil { + return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{"error": err.Error()}) + } + return c.JSON(fiber.Map{"ok": true}) +} diff --git a/rest/routes/user.go b/rest/routes/user.go index f3e2930..472dbbf 100755 --- a/rest/routes/user.go +++ b/rest/routes/user.go @@ -374,6 +374,10 @@ func UserRoutes(app fiber.Router) { protected.Put("/umind/canales/:id", middlewares.SoloAdmin, controllers.UpdateUmindCanalHandler) protected.Delete("/umind/canales/:id", middlewares.SoloAdmin, controllers.DeleteUmindCanalHandler) protected.Post("/umind/chat", controllers.UmindChatPruebaHandler) + protected.Get("/umind/conexiones", controllers.GetUmindConexionesHandler) + protected.Get("/umind/conexiones/conectar", middlewares.SoloAdmin, controllers.UmindConectarHandler) + protected.Get("/umind/conexiones/callback/:proveedor", controllers.UmindOAuthCallbackHandler) + protected.Delete("/umind/conexiones/:id", middlewares.SoloAdmin, controllers.DeleteUmindConexionHandler) // ─── uMind Orquestador (SPA Vue) ──────────────────────────────────────────── // Estáticos reales (JS/CSS del build) ya los sirve el Static("/") general